StandardParametersKey.ConnectorPhaseRotation
)
) {
- const connectorPhaseRotation = [];
+ const connectorsPhaseRotation: string[] = [];
if (this.hasEvses) {
for (const evseStatus of this.evses.values()) {
for (const connectorId of evseStatus.connectors.keys()) {
- // AC/DC
- if (connectorId === 0 && this.getNumberOfPhases() === 0) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.RST}`);
- } else if (connectorId > 0 && this.getNumberOfPhases() === 0) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.NotApplicable}`);
- // AC
- } else if (connectorId > 0 && this.getNumberOfPhases() === 1) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.NotApplicable}`);
- } else if (connectorId > 0 && this.getNumberOfPhases() === 3) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.RST}`);
- }
+ connectorsPhaseRotation.push(
+ ChargingStationUtils.getPhaseRotationValue(connectorId, this.getNumberOfPhases())
+ );
}
}
} else {
for (const connectorId of this.connectors.keys()) {
- // AC/DC
- if (connectorId === 0 && this.getNumberOfPhases() === 0) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.RST}`);
- } else if (connectorId > 0 && this.getNumberOfPhases() === 0) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.NotApplicable}`);
- // AC
- } else if (connectorId > 0 && this.getNumberOfPhases() === 1) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.NotApplicable}`);
- } else if (connectorId > 0 && this.getNumberOfPhases() === 3) {
- connectorPhaseRotation.push(`${connectorId}.${ConnectorPhaseRotation.RST}`);
- }
+ connectorsPhaseRotation.push(
+ ChargingStationUtils.getPhaseRotationValue(connectorId, this.getNumberOfPhases())
+ );
}
}
ChargingStationConfigurationUtils.addConfigurationKey(
this,
StandardParametersKey.ConnectorPhaseRotation,
- connectorPhaseRotation.toString()
+ connectorsPhaseRotation.toString()
);
}
if (
type ChargingSchedulePeriod,
type ChargingStationInfo,
type ChargingStationTemplate,
+ ConnectorPhaseRotation,
type ConnectorStatus,
ConnectorStatusEnum,
CurrentType,
return true;
}
+ public static getPhaseRotationValue(connectorId: number, numberOfPhases: number): string {
+ // AC/DC
+ if (connectorId === 0 && numberOfPhases === 0) {
+ return `${connectorId}.${ConnectorPhaseRotation.RST}`;
+ } else if (connectorId > 0 && numberOfPhases === 0) {
+ return `${connectorId}.${ConnectorPhaseRotation.NotApplicable}`;
+ // AC
+ } else if (connectorId > 0 && numberOfPhases === 1) {
+ return `${connectorId}.${ConnectorPhaseRotation.NotApplicable}`;
+ } else if (connectorId > 0 && numberOfPhases === 3) {
+ return `${connectorId}.${ConnectorPhaseRotation.RST}`;
+ }
+ }
+
public static getMaxNumberOfEvses(evses: Record<string, EvseTemplate>): number {
if (!evses) {
return -1;