Skip to content

Commit 0ade614

Browse files
authored
Merge pull request #17 from com-pas/sct-initial-push
Sct initial push
2 parents d99b650 + edc3d0d commit 0ade614

File tree

14 files changed

+459
-14
lines changed

14 files changed

+459
-14
lines changed
Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Alliander N.V.
1+
# SPDX-FileCopyrightText: 2020 Alliander N.V.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

@@ -7,15 +7,41 @@ name: SonarCloud Analysis
77
on: push
88

99
jobs:
10-
sonarcloud:
11-
name: SonarCloud
10+
build:
11+
name: Build
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/checkout@v2
1515
with:
16-
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
17-
- name: SonarCloud Scan
18-
uses: SonarSource/sonarcloud-github-action@master
16+
fetch-depth: 0
17+
- name: Set up JDK 11
18+
uses: actions/setup-java@v1
19+
with:
20+
java-version: 11
21+
- name: Cache SonarCloud packages
22+
uses: actions/cache@v1
23+
with:
24+
path: ~/.sonar/cache
25+
key: ${{ runner.os }}-sonar
26+
restore-keys: ${{ runner.os }}-sonar
27+
- name: Cache Maven packages
28+
uses: actions/cache@v1
29+
with:
30+
path: ~/.m2
31+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
32+
restore-keys: ${{ runner.os }}-m2
33+
- name: Create custom Maven Settings.xml
34+
uses: whelk-io/maven-settings-xml-action@v18
35+
with:
36+
output_file: custom_maven_settings.xml
37+
servers: '[{ "id": "github-packages-compas", "username": "OWNER", "password": "${{ secrets.GITHUB_TOKEN }}" }]'
38+
- name: Build and analyze
1939
env:
20-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2141
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
42+
run: |
43+
mvn -B -s custom_maven_settings.xml \
44+
-Dsonar.projectKey=com-pas_compas-sct \
45+
-Dsonar.organization=com-pas \
46+
-Dsonar.host.url=https://sonarcloud.io \
47+
verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar

.gitignore

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: 2020 RTE FRANCE
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
HELP.md
6+
target/
7+
.scannerwork
8+
sonar-project.properties
9+
!.mvn/wrapper/maven-wrapper.jar
10+
!**/src/main/**
11+
!**/src/test/**
12+
13+
### STS ###
14+
.apt_generated
15+
.classpath
16+
.factorypath
17+
.project
18+
.settings
19+
.springBeans
20+
.sts4-cache
21+
22+
### IntelliJ IDEA ###
23+
.idea
24+
*.iws
25+
*.iml
26+
*.ipr
27+
28+
### NetBeans ###
29+
/nbproject/private/
30+
/nbbuild/
31+
/dist/
32+
/nbdist/
33+
/.nb-gradle/
34+
build/
35+
36+
### VS Code ###
37+
.vscode/

.reuse/dep5

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2+
Upstream-Name: compas-sct
3+
Upstream-Contact: Mohamed SYLLA <[email protected]>
4+
Source: https://github.com/com-pas/compas-sct
5+
6+
Files: doc/images/*
7+
Copyright: 2021 RTE FRANCE
8+
License: Apache-2.0
9+
10+
Files: doc/drawio/*
11+
Copyright: 2021 RTE FRANCE
12+
License: Apache-2.0

doc/compas-sct.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<!-- SPDX-FileCopyrightText: 2021 RTE FRANCE -->
2+
<!-- -->
3+
<!-- SPDX-License-Identifier: Apache-2.0 -->
4+
# COMPAS SCT (Substation Configuration Tool)
5+
## Introduction
6+
7+
The CoMPAS SCT (System Configuration Tool) is part of the CoMPAS (Configuration Module for Power System Automation)
8+
ecosystem which is an open source project aimed at providing a tool for configuring control system and
9+
profile management related to the 61850 standard. Its architecture allows an easy integration with the other
10+
components of CoMPAS, in addition to being modular and flexible with a high level of abstraction, it gives
11+
the freedom to implement the tool with the database of its choice.
12+
13+
The below package diagram shows different part of the tool architecture.
14+
15+
![Package Diagram](images/PackageDiagram-CompasSCT.png)
16+
17+
Hence, we can distinguish four major parts:
18+
19+
* **[sct-commons](#SCT-COMMONS)** : a library that contents shared functionalities for the bound SCL object.
20+
* **[sct-service](#SCT-SERVICE)** : It computes all needed operations and uses sct-data for database access.
21+
* **[sct-data](#SCT-DATA)** : It holds data models and database connectivity services.
22+
* **[sct-app](#SCT-APPLICATION)** : *TODO*.
23+
24+
## SCT COMMONS
25+
This package holds a light weight and configurable XML binding tool based on the JAXB utilities, and set of bound SCL
26+
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.
27+
The adapter concept allows:
28+
* navigating in all direction (upward, downward)
29+
* more flexible manipulation of the JAXB SCL object
30+
* considering specific algorithm based on SCL version
31+
32+
The SCT services specification of the norm IEC 61850 will be implemented in this package.
33+
34+
The Approach behind the SCL adapter is to complete the navigation provided by the JAXB tool, by adding
35+
functionalities that allow the browsing upward (from child to any ancestor). The conception is based on the
36+
abstraction defined below :
37+
38+
public abstract class SclElementAdapter<P extends SclElementAdapter, T> {
39+
protected P parentAdapter;
40+
protected T currentElem;
41+
42+
public SclElementAdapter(P parentAdapter) {
43+
this.parentAdapter = parentAdapter;
44+
}
45+
46+
public SclElementAdapter(P parentAdapter, T currentElem) {
47+
this.parentAdapter = parentAdapter;
48+
setCurrentElem(currentElem);
49+
}
50+
51+
public final void setCurrentElem(T currentElem){
52+
Assert.isTrue(amChildElementRef(currentElem),"No relation between SCL parent and child elements");
53+
this.currentElem = currentElem;
54+
}
55+
56+
protected abstract boolean amChildElementRef(T sclElement);
57+
}
58+
59+
The root element adapter (entry point) is special as it does not have any parent adapter, hence, its method `amChildElementRef(T)`
60+
should always return `true`:
61+
62+
public class SclRootAdapter extends SclElementAdapter<SclRootAdapter, SCL>{
63+
private version;
64+
private revision;
65+
private release;
66+
67+
public SclRootAdapter(SCL currentElem) {
68+
super(null, currentElem);
69+
//set version, release & revision
70+
}
71+
72+
public SclRootAdapter(String hId, String hVersion, String hRevision){
73+
super(null);
74+
this.currentElem = initialize(hId,hVersion,hRevision);
75+
}
76+
77+
@Override
78+
protected boolean amChildElementRef(SCL sclElement) {
79+
return true;
80+
}
81+
82+
[...]
83+
}
84+
85+
86+
87+
## SCT DATA
88+
Data models and connectivity to database are defined here. Data access layer is an abstract layer that defined connectivity
89+
interfaces. This layer manages a database with single table (SQL-Like database) or single collection (NoSQL-Like database).
90+
The concrete data access layers are implemented in specific packages
91+
92+
* ### SQL-Like Database
93+
An implementation of the sct-data connectivity interface with custom data models. This allows the application to work with sql-like database.
94+
The libraries ares use for SQL-Like databases, those that support XML type (PostgreSql, Oracle, etc)
95+
96+
* ### NoSQL-Like Database
97+
Like SQL-like part, this package contains the sct-data connector interfaces implementation for NoSQL-Like databases (BaseX, existDB, etc )
98+
that support XML processing
99+
100+
## SCT SERVICE
101+
This module implements all needed specification as functions (methods in Java). As shown in package diagram,
102+
it interacts with sct-data (database access) and sct-commons (delegate SCL manipulation).
103+
## SCT APPLICATION
104+
**TODO**

doc/drawio/compas-sct.drawio

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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">7Vtbd5s4EP41Pmf3wT1I4vqYOHa3Z3vJ1t2z7VMPBtnmFBALcu30168Ekg0IfEkwdjbJS9BIyN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 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- SPDX-FileCopyrightText: 2020 RTE FRANCE -->
3+
<!-- -->
4+
<!-- SPDX-License-Identifier: Apache-2.0 -->
5+
<project xmlns="http://maven.apache.org/POM/4.0.0"
6+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
8+
<modelVersion>4.0.0</modelVersion>
9+
<groupId>org.lfenergy.compas</groupId>
10+
<artifactId>compas-sct</artifactId>
11+
<version>local-SNAPSHOT</version>
12+
<packaging>pom</packaging>
13+
<name>COMPAS-SCT</name>
14+
15+
<repositories>
16+
<repository>
17+
<id>github-packages-compas</id>
18+
<name>Github Packages CoMPAS</name>
19+
<url>https://maven.pkg.github.com/com-pas/*</url>
20+
</repository>
21+
</repositories>
22+
23+
<properties>
24+
<compas.core.version>local-SNAPSHOT</compas.core.version>
25+
<maven.compiler.target>11</maven.compiler.target>
26+
<maven.compiler.source>11</maven.compiler.source>
27+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
28+
<sonar.coverage.exclusions>sct-coverage/**</sonar.coverage.exclusions>
29+
<aggregate.report.dir>../sct-coverage/target/site/jacoco-aggregate/jacoco.xml</aggregate.report.dir>
30+
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
31+
</properties>
32+
33+
<dependencies>
34+
<dependency>
35+
<groupId>org.lfenergy.compas.core</groupId>
36+
<artifactId>scl2007b4</artifactId>
37+
<version>0.2.1</version>
38+
</dependency>
39+
</dependencies>
40+
<modules>
41+
<module>sct-commons</module>
42+
<module>sct-coverage</module>
43+
</modules>
44+
45+
<build>
46+
<pluginManagement>
47+
<plugins>
48+
<plugin>
49+
<groupId>org.apache.maven.plugins</groupId>
50+
<artifactId>maven-compiler-plugin</artifactId>
51+
<version>3.8.1</version>
52+
</plugin>
53+
<plugin>
54+
<groupId>org.jacoco</groupId>
55+
<artifactId>jacoco-maven-plugin</artifactId>
56+
<version>0.8.6</version>
57+
</plugin>
58+
</plugins>
59+
</pluginManagement>
60+
61+
<plugins>
62+
<plugin>
63+
<groupId>org.apache.maven.plugins</groupId>
64+
<artifactId>maven-compiler-plugin</artifactId>
65+
</plugin>
66+
<plugin>
67+
<groupId>org.jacoco</groupId>
68+
<artifactId>jacoco-maven-plugin</artifactId>
69+
<executions>
70+
<execution>
71+
<id>prepare-agent</id>
72+
<goals>
73+
<goal>prepare-agent</goal>
74+
</goals>
75+
</execution>
76+
</executions>
77+
</plugin>
78+
</plugins>
79+
</build>
80+
</project>

0 commit comments

Comments
 (0)