Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: Cura/gui/mainWindow.py
- ===================================================================
- --- Cura/gui/mainWindow.py (revision 2208)
- +++ Cura/gui/mainWindow.py (working copy)
- @@ -115,6 +115,10 @@
- self.profileFileHistory.UseMenu(profileHistoryMenu)
- self.profileFileHistory.AddFilesToMenu()
- self.Bind(wx.EVT_MENU_RANGE, self.OnProfileMRU, id=self.ID_MRU_PROFILE1, id2=self.ID_MRU_PROFILE10)
- +
- + self.fileMenu.AppendSeparator()
- + i = self.fileMenu.Append(-1, _("Start Toolpath Computation\tCTRL+T"))
- + self.Bind(wx.EVT_MENU, self.onToolpathStart, i)
- self.fileMenu.AppendSeparator()
- i = self.fileMenu.Append(wx.ID_EXIT, _("Quit"))
- @@ -336,7 +340,10 @@
- self.headOffsetWizardMenuItem.Enable(False)
- self.scene.updateProfileToControls()
- self.scene._scene.pushFree()
- -
- +
- + def onToolpathStart(self, e):
- + self.scene.updateSceneAndRunEngine()
- +
- def onOneAtATimeSwitch(self, e):
- profile.putPreference('oneAtATime', self.oneAtATime.IsChecked())
- if self.oneAtATime.IsChecked() and profile.getMachineSettingFloat('extruder_head_size_height') < 1:
- Index: Cura/gui/preferencesDialog.py
- ===================================================================
- --- Cura/gui/preferencesDialog.py (revision 2208)
- +++ Cura/gui/preferencesDialog.py (working copy)
- @@ -51,6 +51,7 @@
- configBase.SettingRow(right, 'auto_detect_sd')
- configBase.SettingRow(right, 'check_for_updates')
- configBase.SettingRow(right, 'submit_slice_information')
- + configBase.SettingRow(right, 'automatic_slicing')
- self.okButton = wx.Button(right, -1, 'Ok')
- right.GetSizer().Add(self.okButton, (right.GetSizer().GetRows(), 0), flag=wx.BOTTOM, border=5)
- Index: Cura/gui/sceneView.py
- ===================================================================
- --- Cura/gui/sceneView.py (revision 2211)
- +++ Cura/gui/sceneView.py (working copy)
- @@ -35,6 +35,8 @@
- class SceneView(openglGui.glGuiPanel):
- def __init__(self, parent):
- super(SceneView, self).__init__(parent)
- +
- + self.layersDirty = True
- self._yaw = 30
- self._pitch = 60
- @@ -386,6 +388,11 @@
- def OnViewChange(self):
- if self.viewSelection.getValue() == 4:
- + if self.layersDirty and profile.getPreference('automatic_slicing') != 'True':
- + #ensure that we will eventually have some gcode to display in the layer view
- + self.updateSceneAndRunEngine()
- + threading.Timer(0.1, self.OnViewChange).start()
- + return
- self.viewMode = 'gcode'
- self.tool = previewTools.toolNone(self)
- elif self.viewSelection.getValue() == 1:
- @@ -542,17 +549,44 @@
- self.sceneUpdated()
- def sceneUpdated(self):
- + if profile.getPreference('automatic_slicing') == 'True':
- + self._sceneUpdated()
- + else:
- + self.layersDirty = True
- +
- + def _sceneUpdated(self):
- self._sceneUpdateTimer.Start(500, True)
- self._engine.abortEngine()
- self._scene.updateSizeOffsets()
- self.QueueRefresh()
- def _onRunEngine(self, e):
- + if profile.getPreference('automatic_slicing') == 'True':
- + self.__onRunEngine(e)
- +
- + def __onRunEngine(self, e):
- if self._isSimpleMode:
- self.GetTopLevelParent().simpleSettingsPanel.setupSlice()
- self._engine.runEngine(self._scene)
- if self._isSimpleMode:
- profile.resetTempOverride()
- +
- + #clear flag
- + self.layersDirty = False
- +
- + #used when toolpath generation is set to 'Manual' mode
- + def updateSceneAndRunEngine(self):
- + #redraw printables
- + for printable in _scene.objects():
- + if printable.requiresRedraw:
- + printable.redraw()
- +
- + #update scene
- + self._sceneUpdated()
- +
- + #run engine
- + self.__onRunEngine(None)
- +
- def _updateEngineProgress(self, progressValue):
- result = self._engine.getResult()
- Index: Cura/util/printableObject.py
- ===================================================================
- --- Cura/util/printableObject.py (revision 2208)
- +++ Cura/util/printableObject.py (working copy)
- @@ -13,6 +13,7 @@
- numpy.seterr(all='ignore')
- from Cura.util import polygon
- +from Cura.util import profile
- class printableObject(object):
- """
- @@ -47,6 +48,9 @@
- self._headAreaMinHull = None
- self._loadAnim = None
- +
- + self.requiresRedraw = True
- + self.hasModel = False
- def copy(self):
- ret = printableObject(self._originFilename)
- @@ -90,6 +94,15 @@
- self.processMatrix()
- def processMatrix(self):
- + if profile.getPreference('automatic_slicing') == 'True' or not self.hasModel:
- + self._processMatrix()
- + else:
- + self.requiresRedraw = True
- +
- + def redraw(self):
- + self._processMatrix()
- +
- + def _processMatrix(self):
- self._transformedMin = numpy.array([999999999999,999999999999,999999999999], numpy.float64)
- self._transformedMax = numpy.array([-999999999999,-999999999999,-999999999999], numpy.float64)
- self._boundaryCircleSize = 0
- @@ -118,6 +131,9 @@
- self._boundaryHull = polygon.minkowskiHull((hull.astype(numpy.float32) - self._drawOffset[0:2]), numpy.array([[-1,-1],[-1,1],[1,1],[1,-1]],numpy.float32))
- self._printAreaHull = polygon.minkowskiHull(self._boundaryHull, self._printAreaExtend)
- self.setHeadArea(self._headAreaExtend, self._headMinSize)
- +
- + self.requiresRedraw = False
- + self.hasModel = True
- def getName(self):
- return self._name
- Index: Cura/util/profile.py
- ===================================================================
- --- Cura/util/profile.py (revision 2208)
- +++ Cura/util/profile.py (working copy)
- @@ -473,6 +473,7 @@
- setting('auto_detect_sd', 'True', bool, 'preference', 'hidden').setLabel(_("Auto detect SD card drive"), _("Auto detect the SD card. You can disable this because on some systems external hard-drives or USB sticks are detected as SD card."))
- setting('check_for_updates', 'True', bool, 'preference', 'hidden').setLabel(_("Check for updates"), _("Check for newer versions of Cura on startup"))
- setting('submit_slice_information', 'False', bool, 'preference', 'hidden').setLabel(_("Send usage statistics"), _("Submit anonymous usage information to improve future versions of Cura"))
- +setting('automatic_slicing', 'True', bool, 'preference', 'hidden').setLabel(_("Automatic slicing"), _("Automatically compute a new toolpath whenever settings are changed; if you disable this option you will need to manually start toolpath computation using 'File -> Start Toolpath Computation' or by pressing 'CTRL+T'."))
- setting('youmagine_token', '', str, 'preference', 'hidden')
- setting('filament_physical_density', '1240', float, 'preference', 'hidden').setRange(500.0, 3000.0).setLabel(_("Density (kg/m3)"), _("Weight of the filament per m3. Around 1240 for PLA. And around 1040 for ABS. This value is used to estimate the weight if the filament used for the print."))
- setting('language', 'English', str, 'preference', 'hidden').setLabel(_('Language'), _('Change the language in which Cura runs. Switching language requires a restart of Cura'))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement