Commit 068d0636 authored by Guillaume Seguin's avatar Guillaume Seguin

Rename "skein" variables and commands to "slice"

parent 959fb1a7
...@@ -1128,7 +1128,7 @@ class pronsole(cmd.Cmd): ...@@ -1128,7 +1128,7 @@ class pronsole(cmd.Cmd):
def help_load(self): def help_load(self):
self.log("Loads a gcode file (with tab-completion)") self.log("Loads a gcode file (with tab-completion)")
def do_skein(self, l): def do_slice(self, l):
l = l.split() l = l.split()
if len(l) == 0: if len(l) == 0:
self.logError(_("No file name given.")) self.logError(_("No file name given."))
...@@ -1160,7 +1160,7 @@ class pronsole(cmd.Cmd): ...@@ -1160,7 +1160,7 @@ class pronsole(cmd.Cmd):
except Exception, e: except Exception, e:
self.logError(_("Slicing failed: %s") % e) self.logError(_("Slicing failed: %s") % e)
def complete_skein(self, text, line, begidx, endidx): def complete_slice(self, text, line, begidx, endidx):
s = line.split() s = line.split()
if len(s) > 2: if len(s) > 2:
return [] return []
...@@ -1170,11 +1170,11 @@ class pronsole(cmd.Cmd): ...@@ -1170,11 +1170,11 @@ class pronsole(cmd.Cmd):
else: else:
return glob.glob("*/") + glob.glob("*.stl") return glob.glob("*/") + glob.glob("*.stl")
def help_skein(self): def help_slice(self):
self.log(_("Creates a gcode file from an stl model using the slicer (with tab-completion)")) self.log(_("Creates a gcode file from an stl model using the slicer (with tab-completion)"))
self.log(_("skein filename.stl - create gcode file")) self.log(_("slice filename.stl - create gcode file"))
self.log(_("skein filename.stl view - create gcode file and view using skeiniso")) self.log(_("slice filename.stl view - create gcode file and view using skeiniso (if using skeinforge)"))
self.log(_("skein set - adjust slicer settings")) self.log(_("slice set - adjust slicer settings"))
## -------------------------------------------------------------- ## --------------------------------------------------------------
## Print/upload handling ## Print/upload handling
......
...@@ -139,7 +139,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -139,7 +139,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.m105_waitcycles = 0 self.m105_waitcycles = 0
self.fgcode = None self.fgcode = None
self.excluder = None self.excluder = None
self.skeinp = None self.slicep = None
self.monitor_interval = 3 self.monitor_interval = 3
self.current_pos = [0, 0, 0] self.current_pos = [0, 0, 0]
self.paused = False self.paused = False
...@@ -210,7 +210,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -210,7 +210,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.t = Tee(self.catchprint) self.t = Tee(self.catchprint)
self.stdout = sys.stdout self.stdout = sys.stdout
self.skeining = 0 self.slicing = 0
self.mini = False self.mini = False
self.p.sendcb = self.sentcb self.p.sendcb = self.sentcb
self.p.preprintsendcb = self.preprintsendcb self.p.preprintsendcb = self.preprintsendcb
...@@ -703,7 +703,7 @@ class PronterWindow(MainWindow, pronsole.pronsole): ...@@ -703,7 +703,7 @@ class PronterWindow(MainWindow, pronsole.pronsole):
self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, _("<&New...>"))) self.Bind(wx.EVT_MENU, self.new_macro, self.macros_menu.Append(-1, _("<&New...>")))
self.Bind(wx.EVT_MENU, lambda *e: PronterOptions(self), m.Append(-1, _("&Options"), _(" Options dialog"))) self.Bind(wx.EVT_MENU, lambda *e: PronterOptions(self), m.Append(-1, _("&Options"), _(" Options dialog")))
self.Bind(wx.EVT_MENU, lambda x: threading.Thread(target = lambda: self.do_skein("set")).start(), m.Append(-1, _("Slicing settings"), _(" Adjust slicing settings"))) self.Bind(wx.EVT_MENU, lambda x: threading.Thread(target = lambda: self.do_slice("set")).start(), m.Append(-1, _("Slicing settings"), _(" Adjust slicing settings")))
mItem = m.AppendCheckItem(-1, _("Debug communications"), mItem = m.AppendCheckItem(-1, _("Debug communications"),
_("Print all G-code sent to and received from the printer.")) _("Print all G-code sent to and received from the printer."))
...@@ -1215,7 +1215,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1215,7 +1215,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
filename = filename.replace(ext.upper(), suffix) filename = filename.replace(ext.upper(), suffix)
return filename return filename
def skein_func(self): def slice_func(self):
try: try:
output_filename = self.model_to_gcode_filename(self.filename) output_filename = self.model_to_gcode_filename(self.filename)
pararray = prepare_command(self.settings.slicecommand, pararray = prepare_command(self.settings.slicecommand,
...@@ -1226,19 +1226,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1226,19 +1226,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
fpath = os.path.join(self.slic3r_configpath, cat, config) fpath = os.path.join(self.slic3r_configpath, cat, config)
pararray += ["--load", fpath] pararray += ["--load", fpath]
print _("Slicing ") + " ".join(pararray) print _("Slicing ") + " ".join(pararray)
self.skeinp = subprocess.Popen(pararray, stderr = subprocess.STDOUT, stdout = subprocess.PIPE) self.slicep = subprocess.Popen(pararray, stderr = subprocess.STDOUT, stdout = subprocess.PIPE)
while True: while True:
o = self.skeinp.stdout.read(1) o = self.slicep.stdout.read(1)
if o == '' and self.skeinp.poll() is not None: break if o == '' and self.slicep.poll() is not None: break
sys.stdout.write(o) sys.stdout.write(o)
self.skeinp.wait() self.slicep.wait()
self.stopsf = 1 self.stopsf = 1
except: except:
logging.error(_("Failed to execute slicing software: ")) logging.error(_("Failed to execute slicing software: "))
self.stopsf = 1 self.stopsf = 1
traceback.print_exc(file = sys.stdout) traceback.print_exc(file = sys.stdout)
def skein_monitor(self): def slice_monitor(self):
while not self.stopsf: while not self.stopsf:
try: try:
wx.CallAfter(self.statusbar.SetStatusText, _("Slicing...")) # +self.cout.getvalue().split("\n")[-1]) wx.CallAfter(self.statusbar.SetStatusText, _("Slicing...")) # +self.cout.getvalue().split("\n")[-1])
...@@ -1250,19 +1250,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1250,19 +1250,19 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.load_gcode_async(self.model_to_gcode_filename(self.filename)) self.load_gcode_async(self.model_to_gcode_filename(self.filename))
except: except:
self.filename = fn self.filename = fn
self.skeining = 0 self.slicing = 0
self.skeinp = None self.slicep = None
def skein(self, filename): def slice(self, filename):
wx.CallAfter(self.loadbtn.SetLabel, _("Cancel")) wx.CallAfter(self.loadbtn.SetLabel, _("Cancel"))
wx.CallAfter(self.toolbarsizer.Layout) wx.CallAfter(self.toolbarsizer.Layout)
print _("Slicing ") + filename print _("Slicing ") + filename
self.cout = StringIO.StringIO() self.cout = StringIO.StringIO()
self.filename = filename self.filename = filename
self.stopsf = 0 self.stopsf = 0
self.skeining = 1 self.slicing = 1
threading.Thread(target = self.skein_func).start() threading.Thread(target = self.slice_func).start()
threading.Thread(target = self.skein_monitor).start() threading.Thread(target = self.slice_monitor).start()
def cmdline_filename_callback(self, filename): def cmdline_filename_callback(self, filename):
# Do nothing when processing a filename from command line, as we'll # Do nothing when processing a filename from command line, as we'll
...@@ -1270,7 +1270,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1270,7 +1270,7 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.filename = filename self.filename = filename
def do_load(self, l): def do_load(self, l):
if hasattr(self, 'skeining'): if hasattr(self, 'slicing'):
self.loadfile(None, l) self.loadfile(None, l)
else: else:
self._do_load(l) self._do_load(l)
...@@ -1281,8 +1281,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1281,8 +1281,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.loadfile(None, filename = path) self.loadfile(None, filename = path)
def loadfile(self, event, filename = None): def loadfile(self, event, filename = None):
if self.skeining and self.skeinp is not None: if self.slicing and self.slicep is not None:
self.skeinp.terminate() self.slicep.terminate()
return return
basedir = self.settings.last_file_path basedir = self.settings.last_file_path
if not os.path.exists(basedir): if not os.path.exists(basedir):
...@@ -1325,8 +1325,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>.""" ...@@ -1325,8 +1325,8 @@ Printrun. If not, see <http://www.gnu.org/licenses/>."""
self.logError(_("Could not update recent files list:") + self.logError(_("Could not update recent files list:") +
"\n" + traceback.format_exc()) "\n" + traceback.format_exc())
if name.lower().endswith(".stl") or name.lower().endswith(".obj"): if name.lower().endswith(".stl") or name.lower().endswith(".obj"):
self.skein(name) self.slice(name)
self.skein(name) self.slice(name)
else: else:
self.load_gcode_async(name) self.load_gcode_async(name)
else: else:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment