Newer
Older
/**
* Copyright (c) 2017 CentraleSupélec & EDF.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* This file is part of the RiseClipse tool
*
* Contributors:
* Computer Science Department, CentraleSupélec
* EDF R&D
* Contacts:
* dominique.marcadet@centralesupelec.fr
* aurelie.dehouck-neveu@edf.fr
* Web site:
* http://wdi.supelec.fr/software/RiseClipse/
*/
import scl: 'http://www.iec.ch/61850/2003/SCL'
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
package scl
context VoltageLevel
-- Within a VoltageLevel, there cannot be two LNode elements with the same
-- combination of lnInst, lnClass, iedName, ldInst, and prefix.
-- done in LNodeContainer.ocl
-- Within a VoltageLevel, there cannot be two direct PowerTransformer elements
-- with the same name.
-- done in EquipmentContainer.ocl
-- Within a VoltageLevel, there cannot be two direct GeneralEquipment elements
-- with the same name.
-- done in EquipmentContainer.ocl
-- Within a VoltageLevel, there cannot be two Bay elements with the
-- same name.
inv VoltageLevel_unique_Bay_name
( 'Bay in VoltageLevel shall have different name (line ' + self.lineNumber.toString() + ')' )
:
self.Bay->isUnique( v : Bay | v.name )
-- Within a VoltageLevel, there cannot be two Function elements with the same
-- name.
inv VoltageLevel_unique_Function_name
( 'Function in VoltageLevel shall have different name (line ' + self.lineNumber.toString() + ')' )
:
self.Function->isUnique( f : Function | f.name )
-- In order to avoid any ambiguities, within a VoltageLevel there cannot be two
-- direct child elements with the same name.
inv VoltageLevel_unique_DirectChild_name
( 'All direct childs in VoltageLevel shall have different name (line ' + self.lineNumber.toString() + ')' )
:
self.oclContents()->selectByKind( scl::Naming )->isUnique( n : Naming | n.name )
-- Version when oclContents() is not available
-- let childs_1 : OrderedSet( Naming ) = self.Function
--in let childs_2 : OrderedSet( Naming ) = childs_1->union( self.GeneralEquipment )
--in let childs_3 : OrderedSet( Naming ) = childs_2->union( self.PowerTransformer )
--in let childs_4 : OrderedSet( Naming ) = childs_3->union( self.Bay )
--in childs_4->isUnique( n : Naming | n.name )
endpackage