Skip to content

Commit 5ce2030

Browse files
committed
remove empty modules, complete documentation ...
Signed-off-by: Mohamed Sylla <[email protected]>
1 parent e487cde commit 5ce2030

File tree

10 files changed

+206
-97
lines changed

10 files changed

+206
-97
lines changed

doc/compas-sct.md

Lines changed: 90 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,101 @@
44
# COMPAS SCT (Substation Configuration Tool)
55
## Introduction
66

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.
712

8-
System Configuration Tool (SCT) is part of CoMPAS open source project. It goal is to bring a flexible and adaptative tool for configuring PACS (Power Automation and power Control System). It's an n-tiers architecture which combine reliabilitily, flexibility, modularity and adaptability to allows users to choose their own database to implement the SCT.
9-
10-
The following architecture is divided in three major parts:
11-
* sct-commons : ....
12-
* sct-service : this part could be considered as the engine of the SCT. It computes all needed operations and uses sct-data for database access.
13-
* sct-data : implements a generic abstract data service which should be extended by specific real data service for exchange with chosen database.
14-
* sct-app : *TODO*
13+
The below package diagram shows different part of the tool architecture.
1514

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

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*.
1823

1924
## SCT COMMONS
20-
*TODO*
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+
2187
## SCT DATA
22-
*TODO*
23-
### SQL-Like Database
24-
*TODO*
25-
### NoSQL-Like Database
26-
*TODO*
27-
## SCT SERVICE
28-
*TODO*
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).
29103
## SCT APPLICATION
30-
*TODO*
104+
**TODO**

pom.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,7 @@
3838
</dependency>
3939
</dependencies>
4040
<modules>
41-
<module>sct-data</module>
42-
<module>sct-data-pg</module>
4341
<module>sct-commons</module>
44-
<module>sct-service</module>
4542
<module>sct-coverage</module>
4643
</modules>
4744

sct-commons/pom.xml

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,91 @@
2020
<properties>
2121
<sonar.coverage.jacoco.xmlReportPaths>${basedir}/${aggregate.report.dir}</sonar.coverage.jacoco.xmlReportPaths>
2222
</properties>
23+
24+
<dependencies>
25+
<dependency>
26+
<groupId>org.springframework</groupId>
27+
<artifactId>spring-context</artifactId>
28+
<version>5.3.3</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>jakarta.xml.bind</groupId>
32+
<artifactId>jakarta.xml.bind-api</artifactId>
33+
<version>2.3.3</version>
34+
</dependency>
35+
<dependency>
36+
<groupId>com.sun.xml.bind</groupId>
37+
<artifactId>jaxb-impl</artifactId>
38+
<version>2.3.3</version>
39+
<scope>runtime</scope>
40+
</dependency>
41+
<dependency>
42+
<groupId>org.springframework</groupId>
43+
<artifactId>spring-oxm</artifactId>
44+
<version>5.3.2</version>
45+
</dependency>
46+
<dependency>
47+
<groupId>org.projectlombok</groupId>
48+
<artifactId>lombok</artifactId>
49+
<version>1.18.16</version>
50+
<optional>true</optional>
51+
</dependency>
52+
<dependency>
53+
<groupId>org.junit.jupiter</groupId>
54+
<artifactId>junit-jupiter-api</artifactId>
55+
<version>5.7.0</version>
56+
<scope>test</scope>
57+
</dependency>
58+
<dependency>
59+
<groupId>org.hamcrest</groupId>
60+
<artifactId>hamcrest</artifactId>
61+
<version>2.2</version>
62+
<scope>test</scope>
63+
</dependency>
64+
<dependency>
65+
<groupId>org.mockito</groupId>
66+
<artifactId>mockito-core</artifactId>
67+
<version>3.6.28</version>
68+
<scope>test</scope>
69+
</dependency>
70+
<dependency>
71+
<groupId>org.mockito</groupId>
72+
<artifactId>mockito-junit-jupiter</artifactId>
73+
<version>3.6.28</version>
74+
<scope>test</scope>
75+
</dependency>
76+
<dependency>
77+
<groupId>com.fasterxml.jackson.dataformat</groupId>
78+
<artifactId>jackson-dataformat-yaml</artifactId>
79+
<version>2.12.3</version>
80+
</dependency>
81+
<dependency>
82+
<groupId>jakarta.annotation</groupId>
83+
<artifactId>jakarta.annotation-api</artifactId>
84+
<version>1.3.5</version>
85+
</dependency>
86+
</dependencies>
87+
<build>
88+
<plugins>
89+
<plugin>
90+
<groupId>org.jacoco</groupId>
91+
<artifactId>jacoco-maven-plugin</artifactId>
92+
<executions>
93+
<execution>
94+
<id>default-prepare-agent</id>
95+
<goals>
96+
<goal>prepare-agent</goal>
97+
</goals>
98+
</execution>
99+
<execution>
100+
<id>report</id>
101+
<phase>test</phase>
102+
<goals>
103+
<goal>report</goal>
104+
</goals>
105+
</execution>
106+
</executions>
107+
</plugin>
108+
</plugins>
109+
</build>
23110
</project>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-FileCopyrightText: 2021 RTE FRANCE
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
package org.lfenergy.compas.sct.commons;
6+
7+
public class CommonConstants {
8+
CommonConstants() {
9+
throw new UnsupportedOperationException("CommonConstants class");
10+
}
11+
12+
public static final String XML_DEFAULT_NS_PREFIX = "scl";
13+
public static final String XML_DEFAULT_NS_URI = "http://www.iec.ch/61850/2003/SCL";
14+
public static final String XML_DEFAULT_XSD_PATH = "classpath:schema/SCL.xsd";
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package org.lfenergy.compas.sct.commons;
2+
3+
import org.junit.jupiter.api.Test;
4+
5+
import static org.junit.jupiter.api.Assertions.*;
6+
7+
8+
public class CommonConstantsTest {
9+
@Test
10+
public void testShouldReturnNOKWhenConstructClassCauseForbidden() {
11+
assertThrows(UnsupportedOperationException.class, () -> new CommonConstants());
12+
}
13+
14+
}

sct-commons/src/test/resources/scl_schema.properties

Whitespace-only changes.

sct-commons/src/test/resources/scl_schema.yml

Whitespace-only changes.

sct-data-pg/pom.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

sct-data/pom.xml

Lines changed: 0 additions & 24 deletions
This file was deleted.

sct-service/pom.xml

Lines changed: 0 additions & 30 deletions
This file was deleted.

0 commit comments

Comments
 (0)