Fixing website and API documentation links
[PyCIM.git] / CIM14 / IEC61970 / LoadModel / Season.py
blobe9988aedcd96de0eea91ab5421ebf9c38d5606e4
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.Element import Element
23 class Season(Element):
24 """A specified time period of the year, e.g., Spring, Summer, Fall, Winter
25 """
27 def __init__(self, name="fall", startDate='', endDate='', SeasonDayTypeSchedules=None, *args, **kw_args):
28 """Initialises a new 'Season' instance.
30 @param name: Name of the Season Values are: "fall", "winter", "summer", "spring"
31 @param startDate: Date season starts
32 @param endDate: Date season ends
33 @param SeasonDayTypeSchedules: Schedules that use this Season.
34 """
35 #: Name of the Season Values are: "fall", "winter", "summer", "spring"
36 self.name = name
38 #: Date season starts
39 self.startDate = startDate
41 #: Date season ends
42 self.endDate = endDate
44 self._SeasonDayTypeSchedules = []
45 self.SeasonDayTypeSchedules = [] if SeasonDayTypeSchedules is None else SeasonDayTypeSchedules
47 super(Season, self).__init__(*args, **kw_args)
49 _attrs = ["name", "startDate", "endDate"]
50 _attr_types = {"name": str, "startDate": str, "endDate": str}
51 _defaults = {"name": "fall", "startDate": '', "endDate": ''}
52 _enums = {"name": "SeasonName"}
53 _refs = ["SeasonDayTypeSchedules"]
54 _many_refs = ["SeasonDayTypeSchedules"]
56 def getSeasonDayTypeSchedules(self):
57 """Schedules that use this Season.
58 """
59 return self._SeasonDayTypeSchedules
61 def setSeasonDayTypeSchedules(self, value):
62 for x in self._SeasonDayTypeSchedules:
63 x.Season = None
64 for y in value:
65 y._Season = self
66 self._SeasonDayTypeSchedules = value
68 SeasonDayTypeSchedules = property(getSeasonDayTypeSchedules, setSeasonDayTypeSchedules)
70 def addSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules):
71 for obj in SeasonDayTypeSchedules:
72 obj.Season = self
74 def removeSeasonDayTypeSchedules(self, *SeasonDayTypeSchedules):
75 for obj in SeasonDayTypeSchedules:
76 obj.Season = None