Skip to content

Commit 10c426b

Browse files
committed
update documentation
Signed-off-by: Mohamed Sylla <[email protected]>
1 parent 86a57f1 commit 10c426b

File tree

2 files changed

+60
-9
lines changed

2 files changed

+60
-9
lines changed

doc/compas-sct.md

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ The below package diagram shows different part of the tool architecture.
1717
Hence, we can distinguish four major parts:
1818

1919
* **[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.
2120
* **[sct-data](#SCT-DATA)** : It holds data models and database connectivity services.
2221
* **[sct-app](#SCT-APPLICATION)** : *TODO*.
2322

@@ -82,23 +81,75 @@ should always return `true`:
8281
[...]
8382
}
8483

85-
86-
8784
## SCT DATA
8885
Data models and connectivity to database are defined here. Data access layer is an abstract layer that defined connectivity
8986
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
87+
The concrete data access layers are implemented in specific packages. A data model can implement the following interface
88+
89+
```
90+
public interface IScd <ID> {
91+
ID getId();
92+
byte[] getRawXml();
93+
ID getHeaderId();
94+
String getHeaderRevision();
95+
String getHeaderVersion();
96+
String filename();
97+
}
98+
```
9199

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

96104
* ### NoSQL-Like Database
97105
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
106+
that support XML processing.
107+
108+
This can also be a local repository connector (file system). For example, with meta-data headerID, headerVersion, headerRevision and filename
109+
one can implement the connector to have the below output (with the constraint of having a single file in /pathTo/headerId/headerVersion/headerRevision):
110+
111+
```
112+
myRepo
113+
├───<headerID>
114+
│ ├───<headerVersion1>
115+
│ │ └───<headerRevision1>
116+
│ │ | ├───<fileName1.scd>
117+
│ │ └───<headerRevision2>
118+
│ │ ├───<fileName2.scd>
119+
```
99120

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).
103121
## SCT APPLICATION
104-
**TODO**
122+
**TODO**
123+
124+
### Tips for memory consumption's optimization
125+
For large SCL file, it will not be a good idea to load the whole file in memory. JAXB is capable of processing XML file by chunks.
126+
The need to load the whole SCL file relies on the fact that XML validation processes needs the entire file content.
127+
To go through that processes we must take advantage on the XSD and build minimal SCL file from the large one.
128+
The most "important" tags in the SCL file : Header, Substation, Communication, IED and DataTypeTemplate. By looking closely in the XSD file, one can realize
129+
the below dependencies' logic :
130+
* IED depends on DataTypeTemplate
131+
* Communication depends on IED (IED name, Access Point)
132+
133+
Hence, with this in mind, one can reconstruct a minimal SCL file by focusing on the chunk of interest then realize creation/update operations
134+
on the file and validate it against the XSD file.
135+
136+
For example: Updating IED
137+
138+
From SCD header's information, create a minimal SCD file
139+
```
140+
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL">
141+
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
142+
</SCL>
143+
```
144+
As IED depends on DataTypeTemplate, extract the IED chunk and the whole DataTypeTemplate chunk
145+
```
146+
<SCL version="2007" revision="B" release="4" xmlns="http://www.iec.ch/61850/2003/SCL">
147+
<Header id="hId" version="2007" revision="B" toolID="COMPAS"/>
148+
<IED name="IED_NAME">
149+
<AccessPoint>....</AccessPoint>
150+
</IED>
151+
<DataTypeTemplate>....</DataTypeTemplate>
152+
</SCL>
153+
```
154+
Operations can be realized and validated on this minimal file (Which has the same structure as ICD file).
155+
-841 Bytes
Loading

0 commit comments

Comments
 (0)