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

Sct initial push #17

Merged
merged 29 commits into from
Sep 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
8b0ef75
RSR-31 / Create a new SCD file with Header
syllamoh Apr 19, 2021
f54fdda
RSR-31 / Create a new SCD file with Header
syllamoh Apr 19, 2021
2a11e83
Merge branch 'sct-initial-push' of github.com:com-pas/compas-sct into…
syllamoh Apr 19, 2021
12ea366
set java version for source and target in POMs
syllamoh Apr 19, 2021
d299740
RSR-31 / Create a new SCD file with Header
syllamoh Apr 19, 2021
ebd8e46
set java version for source and target in POMs
syllamoh Apr 19, 2021
457860a
Merge branch 'sct-initial-push' of github.com:com-pas/compas-sct into…
syllamoh Apr 19, 2021
05605c2
Add copyright to files
syllamoh Apr 19, 2021
1ca10bb
Restructure ExtRef info (signal, binding, source)
syllamoh Apr 22, 2021
7972bff
Add license info for REUSE compliance
syllamoh Apr 22, 2021
6beaa72
Merge branch 'develop' into sct-initial-push
May 6, 2021
e6991da
Merge branch 'develop' into sct-initial-push
May 6, 2021
3688fc8
Github action aangepast voor Sonar.
May 6, 2021
040ba52
remove test files from src/resources
syllamoh May 12, 2021
12733cd
Merge branch 'sct-initial-push' of github.com:com-pas/compas-sct into…
syllamoh May 12, 2021
ca751d9
branche reinitilized to take into accoout compas new packaging
syllamoh Aug 20, 2021
2e3fbc6
add copyright to POM file
syllamoh Aug 20, 2021
12f7639
use concrete COMPAS package version
syllamoh Aug 20, 2021
0e8cec0
add COMPAS GITHUB packaging repo
syllamoh Aug 20, 2021
4d74c1d
create custom mvn setting for CI script
syllamoh Aug 20, 2021
f894f3d
correct typo in maven command
syllamoh Aug 20, 2021
8b1cd3e
create compas sct documentation
syllamoh Aug 23, 2021
ca2d82f
use known package version
syllamoh Aug 23, 2021
2d7918f
add package diagram for compas sct architecture
syllamoh Aug 23, 2021
4f9572b
add REUSE configuration files
syllamoh Aug 23, 2021
e487cde
rename .reuse file
syllamoh Aug 23, 2021
5ce2030
remove empty modules, complete documentation ...
syllamoh Sep 6, 2021
a9cc9c1
add reuse compliance copyright to a file ...
syllamoh Sep 6, 2021
edc3d0d
adjust jacoco aggregate module ...
syllamoh Sep 6, 2021
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
40 changes: 33 additions & 7 deletions .github/workflows/sonarcloud-analysis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2021 Alliander N.V.
# SPDX-FileCopyrightText: 2020 Alliander N.V.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be 2021

#
# SPDX-License-Identifier: Apache-2.0

Expand All @@ -7,15 +7,41 @@ name: SonarCloud Analysis
on: push

jobs:
sonarcloud:
name: SonarCloud
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
fetch-depth: 0
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Cache SonarCloud packages
uses: actions/cache@v1
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v1
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
- name: Create custom Maven Settings.xml
uses: whelk-io/maven-settings-xml-action@v18
with:
output_file: custom_maven_settings.xml
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: |
mvn -B -s custom_maven_settings.xml \
-Dsonar.projectKey=com-pas_compas-sct \
-Dsonar.organization=com-pas \
-Dsonar.host.url=https://sonarcloud.io \
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# SPDX-FileCopyrightText: 2020 RTE FRANCE
#
# SPDX-License-Identifier: Apache-2.0

