-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from com-pas/release/0.0.2
Release/0.0.2
- Loading branch information
Showing
15 changed files
with
548 additions
and
56 deletions.
There are no files selected for viewing
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
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
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
32 changes: 32 additions & 0 deletions
32
sct-commons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/BayAdapter.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,32 @@ | ||
// SPDX-FileCopyrightText: 2021 RTE FRANCE | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.lfenergy.compas.sct.commons.scl.sstation; | ||
|
||
import org.lfenergy.compas.scl2007b4.model.TBay; | ||
import org.lfenergy.compas.sct.commons.exception.ScdException; | ||
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter; | ||
|
||
public class BayAdapter extends SclElementAdapter<VoltageLevelAdapter, TBay> { | ||
|
||
public BayAdapter(VoltageLevelAdapter parentAdapter){super(parentAdapter);} | ||
|
||
public BayAdapter(VoltageLevelAdapter parentAdapter, TBay currentElem){ | ||
super (parentAdapter, currentElem); | ||
} | ||
|
||
public BayAdapter(VoltageLevelAdapter parentAdapter, String bayName) throws ScdException { | ||
super(parentAdapter); | ||
TBay tBay = parentAdapter.getCurrentElem().getBay() | ||
.stream() | ||
.filter(bay -> bay.getName().equals(bayName)) | ||
.findFirst() | ||
.orElseThrow(() -> new ScdException("Unknown Bay name :" + bayName)); | ||
setCurrentElem(tBay); | ||
} | ||
|
||
@Override | ||
protected boolean amChildElementRef() { | ||
return parentAdapter.getCurrentElem().getBay().contains(currentElem); | ||
} | ||
} |
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
43 changes: 43 additions & 0 deletions
43
...mmons/src/main/java/org/lfenergy/compas/sct/commons/scl/sstation/VoltageLevelAdapter.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,43 @@ | ||
// SPDX-FileCopyrightText: 2021 RTE FRANCE | ||
// | ||
// SPDX-License-Identifier: Apache-2.0 | ||
package org.lfenergy.compas.sct.commons.scl.sstation; | ||
|
||
import org.lfenergy.compas.scl2007b4.model.TVoltageLevel; | ||
import org.lfenergy.compas.sct.commons.exception.ScdException; | ||
import org.lfenergy.compas.sct.commons.scl.SclElementAdapter; | ||
|
||
import java.util.Optional; | ||
|
||
public class VoltageLevelAdapter extends SclElementAdapter<SubstationAdapter, TVoltageLevel> { | ||
|
||
public VoltageLevelAdapter(SubstationAdapter parentAdapter) {super(parentAdapter);} | ||
|
||
public VoltageLevelAdapter(SubstationAdapter substationAdapter, TVoltageLevel currentElem){ | ||
super(substationAdapter, currentElem); | ||
} | ||
|
||
public VoltageLevelAdapter(SubstationAdapter parentAdapter, String vLevelName) throws ScdException { | ||
super(parentAdapter); | ||
TVoltageLevel tVoltageLevel = parentAdapter.getCurrentElem().getVoltageLevel() | ||
.stream() | ||
.filter(vLevel -> vLevel.getName().equals(vLevelName)) | ||
.findFirst() | ||
.orElseThrow(() -> new ScdException("Unknown VoltageLevel name :" + vLevelName)); | ||
setCurrentElem(tVoltageLevel); | ||
} | ||
|
||
|
||
@Override | ||
protected boolean amChildElementRef() { | ||
return parentAdapter.getCurrentElem().getVoltageLevel().contains(currentElem); | ||
} | ||
|
||
public Optional<BayAdapter> getBayAdapter(String bayName) { | ||
return currentElem.getBay() | ||
.stream() | ||
.filter(tBay -> tBay.getName().equals(bayName)) | ||
.map(tBay -> new BayAdapter(this, tBay)) | ||
.findFirst(); | ||
} | ||
} |
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.