Browse Source

randomized manager should not show same screen twice

Thomas Buck 1 year ago
parent
commit
b29c8e66b4
2 changed files with 5 additions and 4 deletions
  1. 2
    2
      manager.py
  2. 3
    2
      util.py

+ 2
- 2
manager.py View File

78
             if self.randomize:
78
             if self.randomize:
79
                 if (self.index % self.step_size) == (self.step_size - 1):
79
                 if (self.index % self.step_size) == (self.step_size - 1):
80
                     # end of "segment", now go to random next segment
80
                     # end of "segment", now go to random next segment
81
-                    new_index = self.index
82
-                    while (new_index == self.index) and (len(self.screens) > self.step_size):
81
+                    new_index = self.index - self.step_size + 1
82
+                    while (new_index == self.index - self.step_size + 1) and (len(self.screens) > self.step_size):
83
                         new_index = int(random.randrange(0, len(self.screens) / self.step_size) * self.step_size)
83
                         new_index = int(random.randrange(0, len(self.screens) / self.step_size) * self.step_size)
84
                     self.index = new_index
84
                     self.index = new_index
85
                 else:
85
                 else:

+ 3
- 2
util.py View File

91
             ui = TestGUI()
91
             ui = TestGUI()
92
 
92
 
93
             # TODO hard-coded adjustments
93
             # TODO hard-coded adjustments
94
-            from mapper import MapperReduceBrightness
95
-            target = MapperReduceBrightness(ui, i)
94
+            #from mapper import MapperReduceBrightness
95
+            #target = MapperReduceBrightness(ui, i)
96
+            target = ui
96
 
97
 
97
             if targetPlatform == None:
98
             if targetPlatform == None:
98
                 # only print once
99
                 # only print once

Loading…
Cancel
Save