Skip to content

Commit

Permalink
code review remarqs
Browse files Browse the repository at this point in the history
  • Loading branch information
ghazwarhili committed Sep 12, 2024
1 parent 99ad321 commit c607863
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ public class StaticVarCompensatorCreationInfos extends InjectionCreationInfos {
@Schema(description = "Regulating terminal voltage level id")
private String regulatingTerminalVlId;

@Schema(description = "add standby automate")
private boolean standbyAutomateOn;
@Schema(description = "standby automaton on")
private boolean standbyAutomatonOn;

@Schema(description = "Standby")
private boolean standby;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class StaticCompensatorCreationEntity extends InjectionCreationEntity {
private String regulatingTerminalVlId;

@Column
private boolean standbyAutomateOn;
private boolean standbyAutomatonOn;

@Column
private boolean standby;
Expand Down Expand Up @@ -108,7 +108,7 @@ private void assignAttributes(StaticVarCompensatorCreationInfos creationInfos) {
this.regulatingTerminalId = creationInfos.getRegulatingTerminalId();
this.regulatingTerminalType = creationInfos.getRegulatingTerminalType();
this.regulatingTerminalVlId = creationInfos.getRegulatingTerminalVlId();
this.standbyAutomateOn = creationInfos.isStandbyAutomateOn();
this.standbyAutomatonOn = creationInfos.isStandbyAutomatonOn();
this.standby = creationInfos.isStandby();
this.b0 = creationInfos.getB0();
this.q0 = creationInfos.getQ0();
Expand Down Expand Up @@ -150,7 +150,7 @@ public StaticVarCompensatorCreationInfos toModificationInfos() {
.regulatingTerminalType(getRegulatingTerminalType())
.regulatingTerminalVlId(getRegulatingTerminalVlId())
// Standby automaton
.standbyAutomateOn(isStandbyAutomateOn())
.standbyAutomatonOn(isStandbyAutomatonOn())
.standby(isStandby())
.b0(getB0())
.q0(getQ0())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public void apply(Network network, ReportNode subReportNode) {
if (Objects.isNull(modificationInfos.getMinSusceptance()) && Objects.nonNull(modificationInfos.getMinQAtNominalV())) {
modificationInfos.setMinSusceptance((modificationInfos.getMinQAtNominalV()) / Math.pow(voltageLevel.getNominalV(), 2));
}
if (Boolean.TRUE.equals(modificationInfos.isStandbyAutomateOn()) && Objects.isNull(modificationInfos.getB0())
if (Boolean.TRUE.equals(modificationInfos.isStandbyAutomatonOn()) && Objects.isNull(modificationInfos.getB0())
&& Objects.nonNull(modificationInfos.getQ0())) {
modificationInfos.setB0((modificationInfos.getQ0()) / Math.pow(voltageLevel.getNominalV(), 2));
}
Expand Down Expand Up @@ -142,7 +142,7 @@ private void addExtensionsToStaticVarCompensator(StaticVarCompensatorCreationInf

private void reportStaticVarCompensatorStandbyAutomaton(StaticVarCompensatorCreationInfos staticVarCompensatorCreationInfos,
StaticVarCompensator staticVarCompensator, ReportNode subReportNode) {
if (Boolean.TRUE.equals(staticVarCompensatorCreationInfos.isStandbyAutomateOn())) {
if (Boolean.TRUE.equals(staticVarCompensatorCreationInfos.isStandbyAutomatonOn())) {
List<ReportNode> standbyAutomatonReports = new ArrayList<>();
try {
staticVarCompensator.newExtension(StandbyAutomatonAdder.class)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-latest.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-latest.xsd">
<changeSet author="rehiligha (generated)" id="1726090378366-29">
<changeSet author="rehiligha (generated)" id="1726135394096-29">
<createTable tableName="static_var_compensator_creation">
<column name="equipment_id" type="VARCHAR(255)"/>
<column name="equipment_name" type="VARCHAR(255)"/>
Expand All @@ -26,15 +26,15 @@
<column name="regulating_terminal_vl_id" type="VARCHAR(255)"/>
<column name="regulation_mode" type="VARCHAR(255)"/>
<column name="standby" type="BOOLEAN"/>
<column name="standby_automate_on" type="BOOLEAN"/>
<column name="standby_automaton_on" type="BOOLEAN"/>
<column name="voltage_regulation_type" type="VARCHAR(255)"/>
<column name="voltage_setpoint" type="FLOAT(53)"/>
<column name="id" type="UUID">
<constraints nullable="false" primaryKey="true" primaryKeyName="static_var_compensator_creationPK"/>
</column>
</createTable>
</changeSet>
<changeSet author="rehiligha (generated)" id="1726090378366-50">
<changeSet author="rehiligha (generated)" id="1726135394096-50">
<addForeignKeyConstraint baseColumnNames="id" baseTableName="static_var_compensator_creation" constraintName="staticVarCompensatorCreation_id_fk_constraint" deferrable="false" initiallyDeferred="false" referencedColumnNames="id" referencedTableName="modification" validate="true"/>
</changeSet>
</databaseChangeLog>
2 changes: 1 addition & 1 deletion src/main/resources/db/changelog/db.changelog-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -304,5 +304,5 @@ databaseChangeLog:
file: changesets/changelog_20240709T090545Z.xml
relativeToChangelogFile: true
- include:
file: changesets/changelog_20240911T213241Z.xml
file: changesets/changelog_20240912T100256Z.xml
relativeToChangelogFile: true
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ protected ModificationInfos buildModification() {
.regulatingTerminalVlId("v1")
.regulatingTerminalId("idGenerator1")
.regulatingTerminalType("GENERATOR")
.standbyAutomateOn(true)
.standbyAutomatonOn(true)
.standby(true)
.b0(221.0)
.lowVoltageSetpoint(200.0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ protected ModificationInfos buildModification() {
.voltageSetpoint(120.0)
.reactivePowerSetpoint(300.0)
.voltageRegulationType(VoltageRegulationType.LOCAL)
.standbyAutomateOn(false)
.standbyAutomatonOn(false)
.properties(List.of(FreePropertyInfos.builder().name(PROPERTY_NAME).value(PROPERTY_VALUE).build()))
.build();
}
Expand All @@ -73,7 +73,7 @@ protected ModificationInfos buildModificationUpdate() {
.stashed(false)
.equipmentId("idStaticVarCompensator1Edited")
.equipmentName("staticVarCompensatorNameEdited")
.standbyAutomateOn(true)
.standbyAutomatonOn(true)
.standby(true)
.b0(221.0)
.lowVoltageSetpoint(200.0)
Expand Down Expand Up @@ -197,7 +197,7 @@ public void testCreateWithErrors() throws Exception {
@Test
public void testCreateWithStandbyAutomatonErrors() throws Exception {
StaticVarCompensatorCreationInfos compensatorCreationInfos = (StaticVarCompensatorCreationInfos) buildModification();
compensatorCreationInfos.setStandbyAutomateOn(true);
compensatorCreationInfos.setStandbyAutomatonOn(true);
compensatorCreationInfos.setB0(300.0);

String compensatorCreationInfosJson = mapper.writeValueAsString(compensatorCreationInfos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1311,7 +1311,7 @@ public void testStaticVarCompensatorCreation() {
.connectionName("Bot").connectionDirection(ConnectablePosition.Direction.BOTTOM)
.connectionPosition(2)
.regulationMode(VOLTAGE)
.standbyAutomateOn(true)
.standbyAutomatonOn(true)
.standby(true)
.build().toEntity();

Expand Down

0 comments on commit c607863

Please sign in to comment.