Skip to content

Commit

Permalink
Add Quit command to APIv6
Browse files Browse the repository at this point in the history
  • Loading branch information
t0mpr1c3 committed Apr 15, 2024
1 parent 5f5273f commit c1b2969
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 7 additions & 0 deletions src/main/python/ayab/engine/communication.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,13 @@ def req_init_API6(self, machine: Machine) -> None:
data = self.__driver.send(bytes(data))
self.__ser.write(data)

def quit_API6(self) -> None:
"""Send a quit message to the device."""
data = bytearray()
data.append(Token.quitCmd.value)
data = self.__driver.send(bytes(data))
self.__ser.write(data)

def cnf_line_API6(
self, line_number: int, color: int, flags: int, line_data: bytes
) -> None:
Expand Down
5 changes: 1 addition & 4 deletions src/main/python/ayab/hw_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ def hideEvent(self, event):

def reject(self):
# send quitCmd
payload = bytearray()
token = Token.quitCmd.value
payload.append(token)
self.__control.com.write_API6(payload)
self.__control.com.quit_API6()
self.__control.state = State.FINISHED
# reset dialog
self._auto_button.setChecked(False)
Expand Down

0 comments on commit c1b2969

Please sign in to comment.