Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Core / Unit.py
blobed416f335be7af06944d31c632e6f423ee26752f
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
19 # IN THE SOFTWARE.
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.
25 """
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.
35 """
36 self._Controls = []
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)
53 _attrs = []
54 _attr_types = {}
55 _defaults = {}
56 _enums = {}
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.
62 """
63 return self._Controls
65 def setControls(self, value):
66 for x in self._Controls:
67 x.Unit = None
68 for y in value:
69 y._Unit = self
70 self._Controls = value
72 Controls = property(getControls, setControls)
74 def addControls(self, *Controls):
75 for obj in Controls:
76 obj.Unit = self
78 def removeControls(self, *Controls):
79 for obj in Controls:
80 obj.Unit = None
82 def getMeasurements(self):
83 """The Measurements having the Unit
84 """
85 return self._Measurements
87 def setMeasurements(self, value):
88 for x in self._Measurements:
89 x.Unit = None
90 for y in value:
91 y._Unit = self
92 self._Measurements = value
94 Measurements = property(getMeasurements, setMeasurements)
96 def addMeasurements(self, *Measurements):
97 for obj in Measurements:
98 obj.Unit = self
100 def removeMeasurements(self, *Measurements):
101 for obj in Measurements:
102 obj.Unit = None
104 def getMetaBlockConOutput(self):
106 return self._MetaBlockConOutput
108 def setMetaBlockConOutput(self, value):
109 for x in self._MetaBlockConOutput:
110 x.Unit = None
111 for y in value:
112 y._Unit = self
113 self._MetaBlockConOutput = value
115 MetaBlockConOutput = property(getMetaBlockConOutput, setMetaBlockConOutput)
117 def addMetaBlockConOutput(self, *MetaBlockConOutput):
118 for obj in MetaBlockConOutput:
119 obj.Unit = self
121 def removeMetaBlockConOutput(self, *MetaBlockConOutput):
122 for obj in MetaBlockConOutput:
123 obj.Unit = None
125 def getMetaBlockConInput(self):
127 return self._MetaBlockConInput
129 def setMetaBlockConInput(self, value):
130 for x in self._MetaBlockConInput:
131 x.Unit = None
132 for y in value:
133 y._Unit = self
134 self._MetaBlockConInput = value
136 MetaBlockConInput = property(getMetaBlockConInput, setMetaBlockConInput)
138 def addMetaBlockConInput(self, *MetaBlockConInput):
139 for obj in MetaBlockConInput:
140 obj.Unit = self
142 def removeMetaBlockConInput(self, *MetaBlockConInput):
143 for obj in MetaBlockConInput:
144 obj.Unit = None
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:
153 x.Unit = None
154 for y in value:
155 y._Unit = self
156 self._ProtectionEquipments = value
158 ProtectionEquipments = property(getProtectionEquipments, setProtectionEquipments)
160 def addProtectionEquipments(self, *ProtectionEquipments):
161 for obj in ProtectionEquipments:
162 obj.Unit = self
164 def removeProtectionEquipments(self, *ProtectionEquipments):
165 for obj in ProtectionEquipments:
166 obj.Unit = None