chiark / gitweb /
Add option to save profile when slicing
authordaid <daid303@gmail.com>
Thu, 12 Apr 2012 11:58:19 +0000 (13:58 +0200)
committerdaid <daid303@gmail.com>
Thu, 12 Apr 2012 11:58:19 +0000 (13:58 +0200)
Cura/gui/preferencesDialog.py
Cura/gui/sliceProgessPanel.py
Cura/util/profile.py

index 782ee338667782238b859967d4c79b31b0a3c06d..9280505bb652ad0cb43600401586c62ecb8c80f1 100644 (file)
@@ -35,6 +35,7 @@ class preferencesDialog(configBase.configWindowBase):
 \r
                configBase.TitleRow(left, 'Slicer settings')\r
                c = configBase.SettingRow(left, 'Slicer selection', 'slicer', ['Cura (Skeinforge based)', 'Slic3r'], 'Which slicer to use to slice objects. Usually the Cura engine produces the best results. But Slic3r is developing fast and is faster with slicing.', type = 'preference')\r
+               c = configBase.SettingRow(left, 'Save profile on slice', 'save_profile', False, 'When slicing save the profile as [stl_file]_profile.ini next to the model.', type = 'preference')\r
                \r
                self.MakeModal(True)\r
                main.Fit()\r
index 577b55454c278a705c23dfbfae2758bd31cdc357..6fab8c4d49377cccd149a0e4437d5536951fe4ab 100644 (file)
@@ -8,6 +8,7 @@ import threading
 import subprocess
 import time
 
+from util import profile
 from util import sliceRun
 
 class sliceProgessPanel(wx.Panel):
@@ -58,6 +59,8 @@ class sliceProgessPanel(wx.Panel):
                self.prevStep = 'start'
                self.totalDoneFactor = 0.0
                self.startTime = time.time()
+               if profile.getPreference('save_profile') == 'True':
+                       profile.saveGlobalProfile(self.filename[: self.filename.rfind('.')] + "_profile.ini")
                p = subprocess.Popen(sliceRun.getSliceCommand(self.filename), stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
                self.thread = WorkerThread(self, filename, p)
        
index bfa84f975a48040a6e54b59f983a76e32543c192..b1bbccf84131cbf1c828cf4e107ca32c623c2f01 100644 (file)
@@ -79,6 +79,7 @@ preferencesDefaultSettings = {
        'serial_port': 'AUTO',\r
        'serial_baud': '250000',\r
        'slicer': 'Cura (Skeinforge based)',\r
+       'save_profile': 'False',\r
 }\r
 \r
 def getDefaultProfilePath():\r