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 MetaBlockConInput(IdentifiedObject
):
24 """If model the association to MeasurementType, the it means take the input from the associated PSR or Terminal in the static model.
27 def __init__(self
, MetaBlockConSignal
=None, MemberOf_MetaBlockConnection
=None, Unit
=None, *args
, **kw_args
):
28 """Initialises a new 'MetaBlockConInput' instance.
30 @param MetaBlockConSignal:
31 @param MemberOf_MetaBlockConnection:
34 self
._MetaBlockConSignal
= None
35 self
.MetaBlockConSignal
= MetaBlockConSignal
37 self
._MemberOf
_MetaBlockConnection
= None
38 self
.MemberOf_MetaBlockConnection
= MemberOf_MetaBlockConnection
43 super(MetaBlockConInput
, self
).__init
__(*args
, **kw_args
)
49 _refs
= ["MetaBlockConSignal", "MemberOf_MetaBlockConnection", "Unit"]
52 def getMetaBlockConSignal(self
):
54 return self
._MetaBlockConSignal
56 def setMetaBlockConSignal(self
, value
):
57 if self
._MetaBlockConSignal
is not None:
58 self
._MetaBlockConSignal
._MetaBlockConInput
= None
60 self
._MetaBlockConSignal
= value
61 if self
._MetaBlockConSignal
is not None:
62 self
._MetaBlockConSignal
.MetaBlockConInput
= None
63 self
._MetaBlockConSignal
._MetaBlockConInput
= self
65 MetaBlockConSignal
= property(getMetaBlockConSignal
, setMetaBlockConSignal
)
67 def getMemberOf_MetaBlockConnection(self
):
69 return self
._MemberOf
_MetaBlockConnection
71 def setMemberOf_MetaBlockConnection(self
, value
):
72 if self
._MemberOf
_MetaBlockConnection
is not None:
73 filtered
= [x
for x
in self
.MemberOf_MetaBlockConnection
.MetaBlockConInput
if x
!= self
]
74 self
._MemberOf
_MetaBlockConnection
._MetaBlockConInput
= filtered
76 self
._MemberOf
_MetaBlockConnection
= value
77 if self
._MemberOf
_MetaBlockConnection
is not None:
78 if self
not in self
._MemberOf
_MetaBlockConnection
._MetaBlockConInput
:
79 self
._MemberOf
_MetaBlockConnection
._MetaBlockConInput
.append(self
)
81 MemberOf_MetaBlockConnection
= property(getMemberOf_MetaBlockConnection
, setMemberOf_MetaBlockConnection
)
87 def setUnit(self
, value
):
88 if self
._Unit
is not None:
89 filtered
= [x
for x
in self
.Unit
.MetaBlockConInput
if x
!= self
]
90 self
._Unit
._MetaBlockConInput
= filtered
93 if self
._Unit
is not None:
94 if self
not in self
._Unit
._MetaBlockConInput
:
95 self
._Unit
._MetaBlockConInput
.append(self
)
97 Unit
= property(getUnit
, setUnit
)