summaryrefslogtreecommitdiff
path: root/digital
diff options
context:
space:
mode:
Diffstat (limited to 'digital')
-rw-r--r--digital/avr/modules/path/test/avrconfig.h2
-rw-r--r--digital/avr/modules/path/test/test_path.py21
2 files changed, 22 insertions, 1 deletions
diff --git a/digital/avr/modules/path/test/avrconfig.h b/digital/avr/modules/path/test/avrconfig.h
index 476fee86..8da6dbc6 100644
--- a/digital/avr/modules/path/test/avrconfig.h
+++ b/digital/avr/modules/path/test/avrconfig.h
@@ -31,7 +31,7 @@
/** Report function name. */
#define AC_PATH_REPORT_CALLBACK path_report
/** Number of possible obstacles. */
-#define AC_PATH_OBSTACLES_NB 2
+#define AC_PATH_OBSTACLES_NB 10
/** Number of points per obstacle. */
#define AC_PATH_OBSTACLES_POINTS_NB 8
diff --git a/digital/avr/modules/path/test/test_path.py b/digital/avr/modules/path/test/test_path.py
index 58939ff6..498e6017 100644
--- a/digital/avr/modules/path/test/test_path.py
+++ b/digital/avr/modules/path/test/test_path.py
@@ -148,6 +148,20 @@ class TestPath (Frame):
orient = 'horizontal', from_ = 0, to = 16,
command = self.escape_changed)
self.escapeScale.pack (side = 'top')
+ self.newObstacleFrame = LabelFrame (self.rightFrame)
+ self.newObstacleFrame.pack (side = 'top')
+ self.newObstacleRadius = Scale (self.newObstacleFrame,
+ label = 'Radius', orient = 'horizontal',
+ from_ = 50, to = 500, resolution = 50)
+ self.newObstacleRadius.pack (side = 'top')
+ self.newObstacleFactor = Scale (self.newObstacleFrame,
+ label = 'Factor', orient = 'horizontal',
+ from_ = 0, to = 16, resolution = 1)
+ self.newObstacleFactor.pack (side = 'top')
+ self.newObstacle = Button (self.newObstacleFrame,
+ text = 'New obstacle', command = self.new_obstacle)
+ self.newObstacleFrame.configure (labelanchor = 'n',
+ labelwidget = self.newObstacle)
self.areaview = AreaView (border_min, border_max, self)
self.areaview.pack (expand = True, fill = 'both')
self.areaview.bind ('<1>', self.click)
@@ -196,6 +210,13 @@ class TestPath (Frame):
self.areaview.area.escape = value
self.update ()
+ def new_obstacle (self):
+ radius = self.newObstacleRadius.get ()
+ factor = self.newObstacleFactor.get ()
+ self.areaview.area.obstacles.append (Obstacle ((750, 750), radius,
+ factor))
+ self.update ()
+
if __name__ == '__main__':
app = TestPath ((0, 0), (1500, 1500))
app.mainloop ()