From ad29db0af7515283e6fdb4e9c527dfe334c1e137 Mon Sep 17 00:00:00 2001 From: josep Date: Tue, 24 Dec 2024 09:28:44 +0900 Subject: [PATCH] =?UTF-8?q?display=20move=20=ED=95=A8=EC=88=98=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modi_plus/module/output_module/display.py | 26 ++++------------------ tests/module/output_module/test_display.py | 15 ------------- 2 files changed, 4 insertions(+), 37 deletions(-) diff --git a/modi_plus/module/output_module/display.py b/modi_plus/module/output_module/display.py index aa89098..848185c 100644 --- a/modi_plus/module/output_module/display.py +++ b/modi_plus/module/output_module/display.py @@ -231,8 +231,8 @@ def write_variable_xy(self, x: int, y: int, variable: float) -> None: self._id, Display.PROPERTY_DISPLAY_WRITE_VARIABLE, property_values=(("u8", x), - ("u8", y), - ("float", variable), ) + ("u8", y), + ("float", variable), ) ) self._text += str(variable) time.sleep(0.01) @@ -250,8 +250,8 @@ def write_variable_line(self, line: int, variable: float) -> None: self._id, Display.PROPERTY_DISPLAY_WRITE_VARIABLE, property_values=(("u8", 0), - ("u8", line * 20), - ("float", variable), ) + ("u8", line * 20), + ("float", variable), ) ) self._text += str(variable) time.sleep(0.01) @@ -326,24 +326,6 @@ def set_offset(self, x: int, y: int) -> None: ) time.sleep(0.01) - def move_screen(self, x: int, y: int) -> None: - """Move the screen by x and y - - :param x: X-axis movement value - :type x: int - :param y: Y-axis movement value - :type y: int - :return: None - """ - - self._set_property( - self.id, - Display.PROPERTY_DISPLAY_MOVE_SCREEN, - property_values=(("s8", x), ("s8", y), ), - force=True - ) - time.sleep(0.01) - def reset(self, mode=0) -> None: """Clear the screen. diff --git a/tests/module/output_module/test_display.py b/tests/module/output_module/test_display.py index 7f3a1c9..f0dad31 100644 --- a/tests/module/output_module/test_display.py +++ b/tests/module/output_module/test_display.py @@ -132,21 +132,6 @@ def test_set_offset(self): sent_messages.append(self.connection.send_list.pop()) self.assertTrue(set_message in sent_messages) - def test_move_screen(self): - """Test move_screen method.""" - - mock_x = 10 - mock_y = 20 - self.display.move_screen(mock_x, mock_y) - set_message = parse_set_property_message( - -1, Display.PROPERTY_DISPLAY_MOVE_SCREEN, - (("s8", mock_x), ("s8", mock_y), ) - ) - sent_messages = [] - while self.connection.send_list: - sent_messages.append(self.connection.send_list.pop()) - self.assertTrue(set_message in sent_messages) - def test_reset(self): """Test reset method."""