Skip to content

Commit

Permalink
fix after rebase
Browse files Browse the repository at this point in the history
Signed-off-by: Abdelsalem <abdelsalem.hedhili@rte-france.com>
  • Loading branch information
AbdelHedhili committed Oct 31, 2023
1 parent ba16312 commit 945bbd5
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import lombok.extern.slf4j.Slf4j;
import org.gridsuite.shortcircuit.server.dto.ShortCircuitLimits;
import org.gridsuite.shortcircuit.server.entities.*;
import org.gridsuite.shortcircuit.server.utils.ShortcircuitUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
Expand Down Expand Up @@ -111,7 +110,7 @@ private static FaultResultEntity toFortescueFaultResultEntity(FortescueFaultResu
entity.setFeederResults(faultResult.getFeederResults().stream()
.map(feederResult -> {
final FortescueValue feederFortescueCurrent = ((FortescueFeederResult) feederResult).getCurrent();
final FortescueValue.ThreePhaseValue feederFortescueThreePhaseValue = ShortcircuitUtils.toThreePhaseValue(feederFortescueCurrent);
final FortescueValue.ThreePhaseValue feederFortescueThreePhaseValue = feederFortescueCurrent.toThreePhaseValue();
return new FeederResultEmbeddable(feederResult.getConnectableId(), Double.NaN, new FortescueResultEmbeddable(
feederFortescueCurrent.getPositiveMagnitude(), feederFortescueCurrent.getZeroMagnitude(),
feederFortescueCurrent.getNegativeMagnitude(), feederFortescueCurrent.getPositiveAngle(),
Expand All @@ -128,12 +127,10 @@ private static FaultResultEntity toFortescueFaultResultEntity(FortescueFaultResu
entity.setDeltaCurrentIpMax(current.getPositiveMagnitude() - entity.getIpMax() / 1000.0);
}


//We here use the function toThreePhaseValue from the utils class instead of FortescueValue's one because it is currently private by mistake, to be changed once Powsybl core 6.0.0 is out
final FortescueValue.ThreePhaseValue currentThreePhaseValue = ShortcircuitUtils.toThreePhaseValue(current);
final FortescueValue.ThreePhaseValue currentThreePhaseValue = current.toThreePhaseValue();
entity.setFortescueCurrent(new FortescueResultEmbeddable(current.getPositiveMagnitude(), current.getZeroMagnitude(), current.getNegativeMagnitude(), current.getPositiveAngle(), current.getZeroAngle(), current.getNegativeAngle(), currentThreePhaseValue.getMagnitudeA(), currentThreePhaseValue.getMagnitudeB(), currentThreePhaseValue.getMagnitudeC(), currentThreePhaseValue.getAngleA(), currentThreePhaseValue.getAngleB(), currentThreePhaseValue.getAngleC()));
final FortescueValue voltage = faultResult.getVoltage();
final FortescueValue.ThreePhaseValue voltageThreePhaseValue = ShortcircuitUtils.toThreePhaseValue(voltage);
final FortescueValue.ThreePhaseValue voltageThreePhaseValue = voltage.toThreePhaseValue();
entity.setFortescueVoltage(new FortescueResultEmbeddable(voltage.getPositiveMagnitude(), voltage.getZeroMagnitude(), voltage.getNegativeMagnitude(), voltage.getPositiveAngle(), voltage.getZeroAngle(), voltage.getNegativeAngle(), voltageThreePhaseValue.getMagnitudeA(), voltageThreePhaseValue.getMagnitudeB(), voltageThreePhaseValue.getMagnitudeC(), voltageThreePhaseValue.getAngleA(), voltageThreePhaseValue.getAngleB(), voltageThreePhaseValue.getAngleC()));

return entity;
Expand Down

0 comments on commit 945bbd5

Please sign in to comment.