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 Mar 9, 2024
1 parent ede9045 commit 517fdf4
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 @@ -144,6 +144,13 @@ def req_init_API6(self, machine_val):
data = self.__driver.send(bytes(data))
self.__ser.write(data)

def quit_API6(self):
"""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, color, flags, line_data):
"""Send a line of data via the serial port.
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 @@ -107,10 +107,7 @@ def hideEvent(self, event):

def reject(self):
# send quitCmd
payload = bytearray()
token = getattr(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 517fdf4

Please sign in to comment.