Consistent naming for CS template enums
[e-mobility-charging-stations-simulator.git] / src / charging-station / ChargingStation.ts
index 9d2b687448d37c1063eda0cd6ff98831e6de7484..30b21bdc357bd2ab65c70e90c4232b5352961750 100644 (file)
@@ -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;
         }