From: daid Date: Fri, 23 Aug 2013 13:47:14 +0000 (+0200) Subject: Make the platform 10mm smaller if you have dual extrusion, else you hit the screws... X-Git-Tag: 13.10~90 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=3e05699f352b6d05e7848400a5c96eabfbca19d9;p=cura.git Make the platform 10mm smaller if you have dual extrusion, else you hit the screws on the backside of the platform. Do not load the UM platform mesh unless you have an ultimaker. --- diff --git a/Cura/gui/configWizard.py b/Cura/gui/configWizard.py index 42a11b40..1bafbeac 100644 --- a/Cura/gui/configWizard.py +++ b/Cura/gui/configWizard.py @@ -326,6 +326,7 @@ class SelectParts(InfoPage): profile.putPreference('has_heated_bed', str(self.heatedBed.GetValue())) if self.dualExtrusion.GetValue(): profile.putPreference('extruder_amount', '2') + profile.putPreference('machine_depth', '195') else: profile.putPreference('extruder_amount', '1') if profile.getPreference('ultimaker_extruder_upgrade') == 'True': diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index ad23c3c6..4081aa32 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -369,7 +369,7 @@ class mainWindow(wx.Frame): firmwareInstall.InstallFirmware() def OnCustomFirmware(self, e): - if profile.getPreference('machine_type') == 'ultimaker': + if profile.getPreference('machine_type').startswith('ultimaker'): wx.MessageBox('Warning: Installing a custom firmware does not guarantee that you machine will function correctly, and could damage your machine.', 'Firmware update', wx.OK | wx.ICON_EXCLAMATION) dlg=wx.FileDialog(self, "Open firmware to upload", os.path.split(profile.getPreference('lastFile'))[0], style=wx.FD_OPEN|wx.FD_FILE_MUST_EXIST) dlg.SetWildcard("HEX file (*.hex)|*.hex;*.HEX") diff --git a/Cura/gui/sceneView.py b/Cura/gui/sceneView.py index 5b59e78a..e3b527a3 100644 --- a/Cura/gui/sceneView.py +++ b/Cura/gui/sceneView.py @@ -51,8 +51,7 @@ class SceneView(openglGui.glGuiPanel): self._viewTarget = numpy.array([0,0,0], numpy.float32) self._animView = None self._animZoom = None - self._platformMesh = meshLoader.loadMeshes(resources.getPathForMesh('ultimaker_platform.stl'))[0] - self._platformMesh._drawOffset = numpy.array([0,0,2.5], numpy.float32) + self._platformMesh = None self._isSimpleMode = True self._usbPrintMonitor = printWindow.printProcessMonitor(lambda : self._queueRefresh()) @@ -104,7 +103,7 @@ class SceneView(openglGui.glGuiPanel): self.viewSelection = openglGui.glComboButton(self, 'View mode', [7,19,11,15,23], ['Normal', 'Overhang', 'Transparent', 'X-Ray', 'Layers'], (-1,0), self.OnViewChange) self.layerSelect = openglGui.glSlider(self, 10000, 0, 1, (-1,-2), lambda : self.QueueRefresh()) - self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine upload', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self)) + self.youMagineButton = openglGui.glButton(self, 26, 'YouMagine upload', (2,0), lambda button: youmagineGui.youmagineManager(self.GetTopLevelParent(), self._scene)) self.notification = openglGui.glNotification(self, (0, 0)) @@ -1140,7 +1139,10 @@ void main(void) size = [profile.getPreferenceFloat('machine_width'), profile.getPreferenceFloat('machine_depth'), profile.getPreferenceFloat('machine_height')] - if profile.getPreference('machine_type') == 'ultimaker': + if profile.getPreference('machine_type').startswith('ultimaker'): + if self._platformMesh is None: + self._platformMesh = meshLoader.loadMeshes(resources.getPathForMesh('ultimaker_platform.stl'))[0] + self._platformMesh._drawOffset = numpy.array([0,0,2.5], numpy.float32) glColor4f(1,1,1,0.5) self._objectShader.bind() self._renderObject(self._platformMesh, False, False) diff --git a/Cura/util/sliceEngine.py b/Cura/util/sliceEngine.py index 2c4758b7..4c834e6a 100644 --- a/Cura/util/sliceEngine.py +++ b/Cura/util/sliceEngine.py @@ -209,6 +209,9 @@ class Slicer(object): self._printTimeSeconds = int(line.split(':')[1].strip()) elif line.startswith('Filament:'): self._filamentMM = int(line.split(':')[1].strip()) + if profile.getPreference('gcode_flavor') == 'UltiGCode': + radius = profile.getProfileSettingFloat('filament_diameter') / 2.0 + self._filamentMM /= (math.pi * radius * radius) else: self._sliceLog.append(line.strip()) line = self._process.stdout.readline()