Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61968 / WiresExt / PerLengthPhaseImpedance.py
blob1de635e7f7241019200a64b76e2118c8f06a44e1
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 PerLengthPhaseImpedance(IdentifiedObject):
20 """Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form.
21 """
23 def __init__(self, conductorCount=0, ConductorSegments=None, PhaseImpedanceData=None, *args, **kw_args):
24 """Initialises a new 'PerLengthPhaseImpedance' instance.
26 @param conductorCount: Number of phase, neutral, and other wires retained. Constrains the number of matrix elements and the phase codes that can be used with this matrix.
27 @param ConductorSegments: All conductor segments described by this phase impedance.
28 @param PhaseImpedanceData: All data that belong to this conductor phase impedance.
29 """
30 #: Number of phase, neutral, and other wires retained. Constrains the number of matrix elements and the phase codes that can be used with this matrix.
31 self.conductorCount = conductorCount
33 self._ConductorSegments = []
34 self.ConductorSegments = [] if ConductorSegments is None else ConductorSegments
36 self._PhaseImpedanceData = []
37 self.PhaseImpedanceData = [] if PhaseImpedanceData is None else PhaseImpedanceData
39 super(PerLengthPhaseImpedance, self).__init__(*args, **kw_args)
41 _attrs = ["conductorCount"]
42 _attr_types = {"conductorCount": int}
43 _defaults = {"conductorCount": 0}
44 _enums = {}
45 _refs = ["ConductorSegments", "PhaseImpedanceData"]
46 _many_refs = ["ConductorSegments", "PhaseImpedanceData"]
48 def getConductorSegments(self):
49 """All conductor segments described by this phase impedance.
50 """
51 return self._ConductorSegments
53 def setConductorSegments(self, value):
54 for x in self._ConductorSegments:
55 x.PhaseImpedance = None
56 for y in value:
57 y._PhaseImpedance = self
58 self._ConductorSegments = value
60 ConductorSegments = property(getConductorSegments, setConductorSegments)
62 def addConductorSegments(self, *ConductorSegments):
63 for obj in ConductorSegments:
64 obj.PhaseImpedance = self
66 def removeConductorSegments(self, *ConductorSegments):
67 for obj in ConductorSegments:
68 obj.PhaseImpedance = None
70 def getPhaseImpedanceData(self):
71 """All data that belong to this conductor phase impedance.
72 """
73 return self._PhaseImpedanceData
75 def setPhaseImpedanceData(self, value):
76 for x in self._PhaseImpedanceData:
77 x.PhaseImpedance = None
78 for y in value:
79 y._PhaseImpedance = self
80 self._PhaseImpedanceData = value
82 PhaseImpedanceData = property(getPhaseImpedanceData, setPhaseImpedanceData)
84 def addPhaseImpedanceData(self, *PhaseImpedanceData):
85 for obj in PhaseImpedanceData:
86 obj.PhaseImpedance = self
88 def removePhaseImpedanceData(self, *PhaseImpedanceData):
89 for obj in PhaseImpedanceData:
90 obj.PhaseImpedance = None