-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
optimize tap changer steps db writings and db reading
Signed-off-by: Etienne LESOT <[email protected]>
- Loading branch information
Showing
11 changed files
with
1,044 additions
and
114 deletions.
There are no files selected for viewing
181 changes: 123 additions & 58 deletions
181
...k-store-server/src/main/java/com/powsybl/network/store/server/NetworkStoreRepository.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
...ore-server/src/main/java/com/powsybl/network/store/server/json/TapChangerStepSqlData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/** | ||
* Copyright (c) 2025, RTE (http://www.rte-france.com) | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
*/ | ||
package com.powsybl.network.store.server.json; | ||
|
||
import com.powsybl.network.store.model.TapChangerStepAttributes; | ||
import com.powsybl.network.store.model.TapChangerType; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
/** | ||
* @author Etienne Lesot <etienne.lesot at rte-france.com> | ||
*/ | ||
@ToString | ||
@Builder | ||
@AllArgsConstructor | ||
@Getter | ||
public class TapChangerStepSqlData { | ||
|
||
private double rho; | ||
private double r; | ||
private double x; | ||
private double g; | ||
private double b; | ||
private Double alpha; | ||
private Integer index; | ||
private Integer side; | ||
private TapChangerType type; | ||
|
||
public TapChangerStepSqlData() { | ||
// empty constructor for Jackson | ||
} | ||
|
||
public static TapChangerStepSqlData of(TapChangerStepAttributes tapChangerStepAttributes) { | ||
return TapChangerStepSqlData.builder() | ||
.rho(tapChangerStepAttributes.getRho()) | ||
.r(tapChangerStepAttributes.getR()) | ||
.x(tapChangerStepAttributes.getX()) | ||
.g(tapChangerStepAttributes.getG()) | ||
.b(tapChangerStepAttributes.getB()) | ||
.alpha(tapChangerStepAttributes.getAlpha()) | ||
.index(tapChangerStepAttributes.getIndex()) | ||
.side(tapChangerStepAttributes.getSide()) | ||
.type(tapChangerStepAttributes.getType()) | ||
.build(); | ||
} | ||
|
||
public TapChangerStepAttributes toTapChangerStepAttributes() { | ||
return TapChangerStepAttributes.builder() | ||
.rho(rho) | ||
.r(r) | ||
.x(x) | ||
.g(g) | ||
.b(b) | ||
.alpha(alpha) | ||
.index(index) | ||
.side(side) | ||
.type(type) | ||
.build(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.