@@ -62,7 +62,7 @@ def processAction(self, msg):
62
62
elif msg ["data" ]["command" ] == "shutdown" :
63
63
if not self .shutdown ():
64
64
self .data .ui_queue1 .put ("Alert" , "Alert" , "Error with shutting down." )
65
- elif self .data .uploadFlag :
65
+ elif self .data .uploadFlag > 0 :
66
66
self .data .ui_queue1 .put ("Alert" , "Alert" , "Cannot issue command while sending gcode." )
67
67
# Commands not allowed during sending gcode.. if you did these commands, something could screw up.
68
68
# If uploadFlag was enabled (see above) then this would never be reached.
@@ -516,11 +516,8 @@ def pauseRun(self):
516
516
self .data .uploadFlag = 0
517
517
self .data .console_queue .put ("Run Paused" )
518
518
self .data .ui_queue1 .put ("Action" , "setAsResume" , "" )
519
- # I don't think this is actually used, but the idea was to be able to make sure the machine returns to
519
+ # The idea was to be able to make sure the machine returns to
520
520
# the correct z-height after a pause in the event the user raised/lowered the bit.
521
- # However, in the resumeRun function, that doesn't occur unless manualZAxisAdjust is set, which only
522
- # occurs when a tool change in issued. So, perhaps we need to add self.data.manualZAxisAdjust enabled
523
- # here as well if that's what we want it to do.
524
521
self .data .pausedzval = self .data .zval
525
522
return True
526
523
except Exception as e :
@@ -537,6 +534,7 @@ def resumeRun(self):
537
534
'''
538
535
try :
539
536
# if a tool change, then...
537
+ print ("at resume run with manualzaxisadjust = " + str (self .data .manualZAxisAdjust ))
540
538
if self .data .manualZAxisAdjust :
541
539
# make sure the units match what they were
542
540
if self .data .pausedUnits != self .data .units :
@@ -547,16 +545,23 @@ def resumeRun(self):
547
545
# move the z-axis back to where it was.
548
546
# note: this does not work correctly in relative mode.
549
547
# Todo: somehow manke this work when controller is in relative mode (G91)
548
+ print ("sending pausedzval equal to " + str (self .data .pausedzval )+ " from resumeRun" )
550
549
self .data .gcode_queue .put ("G0 Z" + str (self .data .pausedzval ) + " " )
551
550
# clear the flag since resume
552
551
self .data .manualZAxisAdjust = False
553
552
# reenable the uploadFlag if it was previous set.
554
- self .data .uploadFlag = self .data .previousUploadStatus ### just moved this here from after if statement
553
+ if self .data .previousUploadStatus == - 1 :
554
+ # if was M command pause, then set to 1
555
+ self .data .uploadFlag = 1
556
+ else :
557
+ self .data .uploadFlag = self .data .previousUploadStatus ### just moved this here from after if statement
555
558
else :
559
+ print ("sending pausedzval equal to " + str (self .data .pausedzval )+ " from resumeRun without manual change" )
560
+ self .data .gcode_queue .put ("G0 Z" + str (self .data .pausedzval ) + " " )
556
561
self .sendGCodePositionUpdate (self .data .gcodeIndex , recalculate = True )
557
562
self .data .uploadFlag = 1
558
563
# send cycle resume command to unpause the machine
559
- # todo: delete this if not needed .
564
+ # needed only if user initiated pause, but doesn't actually cause harm to controller .
560
565
self .data .quick_queue .put ("~" )
561
566
self .data .ui_queue1 .put ("Action" , "setAsPause" , "" )
562
567
return True
@@ -1561,6 +1566,7 @@ def processGCode(self):
1561
1566
self.data.actions.updateSetting("toMM", 0, True) # value = doesn't matter
1562
1567
'''
1563
1568
# move the Z-axis to the safe height
1569
+ print ("moving to safe height as part of processgcode" )
1564
1570
self .data .gcode_queue .put ("G0 Z" + str (round (zAxisSafeHeight , 4 ))+ " " )
1565
1571
# move the sled to the x, y coordinate it is supposed to be.
1566
1572
self .data .gcode_queue .put ("G0 X" + str (round (xpos , 4 ))+ " Y" + str (round (ypos , 4 ))+ " " )
@@ -1577,6 +1583,7 @@ def processGCode(self):
1577
1583
if dwell is not None :
1578
1584
self .data .gcode_queue .put ("G4 " + dwell )
1579
1585
# move the z-axis to where it is supposed to be.
1586
+ print ("moving to where it should be as part of processgcode" )
1580
1587
self .data .gcode_queue .put ("G0 Z" + str (round (zpos , 4 )) + " " )
1581
1588
# finally, put the machine in the appropriate positioning
1582
1589
# I have no idea if this really works for G91 gcode files..
@@ -1747,7 +1754,7 @@ def velocityPIDTestRun(self, command, msg):
1747
1754
1748
1755
:param command:
1749
1756
:param msg:
1750
- :return:
1757
+ :return:
1751
1758
'''
1752
1759
try :
1753
1760
if command == 'stop' :
0 commit comments