Skip to content

Commit

Permalink
p/pronterface: Adapt to new princtore callbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
rockstorm101 committed Mar 8, 2025
1 parent 2bc94c3 commit ae69afe
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions printrun/pronterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,11 @@ def __init__(self, app, filename = None, size = winsize):
self.loading_gcode = False
self.loading_gcode_message = ""
self.mini = False
self.p.sendcb = self.sentcb
self.p.preprintsendcb = self.preprintsendcb
self.p.printsendcb = self.printsentcb
self.p.startcb = self.startcb
self.p.endcb = self.endcb
self.p.callback.send = self.sentcb
self.p.callback.printpresend = self.preprintsendcb
self.p.callback.printsend = self.printsentcb
self.p.callback.start = self.startcb
self.p.callback.end = self.endcb
self.cur_button = None
self.predisconnect_mainqueue = None
self.predisconnect_queueindex = None
Expand Down Expand Up @@ -381,7 +381,7 @@ def kill(self, e=None):
pronsole.pronsole.kill(self)
global pronterface_quitting
pronterface_quitting = True
self.p.recvcb = None
self.p.callback.recv = None
self.p.disconnect()
if hasattr(self, "feedrates_changed"):
self.save_in_rc("set xy_feedrate", "set xy_feedrate %d" % self.settings.xy_feedrate)
Expand Down Expand Up @@ -1440,7 +1440,7 @@ def uploadtrigger(self, l):
if "Writing to file" in l:
self.uploading = True
self.p.startprint(self.fgcode)
self.p.endcb = self.endupload
self.p.callback.end = self.endupload
self.recvlisteners.remove(self.uploadtrigger)
elif "open failed, File" in l:
self.recvlisteners.remove(self.uploadtrigger)
Expand Down Expand Up @@ -1918,7 +1918,7 @@ def is_excluded_move(self, gline):
return True
return False

def preprintsendcb(self, gline, next_gline):
def preprintsendcb(self, gline, next_gline, index):
"""Callback when a printer gcode is about to be sent. We use it to
exclude moves defined by the part excluder tool"""
if not self.is_excluded_move(gline):
Expand Down

0 comments on commit ae69afe

Please sign in to comment.