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 Unit(IdentifiedObject
):
24 """Quantity being measured. The Unit.name shall be unique among all specified quantities and describe the quantity. The Unit.aliasName is meant to be used for localization.
27 def __init__(self
, Controls
=None, Measurements
=None, MetaBlockConOutput
=None, MetaBlockConInput
=None, ProtectionEquipments
=None, *args
, **kw_args
):
28 """Initialises a new 'Unit' instance.
30 @param Controls: The Controls having the Unit.
31 @param Measurements: The Measurements having the Unit
32 @param MetaBlockConOutput:
33 @param MetaBlockConInput:
34 @param ProtectionEquipments: The Protection Equipments having the Unit.
37 self
.Controls
= [] if Controls
is None else Controls
39 self
._Measurements
= []
40 self
.Measurements
= [] if Measurements
is None else Measurements
42 self
._MetaBlockConOutput
= []
43 self
.MetaBlockConOutput
= [] if MetaBlockConOutput
is None else MetaBlockConOutput
45 self
._MetaBlockConInput
= []
46 self
.MetaBlockConInput
= [] if MetaBlockConInput
is None else MetaBlockConInput
48 self
._ProtectionEquipments
= []
49 self
.ProtectionEquipments
= [] if ProtectionEquipments
is None else ProtectionEquipments
51 super(Unit
, self
).__init
__(*args
, **kw_args
)
57 _refs
= ["Controls", "Measurements", "MetaBlockConOutput", "MetaBlockConInput", "ProtectionEquipments"]
58 _many_refs
= ["Controls", "Measurements", "MetaBlockConOutput", "MetaBlockConInput", "ProtectionEquipments"]
60 def getControls(self
):
61 """The Controls having the Unit.
65 def setControls(self
, value
):
66 for x
in self
._Controls
:
70 self
._Controls
= value
72 Controls
= property(getControls
, setControls
)
74 def addControls(self
, *Controls
):
78 def removeControls(self
, *Controls
):
82 def getMeasurements(self
):
83 """The Measurements having the Unit
85 return self
._Measurements
87 def setMeasurements(self
, value
):
88 for x
in self
._Measurements
:
92 self
._Measurements
= value
94 Measurements
= property(getMeasurements
, setMeasurements
)
96 def addMeasurements(self
, *Measurements
):
97 for obj
in Measurements
:
100 def removeMeasurements(self
, *Measurements
):
101 for obj
in Measurements
:
104 def getMetaBlockConOutput(self
):
106 return self
._MetaBlockConOutput
108 def setMetaBlockConOutput(self
, value
):
109 for x
in self
._MetaBlockConOutput
:
113 self
._MetaBlockConOutput
= value
115 MetaBlockConOutput
= property(getMetaBlockConOutput
, setMetaBlockConOutput
)
117 def addMetaBlockConOutput(self
, *MetaBlockConOutput
):
118 for obj
in MetaBlockConOutput
:
121 def removeMetaBlockConOutput(self
, *MetaBlockConOutput
):
122 for obj
in MetaBlockConOutput
:
125 def getMetaBlockConInput(self
):
127 return self
._MetaBlockConInput
129 def setMetaBlockConInput(self
, value
):
130 for x
in self
._MetaBlockConInput
:
134 self
._MetaBlockConInput
= value
136 MetaBlockConInput
= property(getMetaBlockConInput
, setMetaBlockConInput
)
138 def addMetaBlockConInput(self
, *MetaBlockConInput
):
139 for obj
in MetaBlockConInput
:
142 def removeMetaBlockConInput(self
, *MetaBlockConInput
):
143 for obj
in MetaBlockConInput
:
146 def getProtectionEquipments(self
):
147 """The Protection Equipments having the Unit.
149 return self
._ProtectionEquipments
151 def setProtectionEquipments(self
, value
):
152 for x
in self
._ProtectionEquipments
:
156 self
._ProtectionEquipments
= value
158 ProtectionEquipments
= property(getProtectionEquipments
, setProtectionEquipments
)
160 def addProtectionEquipments(self
, *ProtectionEquipments
):
161 for obj
in ProtectionEquipments
:
164 def removeProtectionEquipments(self
, *ProtectionEquipments
):
165 for obj
in ProtectionEquipments
: