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 MetaBlockConInput(IdentifiedObject
):
20 """If model the association to MeasurementType, the it means take the input from the associated PSR or Terminal in the static model.
23 def __init__(self
, MetaBlockConSignal
=None, MemberOf_MetaBlockConnection
=None, Unit
=None, *args
, **kw_args
):
24 """Initialises a new 'MetaBlockConInput' instance.
26 @param MetaBlockConSignal:
27 @param MemberOf_MetaBlockConnection:
30 self
._MetaBlockConSignal
= None
31 self
.MetaBlockConSignal
= MetaBlockConSignal
33 self
._MemberOf
_MetaBlockConnection
= None
34 self
.MemberOf_MetaBlockConnection
= MemberOf_MetaBlockConnection
39 super(MetaBlockConInput
, self
).__init
__(*args
, **kw_args
)
45 _refs
= ["MetaBlockConSignal", "MemberOf_MetaBlockConnection", "Unit"]
48 def getMetaBlockConSignal(self
):
50 return self
._MetaBlockConSignal
52 def setMetaBlockConSignal(self
, value
):
53 if self
._MetaBlockConSignal
is not None:
54 self
._MetaBlockConSignal
._MetaBlockConInput
= None
56 self
._MetaBlockConSignal
= value
57 if self
._MetaBlockConSignal
is not None:
58 self
._MetaBlockConSignal
._MetaBlockConInput
= self
60 MetaBlockConSignal
= property(getMetaBlockConSignal
, setMetaBlockConSignal
)
62 def getMemberOf_MetaBlockConnection(self
):
64 return self
._MemberOf
_MetaBlockConnection
66 def setMemberOf_MetaBlockConnection(self
, value
):
67 if self
._MemberOf
_MetaBlockConnection
is not None:
68 filtered
= [x
for x
in self
.MemberOf_MetaBlockConnection
.MetaBlockConInput
if x
!= self
]
69 self
._MemberOf
_MetaBlockConnection
._MetaBlockConInput
= filtered
71 self
._MemberOf
_MetaBlockConnection
= value
72 if self
._MemberOf
_MetaBlockConnection
is not None:
73 self
._MemberOf
_MetaBlockConnection
._MetaBlockConInput
.append(self
)
75 MemberOf_MetaBlockConnection
= property(getMemberOf_MetaBlockConnection
, setMemberOf_MetaBlockConnection
)
81 def setUnit(self
, value
):
82 if self
._Unit
is not None:
83 filtered
= [x
for x
in self
.Unit
.MetaBlockConInput
if x
!= self
]
84 self
._Unit
._MetaBlockConInput
= filtered
87 if self
._Unit
is not None:
88 self
._Unit
._MetaBlockConInput
.append(self
)
90 Unit
= property(getUnit
, setUnit
)