Set prootscreen image setting to safe mode

This commit is contained in:
CiscoTheWolf 2023-05-23 22:59:58 +02:00
parent 35cf042ed7
commit 989adc603d

View file

@ -41,9 +41,9 @@ class ProotState:
cls._instance.blinks_frames_ready = False
cls._instance.loading_screen = True
cls._instance.loading_time = 0
cls._instance.image_prootScreen1 = False
cls._instance.image_prootScreen2 = False
cls._instance.image_prootScreen3 = False
cls._instance.frame_canvas_prootScreen_1 = False
cls._instance.frame_canvas_prootScreen_2 = False
cls._instance.frame_canvas_prootScreen_3 = False
return cls._instance
def next_blink_frame_number(self) -> int:
@ -79,26 +79,29 @@ class ProotState:
def set_ProotScreen(self, matrix):
self.loading_time += 1
self.loading_time = self.loading_time % 90
if not self.image_prootScreen1:
self.image_prootScreen1 = matrix.CreateFrameCanvas()
image_prootScreen = Image.open("faces/ProotScreen1.png").convert('RGB')
self.image_prootScreen1.SetImage(image_prootScreen)
matrix.SwapOnVSync(self.image_prootScreen1)
if not self.image_prootScreen2:
self.image_prootScreen2 = matrix.CreateFrameCanvas()
image_prootScreen = Image.open("faces/ProotScreen2.png").convert('RGB')
self.image_prootScreen2.SetImage(image_prootScreen)
if not self.image_prootScreen3:
self.image_prootScreen3 = matrix.CreateFrameCanvas()
image_prootScreen = Image.open("faces/ProotScreen3.png").convert('RGB')
self.image_prootScreen3.SetImage(image_prootScreen)
if not self.frame_canvas_prootScreen_1:
self.frame_canvas_prootScreen_1 = matrix.CreateFrameCanvas()
image_proot_screen_1 = Image.open("faces/ProotScreen1.png").convert('RGB')
self.frame_canvas_prootScreen_1.SetImage(image_proot_screen_1, unsafe=False)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_1)
if not self.frame_canvas_prootScreen_2:
self.frame_canvas_prootScreen_2 = matrix.CreateFrameCanvas()
image_proot_screen_2 = Image.open("faces/ProotScreen2.png").convert('RGB')
self.frame_canvas_prootScreen_2.SetImage(image_proot_screen_2, unsafe=False)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_2)
if not self.frame_canvas_prootScreen_3:
self.frame_canvas_prootScreen_3 = matrix.CreateFrameCanvas()
image_proot_screen_3 = Image.open("faces/ProotScreen3.png").convert('RGB')
self.frame_canvas_prootScreen_3.SetImage(image_proot_screen_3, unsafe=False)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_3)
if self.loading_time < 30:
matrix.SwapOnVSync(self.image_prootScreen1)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_1)
elif self.loading_time < 60:
matrix.SwapOnVSync(self.image_prootScreen2)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_2)
else:
matrix.SwapOnVSync(self.image_prootScreen3)
matrix.SwapOnVSync(self.frame_canvas_prootScreen_3)
class Point2D:
@ -130,9 +133,6 @@ class Point2D:
return (self.x, self.y) == (other.x, other.y)
def mirror_points(points: list[Point2D]) -> list[Point2D]:
mirrored_points = []
for point in points: