summaryrefslogtreecommitdiff
path: root/host/inter
diff options
context:
space:
mode:
authorNicolas Schodet2010-04-01 23:57:01 +0200
committerNicolas Schodet2010-04-01 23:57:01 +0200
commitfd3bd15a200b9b82a5893b533d91706255ed581c (patch)
treeceaae28f7a056caabaeb6e99315c69db7a227fed /host/inter
parented97e035bcb27ab8a1c1f91692728cd8f3f746fd (diff)
digital/asserv, host/inter: update old simulator after changes in Observer
The new Observer directly calls notify on register.
Diffstat (limited to 'host/inter')
-rw-r--r--host/inter/inter.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/host/inter/inter.py b/host/inter/inter.py
index a8270e53..3f1effd4 100644
--- a/host/inter/inter.py
+++ b/host/inter/inter.py
@@ -32,19 +32,20 @@ class Robot (Drawable):
def draw (self):
self.reset ()
- self.trans_rotate (self.angle)
- self.trans_translate (self.pos)
- self.draw_polygon ((115, 30), (170, 85), (150, 127), (130, 145),
- (-25, 200), (-70, 200), (-70, -200), (-25, -200),
- (130, -145), (150, -127), (170, -85), (115, -30))
- axes_fill = '#404040'
- self.draw_line ((-70, 0), (170, 0), fill = axes_fill, arrow = LAST)
- f = 142 + 2 * 31.5 - 13.5
- wr = 63 / 2
- self.draw_line ((0, +f / 2), (0, -f / 2), fill = axes_fill)
- self.draw_line ((-wr, f / 2), (+wr, f / 2), fill = axes_fill)
- self.draw_line ((-wr, -f / 2), (+wr, -f / 2), fill = axes_fill)
- Drawable.draw (self)
+ if self.angle is not None:
+ self.trans_rotate (self.angle)
+ self.trans_translate (self.pos)
+ self.draw_polygon ((115, 30), (170, 85), (150, 127), (130, 145),
+ (-25, 200), (-70, 200), (-70, -200), (-25, -200),
+ (130, -145), (150, -127), (170, -85), (115, -30))
+ axes_fill = '#404040'
+ self.draw_line ((-70, 0), (170, 0), fill = axes_fill, arrow = LAST)
+ f = 142 + 2 * 31.5 - 13.5
+ wr = 63 / 2
+ self.draw_line ((0, +f / 2), (0, -f / 2), fill = axes_fill)
+ self.draw_line ((-wr, f / 2), (+wr, f / 2), fill = axes_fill)
+ self.draw_line ((-wr, -f / 2), (+wr, -f / 2), fill = axes_fill)
+ Drawable.draw (self)
class Obstacle (Drawable):
"""An obstacle."""