Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
riseclipse-validator-scl2003
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
RiseClipseGroup
riseclipse-validator-scl2003
Commits
b33baf7e
Commit
b33baf7e
authored
5 years ago
by
Dominique Marcadet
Browse files
Options
Downloads
Patches
Plain Diff
keep only one generateValidators()
parent
97f8ffc0
No related branches found
Branches containing commit
No related tags found
1 merge request
!3
Resolve "Implement NSD based validation"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/AnyLNValidator.java
+5
-17
5 additions, 17 deletions
...edf/riseclipse/iec61850/scl/validator/AnyLNValidator.java
with
5 additions
and
17 deletions
fr.centralesupelec.edf.riseclipse.iec61850.scl.tools/src/fr/centralesupelec/edf/riseclipse/iec61850/scl/validator/AnyLNValidator.java
+
5
−
17
View file @
b33baf7e
...
@@ -23,6 +23,7 @@ import java.util.HashSet;
...
@@ -23,6 +23,7 @@ import java.util.HashSet;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.AbstractLNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.AbstractLNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.DataObject
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.DataObject
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.LNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.nsd.AnyLNClass
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.AnyLN
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI
;
import
fr.centralesupelec.edf.riseclipse.iec61850.scl.DOI
;
import
fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole
;
import
fr.centralesupelec.edf.riseclipse.util.AbstractRiseClipseConsole
;
...
@@ -48,25 +49,12 @@ public class AnyLNValidator {
...
@@ -48,25 +49,12 @@ public class AnyLNValidator {
}
}
public
void
generateValidators
(
HashMap
<
String
,
DataObject
>
doMap
,
HashMap
<
String
,
DOIValidator
>
cdcMap
,
public
void
generateValidators
(
HashMap
<
String
,
DataObject
>
doMap
,
HashMap
<
String
,
DOIValidator
>
cdcMap
,
AnyLNClass
lnClass
)
{
AbstractLNClass
lnClass
)
{
for
(
DataObject
dObj
:
lnClass
.
getDataObject
()
)
{
for
(
DataObject
dObj
:
lnClass
.
getDataObject
()
)
{
this
.
doMap
.
put
(
dObj
.
getName
(),
dObj
);
this
.
doMap
.
put
(
dObj
.
getName
(),
dObj
);
if
(
dObj
.
getRefersToCDC
()
!=
null
)
{
if
(
dObj
.
getRefersToCDC
()
!=
null
)
{
if
(
!
cdcMap
.
containsKey
(
dObj
.
getRefersToCDC
().
getName
()
)
)
{
if
(
!
cdcMap
.
containsKey
(
dObj
.
getRefersToCDC
().
getName
()
)
)
{
this
.
cdcMap
.
put
(
dObj
.
getRefersToCDC
().
getName
(),
new
DOIValidator
(
dObj
.
getRefersToCDC
()
)
);
this
.
cdcMap
.
put
(
dObj
.
getRefersToCDC
().
getName
(),
new
DOIValidator
(
dObj
.
getRefersToCDC
()
));
}
}
}
}
public
void
generateValidators
(
HashMap
<
String
,
DataObject
>
doMap
,
HashMap
<
String
,
DOIValidator
>
cdcMap
,
LNClass
lnClass
)
{
for
(
DataObject
dObj
:
lnClass
.
getDataObject
()
)
{
this
.
doMap
.
put
(
dObj
.
getName
(),
dObj
);
if
(
dObj
.
getRefersToCDC
()
!=
null
)
{
if
(
!
cdcMap
.
containsKey
(
dObj
.
getRefersToCDC
().
getName
()
)
)
{
this
.
cdcMap
.
put
(
dObj
.
getRefersToCDC
().
getName
(),
new
DOIValidator
(
dObj
.
getRefersToCDC
()
)
);
}
}
}
}
}
}
...
@@ -98,7 +86,7 @@ public class AnyLNValidator {
...
@@ -98,7 +86,7 @@ public class AnyLNValidator {
// Verify all necessary DOI were present
// Verify all necessary DOI were present
if
(
!
this
.
doMap
.
entrySet
().
stream
()
if
(
!
this
.
doMap
.
entrySet
().
stream
()
.
map
(
x
->
checkCompulsory
(
x
.
getKey
(),
x
.
getValue
().
getPresCond
(),
checkedDO
)
)
.
map
(
x
->
checkCompulsory
(
x
.
getKey
(),
x
.
getValue
().
getPresCond
(),
checkedDO
))
.
reduce
(
(
a
,
b
)
->
a
&&
b
).
get
()
)
{
.
reduce
(
(
a
,
b
)
->
a
&&
b
).
get
()
)
{
AbstractRiseClipseConsole
.
getConsole
()
AbstractRiseClipseConsole
.
getConsole
()
.
error
(
"LN does not contain all mandatory DO from class "
+
ln
.
getLnClass
()
);
.
error
(
"LN does not contain all mandatory DO from class "
+
ln
.
getLnClass
()
);
...
@@ -122,7 +110,7 @@ public class AnyLNValidator {
...
@@ -122,7 +110,7 @@ public class AnyLNValidator {
switch
(
presCond
)
{
switch
(
presCond
)
{
case
"M"
:
case
"M"
:
case
"O"
:
case
"O"
:
if
(
checked
.
contains
(
name
)
)
{
if
(
checked
.
contains
(
name
))
{
AbstractRiseClipseConsole
.
getConsole
().
error
(
"DO "
+
name
+
" cannot appear more than once"
);
AbstractRiseClipseConsole
.
getConsole
().
error
(
"DO "
+
name
+
" cannot appear more than once"
);
return
false
;
return
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment