Fixing website and API documentation links
[PyCIM.git] / CIM14 / CDPSM / Balanced / IEC61968 / AssetModels / WireArrangement.py
blob7ed2c3eb6f9815b143675672dc6650329bf93c87
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.CDPSM.Balanced.IEC61970.Core.IdentifiedObject import IdentifiedObject
23 class WireArrangement(IdentifiedObject):
24 """Identification, spacing and configuration of the wires of a Conductor, with reference to their type.
25 """
27 def __init__(self, mountingPointX=0.0, mountingPointY=0.0, position=0, ConductorInfo=None, WireType=None, *args, **kw_args):
28 """Initialises a new 'WireArrangement' instance.
30 @param mountingPointX: Signed horizontal distance from the first wire to a common reference point.
31 @param mountingPointY: Height above ground of the first wire.
32 @param position: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC.
33 @param ConductorInfo: Conductor data this wire arrangement belongs to.
34 @param WireType: Wire type used for this wire arrangement.
35 """
36 #: Signed horizontal distance from the first wire to a common reference point.
37 self.mountingPointX = mountingPointX
39 #: Height above ground of the first wire.
40 self.mountingPointY = mountingPointY
42 #: Position number on the structure corresponding to this wire. For example, use 1..3 for phases and 4 for the neutral on a 3-phase structure. The individual phase assignments matter; for example, ABC will produce a different set of unbalanced line parameters, by phase, than BAC.
43 self.position = position
45 self._ConductorInfo = None
46 self.ConductorInfo = ConductorInfo
48 self._WireType = None
49 self.WireType = WireType
51 super(WireArrangement, self).__init__(*args, **kw_args)
53 _attrs = ["mountingPointX", "mountingPointY", "position"]
54 _attr_types = {"mountingPointX": float, "mountingPointY": float, "position": int}
55 _defaults = {"mountingPointX": 0.0, "mountingPointY": 0.0, "position": 0}
56 _enums = {}
57 _refs = ["ConductorInfo", "WireType"]
58 _many_refs = []
60 def getConductorInfo(self):
61 """Conductor data this wire arrangement belongs to.
62 """
63 return self._ConductorInfo
65 def setConductorInfo(self, value):
66 if self._ConductorInfo is not None:
67 filtered = [x for x in self.ConductorInfo.WireArrangements if x != self]
68 self._ConductorInfo._WireArrangements = filtered
70 self._ConductorInfo = value
71 if self._ConductorInfo is not None:
72 if self not in self._ConductorInfo._WireArrangements:
73 self._ConductorInfo._WireArrangements.append(self)
75 ConductorInfo = property(getConductorInfo, setConductorInfo)
77 def getWireType(self):
78 """Wire type used for this wire arrangement.
79 """
80 return self._WireType
82 def setWireType(self, value):
83 if self._WireType is not None:
84 filtered = [x for x in self.WireType.WireArrangements if x != self]
85 self._WireType._WireArrangements = filtered
87 self._WireType = value
88 if self._WireType is not None:
89 if self not in self._WireType._WireArrangements:
90 self._WireType._WireArrangements.append(self)
92 WireType = property(getWireType, setWireType)