Changeset 507
- Timestamp:
- 06/03/09 17:58:17 (3 years ago)
- Files:
-
- 1 modified
-
trunk/software/rb/gui/speedgraph.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/software/rb/gui/speedgraph.py
r504 r507 18 18 import gtk 19 19 20 21 20 DATA_WINDOW = 500 # How many updates to graph 21 STAT_SCALE = 1.0 / 32767.0 # Motor stat coefficient 22 # Motor stats are multiplied by this number, which should put them in a -1..1 range. 22 23 23 24 class SpeedGraph(gtk.DrawingArea): … … 74 75 75 76 def draw_line(self, context, center_y, start_x, step_x, color, data): 77 if not data: 78 return 76 79 x = start_x 77 80 context.move_to(x, center_y + (data.pop(0) * center_y)) … … 89 92 lst, rst = self.drive.getstat() 90 93 new_data = [lt, rt, ls, rs] 91 new_data += [s / 32767.0for s in (lst + rst)]94 new_data += [s * STAT_SCALE for s in (lst + rst)] 92 95 93 96 for datum, list in zip(new_data, self.data):

