Skip to content

Commit

Permalink
Fix code smells
Browse files Browse the repository at this point in the history
Signed-off-by: lisrte <[email protected]>
  • Loading branch information
Lisrte committed Nov 24, 2023
1 parent f35843b commit a263d0f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import static com.powsybl.dynawaltz.parameters.ParameterType.BOOL;
import static com.powsybl.dynawaltz.parameters.ParameterType.DOUBLE;
import static java.lang.Boolean.TRUE;

/**
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>}
Expand All @@ -35,7 +36,7 @@ protected AbstractDynamicLibEventDisconnection(Identifiable<?> equipment, double

@Override
public String getLib() {
return equipmentHasDynamicModel.getValue() ? DYNAMIC_MODEL_LIB : DEFAULT_MODEL_LIB;
return TRUE == equipmentHasDynamicModel.getValue() ? DYNAMIC_MODEL_LIB : DEFAULT_MODEL_LIB;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

import static com.powsybl.dynawaltz.parameters.ParameterType.BOOL;
import static com.powsybl.dynawaltz.parameters.ParameterType.DOUBLE;
import static java.lang.Boolean.TRUE;

/**
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>}
Expand Down Expand Up @@ -51,7 +52,7 @@ public static boolean isConnectable(IdentifiableType type) {

@Override
public String getLib() {
return equipmentHasDynamicModel.getValue() ? DYNAMIC_MODEL_LIB : DEFAULT_MODEL_LIB;
return TRUE == equipmentHasDynamicModel.getValue() ? DYNAMIC_MODEL_LIB : DEFAULT_MODEL_LIB;
}

@Override
Expand All @@ -60,7 +61,7 @@ public String getName() {
}

private List<VarConnection> getVarConnectionsWith(ControllableEquipment connected) {
return List.of(equipmentHasDynamicModel.getValue() ? new VarConnection("step_step_value", connected.getDeltaPVarName())
return List.of(TRUE == equipmentHasDynamicModel.getValue() ? new VarConnection("step_step_value", connected.getDeltaPVarName())
: new VarConnection("event_state1", connected.getDeltaPVarName()));
}

Expand All @@ -74,7 +75,7 @@ public void createMacroConnections(MacroConnectionsAdder adder) {

@Override
protected void createEventSpecificParameters(ParametersSet paramSet) {
if (equipmentHasDynamicModel.getValue()) {
if (TRUE == equipmentHasDynamicModel.getValue()) {
paramSet.addParameter("step_Value0", DOUBLE, Double.toString(0));
paramSet.addParameter("step_tStep", DOUBLE, Double.toString(getStartTime()));
paramSet.addParameter("step_Height", DOUBLE, Double.toString(deltaP));
Expand Down

0 comments on commit a263d0f

Please sign in to comment.