Add option to save profile when slicing

This commit is contained in:
daid 2012-04-12 13:58:19 +02:00
parent b71180bb47
commit 2d10cb47f4
3 changed files with 5 additions and 0 deletions

View File

@ -35,6 +35,7 @@ class preferencesDialog(configBase.configWindowBase):
configBase.TitleRow(left, 'Slicer settings')
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')
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')
self.MakeModal(True)
main.Fit()

View 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)

View File

@ -79,6 +79,7 @@ preferencesDefaultSettings = {
'serial_port': 'AUTO',
'serial_baud': '250000',
'slicer': 'Cura (Skeinforge based)',
'save_profile': 'False',
}
def getDefaultProfilePath():