diff options
author | Gary Bressler <garybressler@nc.rr.com> | 2010-04-08 17:11:08 -0400 |
---|---|---|
committer | Gary Bressler <garybressler@nc.rr.com> | 2010-04-08 17:11:08 -0400 |
commit | ceff6457bfeb5642616f4711f14e0bb652d12164 (patch) | |
tree | d05b4ebd1c3ee6e28884c669d65fd31700941086 /unit_trace/viz/renderer.py | |
parent | 01abc8352aa2fd192678b4066b26ea749a203801 (diff) |
Updated the documentation to describe the visualizer, made unit-trace itself not require gtk/cairo, and a few other minor things.
Diffstat (limited to 'unit_trace/viz/renderer.py')
-rw-r--r-- | unit_trace/viz/renderer.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/unit_trace/viz/renderer.py b/unit_trace/viz/renderer.py index 4b231c4..056e1a5 100644 --- a/unit_trace/viz/renderer.py +++ b/unit_trace/viz/renderer.py | |||
@@ -4,17 +4,17 @@ from graph import * | |||
4 | 4 | ||
5 | """The renderer, a glue object which converts a schedule to its representation | 5 | """The renderer, a glue object which converts a schedule to its representation |
6 | on a graph.""" | 6 | on a graph.""" |
7 | 7 | ||
8 | class Renderer(object): | 8 | class Renderer(object): |
9 | def __init__(self, schedule): | 9 | def __init__(self, schedule): |
10 | self.schedule = schedule | 10 | self.schedule = schedule |
11 | 11 | ||
12 | def prepare_task_graph(self, SurfaceType=ImageSurface, attrs=GraphFormat()): | 12 | def prepare_task_graph(self, SurfaceType=ImageSurface, attrs=GraphFormat()): |
13 | """Outputs the fully-rendered graph (y-axis = tasks) to a Cairo ImageSurface""" | 13 | """Outputs the fully-rendered graph (y-axis = tasks) to a Cairo ImageSurface""" |
14 | item_list = self.get_task_item_list() | 14 | item_list = self.get_task_item_list() |
15 | start, end = self.schedule.get_time_bounds() | 15 | start, end = self.schedule.get_time_bounds() |
16 | self.graph = TaskGraph(CairoCanvas, SurfaceType(), start, end, item_list, attrs) | 16 | self.graph = TaskGraph(CairoCanvas, SurfaceType(), start, end, item_list, attrs) |
17 | 17 | ||
18 | def prepare_cpu_graph(self, SurfaceType=ImageSurface, attrs=GraphFormat()): | 18 | def prepare_cpu_graph(self, SurfaceType=ImageSurface, attrs=GraphFormat()): |
19 | item_list = ['CPU %d' % i for i in range(0, self.schedule.get_num_cpus())] | 19 | item_list = ['CPU %d' % i for i in range(0, self.schedule.get_num_cpus())] |
20 | start, end = self.schedule.get_time_bounds() | 20 | start, end = self.schedule.get_time_bounds() |
@@ -25,16 +25,16 @@ class Renderer(object): | |||
25 | and drawing it piece by piece""" | 25 | and drawing it piece by piece""" |
26 | #graph.draw_axes('Time', '') | 26 | #graph.draw_axes('Time', '') |
27 | self.schedule.render(self.graph) | 27 | self.schedule.render(self.graph) |
28 | 28 | ||
29 | def write_out(self, fname): | 29 | def write_out(self, fname): |
30 | self.graph.surface.write_out(fname) | 30 | self.graph.surface.write_out(fname) |
31 | 31 | ||
32 | def get_graph(self): | 32 | def get_graph(self): |
33 | return self.graph | 33 | return self.graph |
34 | 34 | ||
35 | def get_schedule(self): | 35 | def get_schedule(self): |
36 | return self.schedule | 36 | return self.schedule |
37 | 37 | ||
38 | def get_task_item_list(self): | 38 | def get_task_item_list(self): |
39 | return [task.get_name() for task in self.schedule.get_task_list()] | 39 | return [task.get_name() for task in self.schedule.get_task_list()] |
40 | 40 | ||