Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check measurement point are connected #342

Merged
merged 9 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,26 @@ public final class BuildersUtil {
private BuildersUtil() {
}

/**
* Returns the ActionConnectionPoint (bus or bus bar section) identified by the staticId parameter
Lisrte marked this conversation as resolved.
Show resolved Hide resolved
* Verifies the point is properly energized, if not returns null
Lisrte marked this conversation as resolved.
Show resolved Hide resolved
* @param network the network containing the ActionConnectionPoint
* @param staticId the identifiable id
* @return the energized action connection point if found, <code>null</code> instead
*/
public static Identifiable<?> getActionConnectionPoint(Network network, String staticId) {
Lisrte marked this conversation as resolved.
Show resolved Hide resolved
BusbarSection busbarSection = network.getBusbarSection(staticId);
return busbarSection != null && !Double.isNaN(busbarSection.getV())
? busbarSection
: getVoltageOnBus(network.getBusBreakerView().getBus(staticId));
: getEnergizedBus(network.getBusBreakerView().getBus(staticId));
}

private static Bus getVoltageOnBus(Bus bus) {
/**
* Verifies and returns the bus if it is properly energized, if not returns null
* @param bus the reviewed bus
* @return the energized bus if found, <code>null</code> instead
*/
private static Bus getEnergizedBus(Bus bus) {
return bus != null && bus.isInMainConnectedComponent() && !Double.isNaN(bus.getV()) ? bus : null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import java.util.Optional;

/**
* Interface for buses used by automatons for measure or event for various actions
* Interface for buses and bsu bar sections used by automatons for measure or event for various actions
Lisrte marked this conversation as resolved.
Show resolved Hide resolved
* @author Laurent Issertial {@literal <laurent.issertial at rte-france.com>}
*/
public interface ActionConnectionPoint extends Model {
Expand Down
Loading