Commit 35b0e737 authored by fred's avatar fred
Browse files

grid: handle new "sonar" case

parent 70d07b53
......@@ -447,10 +447,13 @@ class Grid(TemplateView):
# we set the cell time label to the longest
# period
grid[i][j].time_label = same_cell_below.time_label
# then we sort emissions so the longest are
# put first
grid[i][j].schedules.sort(
lambda x, y: -cmp(x.get_duration(), y.get_duration()))
# then we sort emissions, and if the start
# time is the same, the longest are put first
def cmp_schedule(x, y):
if x.datetime == y.datetime:
return -cmp(x.get_duration(), y.get_duration())
return cmp(x.datetime, y.datetime)
grid[i][j].schedules.sort(cmp_schedule)
# then we add individual time labels to the
# other schedules
for schedule in current_cell_schedules:
......
Supports Markdown
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