From: nickthetait Date: Fri, 12 Jun 2015 20:56:18 +0000 (-0600) Subject: Remove a number of incomplete features X-Git-Tag: lulzbot-15.02.1-1.03~3 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=333a72b508288a2eaa9e1eda36d9193b5553c603;p=cura.git Remove a number of incomplete features Pause and pauseAtZ plugin Print one-at-a-time (Mini gantry settings) This reverts 6 commits :'( 23be7ce7fdeb80e624b4bbea88a927eb25dcec01 05bc3664af51b9b66d829a7632a6020b69876ca8 cb4ec4397be394f568b7f5febba1bf69667755db 00aeabfa44c894dff56eda978712f25282458479 b55b9f6730e2359eea0035d11408bb3a9fd746b8 61b9d49e6faec0bf84d718a1e72ed2f5db59855b --- diff --git a/Cura/gui/configWizard.py b/Cura/gui/configWizard.py index 9c91bf8e..026a9583 100644 --- a/Cura/gui/configWizard.py +++ b/Cura/gui/configWizard.py @@ -507,22 +507,12 @@ class MachineSelectPage(InfoPage): profile.putMachineSetting('machine_name', 'LulzBot TAZ 4') profile.putMachineSetting('machine_type', 'lulzbot_TAZ_4') profile.putMachineSetting('serial_baud', '115200') - profile.putMachineSetting('extruder_head_size_min_x', '0.0') - profile.putMachineSetting('extruder_head_size_min_y', '0.0') - profile.putMachineSetting('extruder_head_size_max_x', '0.0') - profile.putMachineSetting('extruder_head_size_max_y', '0.0') - profile.putMachineSetting('extruder_head_size_height', '0.0') elif self.LulzbotTaz5Radio.GetValue(): profile.putMachineSetting('machine_width', '298') profile.putMachineSetting('machine_depth', '275') profile.putMachineSetting('machine_height', '250') profile.putMachineSetting('serial_baud', '115200') # Machine type and name are set in the nozzle select page - profile.putMachineSetting('extruder_head_size_min_x', '0.0') - profile.putMachineSetting('extruder_head_size_min_y', '0.0') - profile.putMachineSetting('extruder_head_size_max_x', '0.0') - profile.putMachineSetting('extruder_head_size_max_y', '0.0') - profile.putMachineSetting('extruder_head_size_height', '0.0') else: profile.putMachineSetting('machine_width', '155') profile.putMachineSetting('machine_depth', '155') @@ -536,9 +526,15 @@ class MachineSelectPage(InfoPage): profile.putMachineSetting('extruder_head_size_min_y', '25') profile.putMachineSetting('extruder_head_size_max_y', '55') profile.putMachineSetting('extruder_head_size_height', '17') + profile.putMachineSetting('machine_center_is_zero', 'False') profile.putMachineSetting('gcode_flavor', 'RepRap (Marlin/Sprinter)') profile.putMachineSetting('has_heated_bed', 'True') + profile.putMachineSetting('extruder_head_size_min_x', '0.0') + profile.putMachineSetting('extruder_head_size_min_y', '0.0') + profile.putMachineSetting('extruder_head_size_max_x', '0.0') + profile.putMachineSetting('extruder_head_size_max_y', '0.0') + profile.putMachineSetting('extruder_head_size_height', '0.0') profile.putPreference('startMode', 'Simple') else: profile.putMachineSetting('machine_width', '80') diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index e3e5eadb..718a028d 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -226,10 +226,7 @@ class printWindowPlugin(wx.Frame): self._printerConnection.openActiveConnection() def script_startPrint(self, data = None): - if self._printerConnection.isPrinting() or self._printerConnection.isPaused(): - self._printerConnection.pause(not self._printerConnection.isPaused()) - else: - self._printerConnection.startPrint() + self._printerConnection.startPrint() def script_cancelPrint(self, e): self._printerConnection.cancelPrint() @@ -300,12 +297,6 @@ class printWindowPlugin(wx.Frame): self._termLog.AppendText(line.encode('utf-8', 'replace')) def _updateButtonStates(self): - hasPauseButton = False - for button in self._buttonList: - if button.command == self.script_pausePrint: - hasPauseButton = True - break - for button in self._buttonList: if button.command == self.script_connect: button.Show(self._printerConnection.hasActiveConnection()) @@ -317,33 +308,15 @@ class printWindowPlugin(wx.Frame): self._printerConnection.isActiveConnectionOpen(): button.Enable(self._printerConnection.isPrinting() or \ self._printerConnection.isPaused()) - if self._printerConnection.isPaused(): - button.SetLabel(_("Resume")) - else: - button.SetLabel(_("Pause")) else: button.Enable(False) elif button.command == self.script_startPrint: - if hasPauseButton or not self._printerConnection.hasPause(): - if not self._printerConnection.hasActiveConnection() or \ - self._printerConnection.isActiveConnectionOpen(): - button.Enable(not self._printerConnection.isPrinting() and \ - not self._printerConnection.isPaused()) - else: - button.Enable(False) + if not self._printerConnection.hasActiveConnection() or \ + self._printerConnection.isActiveConnectionOpen(): + button.Enable(not self._printerConnection.isPrinting() and \ + not self._printerConnection.isPaused()) else: - if not self._printerConnection.hasActiveConnection() or \ - self._printerConnection.isActiveConnectionOpen(): - if self._printerConnection.isPrinting(): - button.SetLabel(_("Pause")) - else: - if self._printerConnection.isPaused(): - button.SetLabel(_("Resume")) - else: - button.SetLabel(_("Print")) - button.Enable(True) - else: - button.Enable(False) + button.Enable(False) elif button.command == self.script_cancelPrint: if not self._printerConnection.hasActiveConnection() or \ self._printerConnection.isActiveConnectionOpen(): diff --git a/Cura/serialCommunication.py b/Cura/serialCommunication.py index 4add5f23..efc6e72d 100644 --- a/Cura/serialCommunication.py +++ b/Cura/serialCommunication.py @@ -68,10 +68,6 @@ class serialComm(object): self._comm.sendCommand(line[1]) elif line[0] == 'START': self._comm.printGCode(self._gcodeList) - elif line[0] == 'PAUSE': - self._comm.setPause(True) - elif line[0] == 'RESUME': - self._comm.setPause(False) else: sys.stderr.write(str(line)) diff --git a/Cura/util/machineCom.py b/Cura/util/machineCom.py index 5fe86611..650452df 100644 --- a/Cura/util/machineCom.py +++ b/Cura/util/machineCom.py @@ -587,7 +587,7 @@ class MachineCom(object): line = line[0] try: if line == 'M0' or line == 'M1': - self.setPause(True) + #self.setPause(True) line = 'M105' #Don't send the M0 or M1 to the machine, as M0 and M1 are handled as an LCD menu pause. if self._printSection in self._feedRateModifier: line = re.sub('F([0-9]*)', lambda m: 'F' + str(int(int(m.group(1)) * self._feedRateModifier[self._printSection])), line) diff --git a/Cura/util/printerConnection/serialConnection.py b/Cura/util/printerConnection/serialConnection.py index 6a2c2548..488507b1 100644 --- a/Cura/util/printerConnection/serialConnection.py +++ b/Cura/util/printerConnection/serialConnection.py @@ -97,7 +97,7 @@ class serialConnection(printerConnectionBase.printerConnectionBase): #Abort the previously loaded print file def cancelPrint(self): - if not self.isPrinting() or self._process is None: + if not self.isPrinting()or self._process is None: return self._process.stdin.write('STOP\n') self._printProgress = 0 @@ -105,19 +105,6 @@ class serialConnection(printerConnectionBase.printerConnectionBase): def isPrinting(self): return self._commState == machineCom.MachineCom.STATE_PRINTING - #Returns true if we have the ability to pause the file printing. - def hasPause(self): - return True - - def isPaused(self): - return self._commState == machineCom.MachineCom.STATE_PAUSED - - #Pause or unpause the printing depending on the value, if supported. - def pause(self, value): - if not (self.isPrinting() or self.isPaused) or self._process is None: - return - self._process.stdin.write('PAUSE\n' if value else "RESUME\n") - #Amount of progression of the current print file. 0.0 to 1.0 def getPrintProgress(self): if len(self._gcodeData) < 1: diff --git a/plugins/PronterfaceUI/script.py b/plugins/PronterfaceUI/script.py index eb317505..705c113a 100644 --- a/plugins/PronterfaceUI/script.py +++ b/plugins/PronterfaceUI/script.py @@ -50,7 +50,7 @@ addProgressbar(255, 200, 200) addButton(0, 255, 255, 'Connect', connect) addButton(0, 240, 255, 'Print', startPrint) -#addButton(0, 220, 255, 'Pause', pausePrint) +addButton(0, 220, 255, 'Pause', pausePrint) addButton(0, 200, 255, 'Cancel', cancelPrint) addButton(0, 180, 255, 'Error log', showErrorLog) addButton(0, 160, 255, "Motors Off", sendGCode, "M18;") diff --git a/plugins/pauseAtZ.py b/plugins/pauseAtZ.py deleted file mode 100644 index 4a01bb91..00000000 --- a/plugins/pauseAtZ.py +++ /dev/null @@ -1,125 +0,0 @@ -#Name: Pause at height -#Info: Pause the printer at a certain height -#Depend: GCode -#Type: postprocess -#Param: pauseLevel(float:5.0) Pause height (mm) -#Param: parkX(float:0) Head park X (mm) -#Param: parkY(float:0) Head park Y (mm) -#Param: moveZ(float:10) Head move Z (mm) -#Param: retractAmount(float:5) Retraction amount (mm) - -__copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License" -import re -from Cura.util import profile - -def getPrintZValue(lineBlock): - ''' - look for the last z value found just before (or at the same time) G1 code in the given block - ''' - lastZ = -1 - for line in lineBlock: - lastZ = getValue(line, 'Z', lastZ) - if line.startswith('G1 ') and (getValue(line, 'X', None) is not None or getValue(line, 'Y', None) is not None): - break - - return lastZ - - -def getValue(line, key, default = None): - if not key in line or (';' in line and line.find(key) > line.find(';')): - return default - subPart = line[line.find(key) + 1:] - m = re.search('^[0-9]+\.?[0-9]*', subPart) - if m is None: - return default - try: - return float(m.group(0)) - except: - return default - -with open(filename, "r") as f: - lines = f.readlines() - -z = 0. -x = 0. -y = 0. -pauseState = 0 -#state 0 system is not active until we get to a smaller layer than the last encountered layer (default at 99999) (print one at a time support.) -#state 1 system is active and we are looking for our target layer z -#state 2 system found the layer it need to write. We will wait for the first G1 or G0 code to write the content just before. state will be set to 0 - - -with open(filename, "w") as f: - lineIndex = 0 - lastLayerIndex = 99999 - layerZ = 0 - for lIndex in xrange(len(lines)): - line = lines[lIndex] - if line.startswith(';'): - if line.startswith(';LAYER:'): - currentLayer = int(line[7:].strip()) - - if currentLayer < lastLayerIndex: - pauseState = 1 - - lastLayerIndex = currentLayer - if pauseState == 1: - layerZ = getPrintZValue(lines[lIndex:lIndex+20]) - if layerZ >= pauseLevel: - pauseState = 2 - - f.write(line) - continue - - x = getValue(line, 'X', x) - y = getValue(line, 'Y', y) - - if pauseState == 2: - g = getValue(line, 'G', None) - if g == 1 or g == 0:# We will do the pause just before printing content. We need to pause from the previous XY position. Not the current. - z = layerZ - - pauseState = 0 - f.write(";TYPE:CUSTOM\n") - #Retract - f.write("M83\n") - f.write("G1 E-%f F6000\n" % (retractAmount)) - - zChanged = False - #Change z before doing the move because the nozzle can hit the glass lock on the UM2 - if z + moveZ < 15: - zChanged = True - f.write("G1 Z15 F300\n") - - elif moveZ > 0: - newZ = z + moveZ - maxZ = profile.getMachineSettingFloat('machine_height') - 10 #For Safety Leave a 10mm space (endstop) - if maxZ < newZ: - newZ = maxZ - - if newZ > z: - zChanged = True - f.write("G1 Z%f F300\n" % (newZ)) - - #Move the head away - f.write("G1 X%f Y%f F9000\n" % (parkX, parkY)) - - #Disable the E steppers - f.write("M84 E0\n") - #Wait till the user continues printing - f.write("M0\n") - #Push the filament back, and retract again, the properly primes the nozzle when changing filament. - f.write("G1 E%f F6000\n" % (retractAmount)) - f.write("G1 E-%f F6000\n" % (retractAmount)) - - #Move the head back. Move Z at the same time to prevent hitting the glass locks on the UM2 - if zChanged : - f.write("G1 X%f Y%f Z%f F9000\n" % (x, y, z)) - else: - f.write("G1 X%f Y%f F9000\n" % (x, y)) - - f.write("G1 E%f F6000\n" % (retractAmount)) - f.write("G1 F9000\n") - f.write("M82\n") - - f.write(line)