Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / Core / RegularIntervalSchedule.py
blob561a8bb0a5efbfbfa73411cc79bef884e93d8580
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.BasicIntervalSchedule import BasicIntervalSchedule
23 class RegularIntervalSchedule(BasicIntervalSchedule):
24 """The schedule has TimePoints where the time between them is constant.
25 """
27 def __init__(self, endTime='', timeStep=0.0, TimePoints=None, *args, **kw_args):
28 """Initialises a new 'RegularIntervalSchedule' instance.
30 @param endTime: The time for the last time point.
31 @param timeStep: The time between each pair of subsequent RegularTimePoints.
32 @param TimePoints: The point data values that define a curve
33 """
34 #: The time for the last time point.
35 self.endTime = endTime
37 #: The time between each pair of subsequent RegularTimePoints.
38 self.timeStep = timeStep
40 self._TimePoints = []
41 self.TimePoints = [] if TimePoints is None else TimePoints
43 super(RegularIntervalSchedule, self).__init__(*args, **kw_args)
45 _attrs = ["endTime", "timeStep"]
46 _attr_types = {"endTime": str, "timeStep": float}
47 _defaults = {"endTime": '', "timeStep": 0.0}
48 _enums = {}
49 _refs = ["TimePoints"]
50 _many_refs = ["TimePoints"]
52 def getTimePoints(self):
53 """The point data values that define a curve
54 """
55 return self._TimePoints
57 def setTimePoints(self, value):
58 for x in self._TimePoints:
59 x.IntervalSchedule = None
60 for y in value:
61 y._IntervalSchedule = self
62 self._TimePoints = value
64 TimePoints = property(getTimePoints, setTimePoints)
66 def addTimePoints(self, *TimePoints):
67 for obj in TimePoints:
68 obj.IntervalSchedule = self
70 def removeTimePoints(self, *TimePoints):
71 for obj in TimePoints:
72 obj.IntervalSchedule = None