Browse Source

rename debug_loop to loop

Thomas Buck 1 year ago
parent
commit
8b1509c216
14 changed files with 20 additions and 20 deletions
  1. 1
    1
      camp_small.py
  2. 1
    1
      draw.py
  3. 1
    1
      image.py
  4. 1
    1
      life.py
  5. 1
    1
      manager.py
  6. 5
    5
      mapper.py
  7. 1
    1
      net.py
  8. 2
    2
      pi.py
  9. 1
    1
      qr.py
  10. 1
    1
      snake.py
  11. 1
    1
      solid.py
  12. 1
    1
      splash.py
  13. 2
    2
      test.py
  14. 1
    1
      tetris.py

+ 1
- 1
camp_small.py View File

69
     m.add(Solid(t, 1.0))
69
     m.add(Solid(t, 1.0))
70
 
70
 
71
     m.restart()
71
     m.restart()
72
-    t.debug_loop(m.draw)
72
+    t.loop(m.draw)

+ 1
- 1
draw.py View File

179
                      1, 75, (0, 255, 0), (0, 0, 25)))
179
                      1, 75, (0, 255, 0), (0, 0, 25)))
180
 
180
 
181
     m.restart()
181
     m.restart()
182
-    t.debug_loop(m.draw)
182
+    t.loop(m.draw)

+ 1
- 1
image.py View File

109
         m.add(ImageScreen(t, filename))
109
         m.add(ImageScreen(t, filename))
110
 
110
 
111
     m.restart()
111
     m.restart()
112
-    t.debug_loop(m.draw)
112
+    t.loop(m.draw)

+ 1
- 1
life.py View File

149
             g.restart()
149
             g.restart()
150
         g.draw()
150
         g.draw()
151
 
151
 
152
-    t.debug_loop(helper)
152
+    t.loop(helper)

+ 1
- 1
manager.py View File

81
     m.add(Solid(t, 1.0))
81
     m.add(Solid(t, 1.0))
82
 
82
 
83
     m.restart()
83
     m.restart()
84
-    t.debug_loop(m.draw)
84
+    t.loop(m.draw)

+ 5
- 5
mapper.py View File

23
     def loop_end(self):
23
     def loop_end(self):
24
         self.gui.loop_end()
24
         self.gui.loop_end()
25
 
25
 
26
-    def debug_loop(self, func = None):
27
-        self.gui.debug_loop(func)
26
+    def loop(self, func = None):
27
+        self.gui.loop(func)
28
 
28
 
29
     def set_pixel(self, x, y, color):
29
     def set_pixel(self, x, y, color):
30
         self.gui.set_pixel(x, y, color)
30
         self.gui.set_pixel(x, y, color)
36
 class MapperColorAdjust(MapperNull):
36
 class MapperColorAdjust(MapperNull):
37
     def set_pixel(self, x, y, color):
37
     def set_pixel(self, x, y, color):
38
         # right-most panel, with maximum x coordinates,
38
         # right-most panel, with maximum x coordinates,
39
-        # is "old" type with less bright LEDs.
40
-        # rest of panels to the left are brighter.
41
-        # so adjust brightness of left panel rg channels down.
39
+        # is "new" type with brighter LEDs.
40
+        # rest of panels to the left are less bright.
41
+        # so adjust brightness of right panel rg channels down.
42
         if x < self.gui.panelW:
42
         if x < self.gui.panelW:
43
             color = (int(color[0] * 0.75), int(color[1] * 0.75), color[2])
43
             color = (int(color[0] * 0.75), int(color[1] * 0.75), color[2])
44
 
44
 

+ 1
- 1
net.py View File

66
     d.success(ScrollText(t, "Success", "ib8x8u"))
66
     d.success(ScrollText(t, "Success", "ib8x8u"))
67
     d.fail(ScrollText(t, "Failure", "ib8x8u"))
67
     d.fail(ScrollText(t, "Failure", "ib8x8u"))
68
 
68
 
69
-    t.debug_loop(d.draw)
69
+    t.loop(d.draw)

+ 2
- 2
pi.py View File

76
     def loop_end(self):
76
     def loop_end(self):
77
         self.matrix.SetImage(self.image.convert('RGB'))
77
         self.matrix.SetImage(self.image.convert('RGB'))
78
 
78
 
79
-    def debug_loop(self, func = None):
79
+    def loop(self, func = None):
80
         while True:
80
         while True:
81
             if self.loop_start():
81
             if self.loop_start():
82
                 break
82
                 break
92
 
92
 
93
 if __name__ == "__main__":
93
 if __name__ == "__main__":
94
     t = PiMatrix(32, 32)
94
     t = PiMatrix(32, 32)
95
-    t.debug_loop(lambda: t.set_pixel(15, 15, (255, 255, 255)))
95
+    t.loop(lambda: t.set_pixel(15, 15, (255, 255, 255)))

+ 1
- 1
qr.py View File

91
     t = util.getTarget()
91
     t = util.getTarget()
92
 
92
 
93
     d = QRScreen(t, "Hello World", 10.0, "Drinks:", "tom-thumb", (255, 255, 255), (0, 0, 0))
93
     d = QRScreen(t, "Hello World", 10.0, "Drinks:", "tom-thumb", (255, 255, 255), (0, 0, 0))
94
-    t.debug_loop(d.draw)
94
+    t.loop(d.draw)

+ 1
- 1
snake.py View File

164
     i = InputWrapper()
164
     i = InputWrapper()
165
 
165
 
166
     d = Snake(t, i)
166
     d = Snake(t, i)
167
-    t.debug_loop(d.draw)
167
+    t.loop(d.draw)

+ 1
- 1
solid.py View File

61
 
61
 
62
         d.draw()
62
         d.draw()
63
 
63
 
64
-    t.debug_loop(helper)
64
+    t.loop(helper)

+ 1
- 1
splash.py View File

40
     import util
40
     import util
41
     t = util.getTarget()
41
     t = util.getTarget()
42
     s = SplashScreen(t)
42
     s = SplashScreen(t)
43
-    t.debug_loop(s.draw)
43
+    t.loop(s.draw)

+ 2
- 2
test.py View File

45
         pygame.display.flip()
45
         pygame.display.flip()
46
         self.clock.tick(30)
46
         self.clock.tick(30)
47
 
47
 
48
-    def debug_loop(self, func = None):
48
+    def loop(self, func = None):
49
         while True:
49
         while True:
50
             if self.loop_start():
50
             if self.loop_start():
51
                 break
51
                 break
62
 
62
 
63
 if __name__ == "__main__":
63
 if __name__ == "__main__":
64
     t = TestGUI(32, 32)
64
     t = TestGUI(32, 32)
65
-    t.debug_loop(lambda: t.set_pixel(15, 15, (255, 255, 255)))
65
+    t.loop(lambda: t.set_pixel(15, 15, (255, 255, 255)))

+ 1
- 1
tetris.py View File

263
     i = InputWrapper()
263
     i = InputWrapper()
264
 
264
 
265
     d = Tetris(t, i, 0.1)
265
     d = Tetris(t, i, 0.1)
266
-    t.debug_loop(d.draw)
266
+    t.loop(d.draw)

Loading…
Cancel
Save