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
.CDPSM
.Balanced
.IEC61970
.Core
.IdentifiedObject
import IdentifiedObject
23 class PerLengthPhaseImpedance(IdentifiedObject
):
24 """Impedance and admittance parameters per unit length for n-wire unbalanced lines, in matrix form.
27 def __init__(self
, conductorCount
=0, PhaseImpedanceData
=None, ConductorSegments
=None, *args
, **kw_args
):
28 """Initialises a new 'PerLengthPhaseImpedance' instance.
30 @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.
31 @param PhaseImpedanceData: All data that belong to this conductor phase impedance.
32 @param ConductorSegments: All conductor segments described by this phase impedance.
34 #: 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.
35 self
.conductorCount
= conductorCount
37 self
._PhaseImpedanceData
= []
38 self
.PhaseImpedanceData
= [] if PhaseImpedanceData
is None else PhaseImpedanceData
40 self
._ConductorSegments
= []
41 self
.ConductorSegments
= [] if ConductorSegments
is None else ConductorSegments
43 super(PerLengthPhaseImpedance
, self
).__init
__(*args
, **kw_args
)
45 _attrs
= ["conductorCount"]
46 _attr_types
= {"conductorCount": int}
47 _defaults
= {"conductorCount": 0}
49 _refs
= ["PhaseImpedanceData", "ConductorSegments"]
50 _many_refs
= ["PhaseImpedanceData", "ConductorSegments"]
52 def getPhaseImpedanceData(self
):
53 """All data that belong to this conductor phase impedance.
55 return self
._PhaseImpedanceData
57 def setPhaseImpedanceData(self
, value
):
58 for x
in self
._PhaseImpedanceData
:
59 x
.PhaseImpedance
= None
61 y
._PhaseImpedance
= self
62 self
._PhaseImpedanceData
= value
64 PhaseImpedanceData
= property(getPhaseImpedanceData
, setPhaseImpedanceData
)
66 def addPhaseImpedanceData(self
, *PhaseImpedanceData
):
67 for obj
in PhaseImpedanceData
:
68 obj
.PhaseImpedance
= self
70 def removePhaseImpedanceData(self
, *PhaseImpedanceData
):
71 for obj
in PhaseImpedanceData
:
72 obj
.PhaseImpedance
= None
74 def getConductorSegments(self
):
75 """All conductor segments described by this phase impedance.
77 return self
._ConductorSegments
79 def setConductorSegments(self
, value
):
80 for x
in self
._ConductorSegments
:
81 x
.PhaseImpedance
= None
83 y
._PhaseImpedance
= self
84 self
._ConductorSegments
= value
86 ConductorSegments
= property(getConductorSegments
, setConductorSegments
)
88 def addConductorSegments(self
, *ConductorSegments
):
89 for obj
in ConductorSegments
:
90 obj
.PhaseImpedance
= self
92 def removeConductorSegments(self
, *ConductorSegments
):
93 for obj
in ConductorSegments
:
94 obj
.PhaseImpedance
= None