Commit be84fc46 authored by fred's avatar fred
Browse files

use new get_duration() function to get real slot duration

parent 586ce67e
......@@ -39,7 +39,7 @@ class TimeCell:
def add_schedule(self, schedule):
end_time = schedule.datetime + timedelta(
minutes=schedule.emission.duration)
minutes=schedule.get_duration())
self.time_label = '%02d:%02d-%02d:%02d' % (
schedule.datetime.hour,
schedule.datetime.minute,
......@@ -54,7 +54,7 @@ class TimeCell:
return self.nonstop
def __eq__(self, other):
return (unicode(self) == unicode(other))
return (unicode(self) == unicode(other) and self.time_label == other.time_label)
class Grid(TemplateView):
......@@ -99,7 +99,7 @@ class Grid(TemplateView):
int(math.ceil(schedule.datetime.minute / 30))
day_no = schedule.get_weekday()
for step in range(int(math.ceil(schedule.emission.duration / 30))):
for step in range(int(math.ceil(schedule.get_duration() / 30.))):
if grid[(row_start+step)%nb_lines][day_no] is None:
grid[(row_start+step)%nb_lines][day_no] = TimeCell()
grid[(row_start+step)%nb_lines][day_no].add_schedule(schedule)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment