1 # Copyright (C) 2010 Richard Lincoln
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA, USA
17 from CIM14
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
19 class MetaBlockStateReference(IdentifiedObject
):
21 def __init__(self
, positiveFlowIn
=False, StandardControlBlock_MetaBlockConnectable
=None, MetaBlockConnectable
=None, MemberOf_MetaBlockReference
=None, *args
, **kw_args
):
22 """Initialises a new 'MetaBlockStateReference' instance.
24 @param positiveFlowIn: If true then any flows associated with a terminal are referenced as positive from the system into the device.
25 @param StandardControlBlock_MetaBlockConnectable:
26 @param MetaBlockConnectable:
27 @param MemberOf_MetaBlockReference:
29 #: If true then any flows associated with a terminal are referenced as positive from the system into the device.
30 self
.positiveFlowIn
= positiveFlowIn
32 self
._StandardControlBlock
_MetaBlockConnectable
= None
33 self
.StandardControlBlock_MetaBlockConnectable
= StandardControlBlock_MetaBlockConnectable
35 self
._MetaBlockConnectable
= None
36 self
.MetaBlockConnectable
= MetaBlockConnectable
38 self
._MemberOf
_MetaBlockReference
= None
39 self
.MemberOf_MetaBlockReference
= MemberOf_MetaBlockReference
41 super(MetaBlockStateReference
, self
).__init
__(*args
, **kw_args
)
43 _attrs
= ["positiveFlowIn"]
44 _attr_types
= {"positiveFlowIn": bool}
45 _defaults
= {"positiveFlowIn": False}
47 _refs
= ["StandardControlBlock_MetaBlockConnectable", "MetaBlockConnectable", "MemberOf_MetaBlockReference"]
50 def getStandardControlBlock_MetaBlockConnectable(self
):
52 return self
._StandardControlBlock
_MetaBlockConnectable
54 def setStandardControlBlock_MetaBlockConnectable(self
, value
):
55 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
56 filtered
= [x
for x
in self
.StandardControlBlock_MetaBlockConnectable
.StandardControlBlock_MetaBlockStateReference
if x
!= self
]
57 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockStateReference
= filtered
59 self
._StandardControlBlock
_MetaBlockConnectable
= value
60 if self
._StandardControlBlock
_MetaBlockConnectable
is not None:
61 self
._StandardControlBlock
_MetaBlockConnectable
._StandardControlBlock
_MetaBlockStateReference
.append(self
)
63 StandardControlBlock_MetaBlockConnectable
= property(getStandardControlBlock_MetaBlockConnectable
, setStandardControlBlock_MetaBlockConnectable
)
65 def getMetaBlockConnectable(self
):
67 return self
._MetaBlockConnectable
69 def setMetaBlockConnectable(self
, value
):
70 if self
._MetaBlockConnectable
is not None:
71 filtered
= [x
for x
in self
.MetaBlockConnectable
.MetaBlockStateReference
if x
!= self
]
72 self
._MetaBlockConnectable
._MetaBlockStateReference
= filtered
74 self
._MetaBlockConnectable
= value
75 if self
._MetaBlockConnectable
is not None:
76 self
._MetaBlockConnectable
._MetaBlockStateReference
.append(self
)
78 MetaBlockConnectable
= property(getMetaBlockConnectable
, setMetaBlockConnectable
)
80 def getMemberOf_MetaBlockReference(self
):
82 return self
._MemberOf
_MetaBlockReference
84 def setMemberOf_MetaBlockReference(self
, value
):
85 if self
._MemberOf
_MetaBlockReference
is not None:
86 filtered
= [x
for x
in self
.MemberOf_MetaBlockReference
.MetaBlockStateReference
if x
!= self
]
87 self
._MemberOf
_MetaBlockReference
._MetaBlockStateReference
= filtered
89 self
._MemberOf
_MetaBlockReference
= value
90 if self
._MemberOf
_MetaBlockReference
is not None:
91 self
._MemberOf
_MetaBlockReference
._MetaBlockStateReference
.append(self
)
93 MemberOf_MetaBlockReference
= property(getMemberOf_MetaBlockReference
, setMemberOf_MetaBlockReference
)