HELP.md
target/
.scannerwork
sonar-project.properties
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**
!**/src/test/**

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
build/

### VS Code ###
.vscode/
12 changes: 12 additions & 0 deletions .reuse/dep5
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: compas-sct
Upstream-Contact: Mohamed SYLLA <mohamed.sylla@rte-france.com>
Source: https://github.com/com-pas/compas-sct

Files: doc/images/*
Copyright: 2021 RTE FRANCE
License: Apache-2.0

Files: doc/drawio/*
Copyright: 2021 RTE FRANCE
License: Apache-2.0
104 changes: 104 additions & 0 deletions doc/compas-sct.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
<!-- -->
<!-- SPDX-License-Identifier: Apache-2.0 -->
# COMPAS SCT (Substation Configuration Tool)
## Introduction

The CoMPAS SCT (System Configuration Tool) is part of the CoMPAS (Configuration Module for Power System Automation)
ecosystem which is an open source project aimed at providing a tool for configuring control system and
profile management related to the 61850 standard. Its architecture allows an easy integration with the other
components of CoMPAS, in addition to being modular and flexible with a high level of abstraction, it gives
the freedom to implement the tool with the database of its choice.

The below package diagram shows different part of the tool architecture.

![Package Diagram](images/PackageDiagram-CompasSCT.png)

Hence, we can distinguish four major parts:

* **[sct-commons](#SCT-COMMONS)** : a library that contents shared functionalities for the bound SCL object.
* **[sct-service](#SCT-SERVICE)** : It computes all needed operations and uses sct-data for database access.
* **[sct-data](#SCT-DATA)** : It holds data models and database connectivity services.
* **[sct-app](#SCT-APPLICATION)** : *TODO*.

## SCT COMMONS
This package holds a light weight and configurable XML binding tool based on the JAXB utilities, and set of bound SCL
objects adapter. Actually the JAXB generated SCL objects can only be read through from the parent tag to child tag. That can be very limiting.
The adapter concept allows:
* navigating in all direction (upward, downward)
* more flexible manipulation of the JAXB SCL object
* considering specific algorithm based on SCL version

The SCT services specification of the norm IEC 61850 will be implemented in this package.

The Approach behind the SCL adapter is to complete the navigation provided by the JAXB tool, by adding
functionalities that allow the browsing upward (from child to any ancestor). The conception is based on the
abstraction defined below :

public abstract class SclElementAdapter<P extends SclElementAdapter, T> {
protected P parentAdapter;
protected T currentElem;

public SclElementAdapter(P parentAdapter) {
this.parentAdapter = parentAdapter;
}

public SclElementAdapter(P parentAdapter, T currentElem) {
this.parentAdapter = parentAdapter;
setCurrentElem(currentElem);
}

public final void setCurrentElem(T currentElem){
Assert.isTrue(amChildElementRef(currentElem),"No relation between SCL parent and child elements");
this.currentElem = currentElem;
}

protected abstract boolean amChildElementRef(T sclElement);
}

The root element adapter (entry point) is special as it does not have any parent adapter, hence, its method `amChildElementRef(T)`
should always return `true`:

public class SclRootAdapter extends SclElementAdapter<SclRootAdapter, SCL>{
private version;
private revision;
private release;

public SclRootAdapter(SCL currentElem) {
super(null, currentElem);
//set version, release & revision
}

public SclRootAdapter(String hId, String hVersion, String hRevision){
super(null);
this.currentElem = initialize(hId,hVersion,hRevision);
}

@Override
protected boolean amChildElementRef(SCL sclElement) {
return true;
}

[...]
}



## SCT DATA
Data models and connectivity to database are defined here. Data access layer is an abstract layer that defined connectivity
interfaces. This layer manages a database with single table (SQL-Like database) or single collection (NoSQL-Like database).
The concrete data access layers are implemented in specific packages

* ### SQL-Like Database
An implementation of the sct-data connectivity interface with custom data models. This allows the application to work with sql-like database.
The libraries ares use for SQL-Like databases, those that support XML type (PostgreSql, Oracle, etc)

* ### NoSQL-Like Database
Like SQL-like part, this package contains the sct-data connector interfaces implementation for NoSQL-Like databases (BaseX, existDB, etc )
that support XML processing

## SCT SERVICE
This module implements all needed specification as functions (methods in Java). As shown in package diagram,
it interacts with sct-data (database access) and sct-commons (delegate SCL manipulation).
## SCT APPLICATION
**TODO**
1 change: 1 addition & 0 deletions doc/drawio/compas-sct.drawio
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile host="app.diagrams.net" modified="2021-08-23T14:01:51.473Z" agent="5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36 Edg/92.0.902.55" etag="uZeMYTGyEtbajDSc3TgE" version="14.9.8" type="device"><diagram id="3wWlgGhNNHLo4Hu9hpyk" name="Page-1">7Vtbd5s4EP41Pmf3wT1I4vqYOHa3Z3vJ1t2z7VMPBtnmFBALcu30168Ekg0IfEkwdjbJS9BIyNJ83wwzIxigUbR5m7rJ8gPxcTiAmr8ZoLsBhADYkP3jkodCYiEhWKSBLwbtBNPgFxZCTUhXgY+zykBKSEiDpCr0SBxjj1ZkbpqSdXXYnITVX03cBVYEU88NVek/gU+XhdSG1k7+Bw4WS/nLwHSKnsiVg8VOsqXrk3VJhMYDNEoJocVVtBnhkCtP6qW4b9LSu11YimN6zA1ROLbej79P3iXfI+Pj57dr8vbdEInF/XTDldjx6NOH+5upWDN9kIpgy0/45SoKJ6kbscvb9TKgeJq4HpevGf5MtqRRyFqAXc6DMByRkKT5BMjXPIzZrm8zmpIfuNRjmAaw+ITZOohCN8aT6p13+hhMDNYv1opTijetWgBb3TJSYhJhmj6wIfIGX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l+6MqSrRe5+42Knu8D4EnExOjJ60S9YTwBdRS/1ic4dF++p6w+s281mM7DursIzXKbO7NSCsgZfYht9+hL1QOApAdtFqjSHDfmiUVtbIH6ybQPnwratnki4Mdejt8ooidjFXftDPyaUM+fAqyMiIsoNmBta4LnhTRgsuAlTbvy3rmgJg644hmFHVopq3thoeK8KgAbG1FPF7sxUPULoxEw7KCh0+GTWj61YXdaglYe1+UwNWurjYoGkdVwg2SHFeqxIGfLlWfm+mWM9jiZKAuLAfmnyv63D58+Zq8k3+uSmVeUm0h7JTauWb+haz9yEF+bmcSXIaz2+PPZo/SWlwicX8m278jsA7S9amrUi56HxdROrjT9PkdPot5APYP+RgH2Q0s8hhlTYIb9R6ssBq9XwJgfMkrFa/aVaZxEEKhdlhEgmfB5DOK8N1fPCKPD9sC23TMkq9nNK7ujztGpw7egEmOqL6XqfqaGhVoMV7e+0AA7n4ISn1DQ3w4avajr9fMmuHQ8hNc+GmqMq0zmbMtXy5XNRpl6PxBqU2fh5y/mU2VRbPHxQprG/+Vw9hpr+9X74/t2f40FRZzruzOk6/M6OBUZHbmjr5iXaQEXbsvt0Q2px8ClgfySvcO95qbkJbgAaDg4egTdr7r7jLcKE3dfQaPwf</diagram></mxfile>
Binary file added doc/images/PackageDiagram-CompasSCT.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- SPDX-FileCopyrightText: 2020 RTE FRANCE -->
<!-- -->
<!-- SPDX-License-Identifier: Apache-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>
<groupId>org.lfenergy.compas</groupId>
<artifactId>compas-sct</artifactId>
<version>local-SNAPSHOT</version>
<packaging>pom</packaging>
<name>COMPAS-SCT</name>

<repositories>
<repository>
<id>github-packages-compas</id>
<name>Github Packages CoMPAS</name>
<url>https://maven.pkg.github.com/com-pas/*</url>
</repository>
</repositories>

<properties>
<compas.core.version>local-SNAPSHOT</compas.core.version>
<maven.compiler.target>11</maven.compiler.target>
<maven.compiler.source>11</maven.compiler.source>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.coverage.exclusions>sct-coverage/**</sonar.coverage.exclusions>
<aggregate.report.dir>../sct-coverage/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
</properties>

<dependencies>
<dependency>
<groupId>org.lfenergy.compas.core</groupId>
<artifactId>scl2007b4</artifactId>
<version>0.2.1</version>
</dependency>
</dependencies>
<modules>
<module>sct-commons</module>
<module>sct-coverage</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.6</version>
</plugin>
</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Loading