Adding CDPSM package.
[PyCIM.git] / CIM14 / IEC61968 / AssetModels / OpenCircuitTest.py
blobea7003e81d51b20b95f5c9c614c11615d4ed5d3c
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.IEC61968.AssetModels.DistributionWindingTest import DistributionWindingTest
19 class OpenCircuitTest(DistributionWindingTest):
20 """Open-circuit test results may include no-load losses, exciting current, phase shifts, and induced voltage. For three-phase windings, the excitation can be positive sequence (the default) or zero sequence. For induced voltage and phase shifts, use the associated ToWindingSpec class.
21 """
23 def __init__(self, excitingCurrentZero=0.0, noLoadLossZero=0.0, noLoadLoss=0.0, excitingCurrent=0.0, MeasuredWindingSpecs=None, *args, **kw_args):
24 """Initialises a new 'OpenCircuitTest' instance.
26 @param excitingCurrentZero: Exciting current measured from a zero-sequence open-circuit (excitation) test.
27 @param noLoadLossZero: Losses measured from a zero-sequence open-circuit (excitation) test.
28 @param noLoadLoss: Losses measured from a positive-sequence or single-phase open-circuit (excitation) test.
29 @param excitingCurrent: Exciting current measured from a positive-sequence or single-phase open-circuit (excitation) test.
30 @param MeasuredWindingSpecs: All other windings measured during this test.
31 """
32 #: Exciting current measured from a zero-sequence open-circuit (excitation) test.
33 self.excitingCurrentZero = excitingCurrentZero
35 #: Losses measured from a zero-sequence open-circuit (excitation) test.
36 self.noLoadLossZero = noLoadLossZero
38 #: Losses measured from a positive-sequence or single-phase open-circuit (excitation) test.
39 self.noLoadLoss = noLoadLoss
41 #: Exciting current measured from a positive-sequence or single-phase open-circuit (excitation) test.
42 self.excitingCurrent = excitingCurrent
44 self._MeasuredWindingSpecs = []
45 self.MeasuredWindingSpecs = [] if MeasuredWindingSpecs is None else MeasuredWindingSpecs
47 super(OpenCircuitTest, self).__init__(*args, **kw_args)
49 _attrs = ["excitingCurrentZero", "noLoadLossZero", "noLoadLoss", "excitingCurrent"]
50 _attr_types = {"excitingCurrentZero": float, "noLoadLossZero": float, "noLoadLoss": float, "excitingCurrent": float}
51 _defaults = {"excitingCurrentZero": 0.0, "noLoadLossZero": 0.0, "noLoadLoss": 0.0, "excitingCurrent": 0.0}
52 _enums = {}
53 _refs = ["MeasuredWindingSpecs"]
54 _many_refs = ["MeasuredWindingSpecs"]
56 def getMeasuredWindingSpecs(self):
57 """All other windings measured during this test.
58 """
59 return self._MeasuredWindingSpecs
61 def setMeasuredWindingSpecs(self, value):
62 for p in self._MeasuredWindingSpecs:
63 filtered = [q for q in p.OpenCircuitTests if q != self]
64 self._MeasuredWindingSpecs._OpenCircuitTests = filtered
65 for r in value:
66 if self not in r._OpenCircuitTests:
67 r._OpenCircuitTests.append(self)
68 self._MeasuredWindingSpecs = value
70 MeasuredWindingSpecs = property(getMeasuredWindingSpecs, setMeasuredWindingSpecs)
72 def addMeasuredWindingSpecs(self, *MeasuredWindingSpecs):
73 for obj in MeasuredWindingSpecs:
74 if self not in obj._OpenCircuitTests:
75 obj._OpenCircuitTests.append(self)
76 self._MeasuredWindingSpecs.append(obj)
78 def removeMeasuredWindingSpecs(self, *MeasuredWindingSpecs):
79 for obj in MeasuredWindingSpecs:
80 if self in obj._OpenCircuitTests:
81 obj._OpenCircuitTests.remove(self)
82 self._MeasuredWindingSpecs.remove(obj)