From 2d10cb47f489221d0138fab1e6d05f6acba2b51b Mon Sep 17 00:00:00 2001 From: daid Date: Thu, 12 Apr 2012 13:58:19 +0200 Subject: [PATCH] Add option to save profile when slicing --- Cura/gui/preferencesDialog.py | 1 + Cura/gui/sliceProgessPanel.py | 3 +++ Cura/util/profile.py | 1 + 3 files changed, 5 insertions(+) diff --git a/Cura/gui/preferencesDialog.py b/Cura/gui/preferencesDialog.py index 782ee338..9280505b 100644 --- a/Cura/gui/preferencesDialog.py +++ b/Cura/gui/preferencesDialog.py @@ -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() diff --git a/Cura/gui/sliceProgessPanel.py b/Cura/gui/sliceProgessPanel.py index 577b5545..6fab8c4d 100644 --- a/Cura/gui/sliceProgessPanel.py +++ b/Cura/gui/sliceProgessPanel.py @@ -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) diff --git a/Cura/util/profile.py b/Cura/util/profile.py index bfa84f97..b1bbccf8 100644 --- a/Cura/util/profile.py +++ b/Cura/util/profile.py @@ -79,6 +79,7 @@ preferencesDefaultSettings = { 'serial_port': 'AUTO', 'serial_baud': '250000', 'slicer': 'Cura (Skeinforge based)', + 'save_profile': 'False', } def getDefaultProfilePath(): -- 2.30.2