1 # Copyright (C) 2010-2011 Richard Lincoln
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to
5 # deal in the Software without restriction, including without limitation the
6 # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 # sell copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice shall be included in
11 # all copies or substantial portions of the Software.
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class MetaBlockStateReference(IdentifiedObject
):
25 def __init__(self
, positiveFlowIn
=False, StandardControlBlock_MetaBlockConnectable
=None, MetaBlockConnectable
=None, MemberOf_MetaBlockReference
=None, *args
, **kw_args
):
26 """Initialises a new 'MetaBlockStateReference' instance.
28 @param positiveFlowIn: If true then any flows associated with a terminal are referenced as positive from the system into the device.
29 @param StandardControlBlock_MetaBlockConnectable:
30 @param MetaBlockConnectable:
31 @param MemberOf_MetaBlockReference:
33 #: If true then any flows associated with a terminal are referenced as positive from the system into the device.
34 self
.positiveFlowIn
= positiveFlowIn
36 self
._StandardControlBlock
_MetaBlockConnectable
= None
37 self
.StandardControlBlock_MetaBlockConnectable
= StandardControlBlock_MetaBlockConnectable
39 self
._MetaBlockConnectable
= None
40 self
.MetaBlockConnectable
= MetaBlockConnectable
42 self
._MemberOf
_MetaBlockReference
= None
43 self
.MemberOf_MetaBlockReference
= MemberOf_MetaBlockReference
45 super(MetaBlockStateReference
, self
).__init
__(*args
, **kw_args
)
47 _attrs
= ["positiveFlowIn"]
48 _attr_types
= {"positiveFlowIn": bool}
49 _defaults
= {"positiveFlowIn": False}
51 _refs
= ["StandardControlBlock_MetaBlockConnectable", "MetaBlockConnectable", "MemberOf_MetaBlockReference"]
54 def getStandardControlBlock_MetaBlockConnectable(self
):
56 return self
._StandardControlBlock
_MetaBlockConnectable
58 def setStandardControlBlock_MetaBlockConnectable(self
, value
):
59 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
60 filtered
= [x
for x
in self
.StandardControlBlock_MetaBlockConnectable
.StandardControlBlock_MetaBlockStateReference
if x
!= self
]
61 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockStateReference
= filtered
63 self
._StandardControlBlock
_MetaBlockConnectable
= value
64 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
65 if self
not in self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockStateReference
:
66 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockStateReference
.append(self
)
68 StandardControlBlock_MetaBlockConnectable
= property(getStandardControlBlock_MetaBlockConnectable
, setStandardControlBlock_MetaBlockConnectable
)
70 def getMetaBlockConnectable(self
):
72 return self
._MetaBlockConnectable
74 def setMetaBlockConnectable(self
, value
):
75 if self
._MetaBlockConnectable
is not None:
76 filtered
= [x
for x
in self
.MetaBlockConnectable
.MetaBlockStateReference
if x
!= self
]
77 self
._MetaBlockConnectable
._MetaBlockStateReference
= filtered
79 self
._MetaBlockConnectable
= value
80 if self
._MetaBlockConnectable
is not None:
81 if self
not in self
._MetaBlockConnectable
._MetaBlockStateReference
:
82 self
._MetaBlockConnectable
._MetaBlockStateReference
.append(self
)
84 MetaBlockConnectable
= property(getMetaBlockConnectable
, setMetaBlockConnectable
)
86 def getMemberOf_MetaBlockReference(self
):
88 return self
._MemberOf
_MetaBlockReference
90 def setMemberOf_MetaBlockReference(self
, value
):
91 if self
._MemberOf
_MetaBlockReference
is not None:
92 filtered
= [x
for x
in self
.MemberOf_MetaBlockReference
.MetaBlockStateReference
if x
!= self
]
93 self
._MemberOf
_MetaBlockReference
._MetaBlockStateReference
= filtered
95 self
._MemberOf
_MetaBlockReference
= value
96 if self
._MemberOf
_MetaBlockReference
is not None:
97 if self
not in self
._MemberOf
_MetaBlockReference
._MetaBlockStateReference
:
98 self
._MemberOf
_MetaBlockReference
._MetaBlockStateReference
.append(self
)
100 MemberOf_MetaBlockReference
= property(getMemberOf_MetaBlockReference
, setMemberOf_MetaBlockReference
)