Skip to content

Commit

Permalink
Remove "step" code from CommunicationMock
Browse files Browse the repository at this point in the history
This did not really work, due to running on a non-UI thread.
  • Loading branch information
jonathanperret committed Dec 13, 2024
1 parent a3db044 commit f2b0f32
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/main/python/main/ayab/engine/communication_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,20 +23,17 @@
import logging
from time import sleep

from PySide6.QtWidgets import QMessageBox

from .communication import Communication, Token


class CommunicationMock(Communication):
"""Class Handling the mock communication protocol."""

def __init__(self, delay=True, step=False) -> None:
def __init__(self, delay=True) -> None:
"""Initialize communication."""
logging.basicConfig(level=logging.DEBUG)
self.logger = logging.getLogger(type(self).__name__)
self.__delay = delay
self.__step = step
self.reset()

def __del__(self) -> None:
Expand Down Expand Up @@ -122,20 +119,6 @@ def update_API6(self) -> tuple[bytes | None, Token, int]:
self.rx_msg_list.append(reqLine)
if self.__delay:
sleep(1) # wait for knitting progress dialog to update
# step through output line by line
if self.__step:
# pop up box waits for user input before moving on to next line
msg = QMessageBox()
msg.setIcon(QMessageBox.Icon.Information)
msg.setText("Line number = " + str(self.__line_count))
msg.setStandardButtons(
QMessageBox.StandardButton.Ok
| QMessageBox.StandardButton.Cancel
)
ret = None
ret = msg.exec_()
while ret is None:
pass
else:
self.__started_row = True
if len(self.rx_msg_list) > 0:
Expand Down

0 comments on commit f2b0f32

Please sign in to comment.