-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First version of merging view : part of Substations & Voltagelevels m…
…anagement (#963) Signed-off-by: Thomas ADAM <[email protected]> Change parent module version to 3.1.0 into merging-view Signed-off-by: Thomas ADAM <[email protected]>
- Loading branch information
Showing
17 changed files
with
2,234 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!-- | ||
Copyright (c) 2019, 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/. | ||
--> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<artifactId>powsybl-iidm</artifactId> | ||
<groupId>com.powsybl</groupId> | ||
<version>3.1.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>powsybl-iidm-mergingview</artifactId> | ||
<name>IIDM Merging View</name> | ||
<description>A network merging tool for IIDM model</description> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<configuration> | ||
<archive> | ||
<manifestEntries> | ||
<Automatic-Module-Name>com.powsybl.iidm.mergingview</Automatic-Module-Name> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<!-- Compilation dependencies --> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>powsybl-commons</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>powsybl-iidm-api</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<!-- Test dependencies --> | ||
<dependency> | ||
<groupId>com.google.jimfs</groupId> | ||
<artifactId>jimfs</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>slf4j-simple</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>powsybl-iidm-impl</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>${project.groupId}</groupId> | ||
<artifactId>powsybl-iidm-test</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
110 changes: 110 additions & 0 deletions
110
iidm/iidm-mergingview/src/main/java/com/powsybl/iidm/mergingview/AbstractAdapter.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,110 @@ | ||
/** | ||
* Copyright (c) 2019, 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.iidm.mergingview; | ||
|
||
import java.util.Collection; | ||
import java.util.Objects; | ||
import java.util.Set; | ||
|
||
import com.powsybl.commons.extensions.Extension; | ||
import com.powsybl.iidm.network.Identifiable; | ||
|
||
/** | ||
* @author Thomas Adam <tadam at silicom.fr> | ||
*/ | ||
abstract class AbstractAdapter<I extends Identifiable<I>> implements Identifiable<I> { | ||
|
||
private final I delegate; | ||
|
||
private final MergingViewIndex index; | ||
|
||
protected AbstractAdapter(final I delegate, final MergingViewIndex index) { | ||
this.delegate = Objects.requireNonNull(delegate, "delegate is null"); | ||
this.index = Objects.requireNonNull(index, "merging view index is null"); | ||
} | ||
|
||
@Override | ||
public MergingView getNetwork() { | ||
return index.getView(); | ||
} | ||
|
||
// ------------------------------- | ||
// Simple delegated methods ------ | ||
// ------------------------------- | ||
public I getDelegate() { | ||
return delegate; | ||
} | ||
|
||
public MergingViewIndex getIndex() { | ||
return index; | ||
} | ||
|
||
@Override | ||
public String getId() { | ||
return delegate.getId(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return delegate.getName(); | ||
} | ||
|
||
@Override | ||
public boolean hasProperty() { | ||
return delegate.hasProperty(); | ||
} | ||
|
||
@Override | ||
public boolean hasProperty(final String key) { | ||
return delegate.hasProperty(key); | ||
} | ||
|
||
@Override | ||
public String getProperty(final String key) { | ||
return delegate.getProperty(key); | ||
} | ||
|
||
@Override | ||
public String getProperty(final String key, final String defaultValue) { | ||
return delegate.getProperty(key, defaultValue); | ||
} | ||
|
||
@Override | ||
public String setProperty(final String key, final String value) { | ||
return delegate.setProperty(key, value); | ||
} | ||
|
||
@Override | ||
public Set<String> getPropertyNames() { | ||
return delegate.getPropertyNames(); | ||
} | ||
|
||
@Override | ||
public <E extends Extension<I>> void addExtension(final Class<? super E> type, final E extension) { | ||
delegate.addExtension(type, extension); | ||
} | ||
|
||
@Override | ||
public <E extends Extension<I>> E getExtension(final Class<? super E> type) { | ||
return delegate.getExtension(type); | ||
} | ||
|
||
@Override | ||
public <E extends Extension<I>> E getExtensionByName(final String name) { | ||
return delegate.getExtensionByName(name); | ||
} | ||
|
||
@Override | ||
public <E extends Extension<I>> boolean removeExtension(final Class<E> type) { | ||
return delegate.removeExtension(type); | ||
} | ||
|
||
@Override | ||
public <E extends Extension<I>> Collection<E> getExtensions() { | ||
return delegate.getExtensions(); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
iidm/iidm-mergingview/src/main/java/com/powsybl/iidm/mergingview/MergingNetworkListener.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,30 @@ | ||
/** | ||
* Copyright (c) 2019, 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.iidm.mergingview; | ||
|
||
import com.powsybl.iidm.network.Identifiable; | ||
import com.powsybl.iidm.network.NetworkListener; | ||
|
||
/** | ||
* @author Thomas Adam <tadam at silicom.fr> | ||
*/ | ||
public class MergingNetworkListener implements NetworkListener { | ||
@Override | ||
public void onCreation(final Identifiable identifiable) { | ||
throw MergingView.NOT_IMPLEMENTED_EXCEPTION; | ||
} | ||
|
||
@Override | ||
public void onRemoval(final Identifiable identifiable) { | ||
throw MergingView.NOT_IMPLEMENTED_EXCEPTION; | ||
} | ||
|
||
@Override | ||
public void onUpdate(final Identifiable identifiable, final String attribute, final Object oldValue, final Object newValue) { | ||
throw MergingView.NOT_IMPLEMENTED_EXCEPTION; | ||
} | ||
} |
Oops, something went wrong.