diff --git a/Cura/alterations/nextobject.gcode b/Cura/alterations/nextobject.gcode index e32a40d9..b8c55e0e 100644 --- a/Cura/alterations/nextobject.gcode +++ b/Cura/alterations/nextobject.gcode @@ -4,5 +4,6 @@ G1 Z{clear_z} E-5 F{max_z_speed} G92 E0 G1 X{machine_center_x} Y{machine_center_y} F{travel_speed} G1 F200 E7.5 +G92 E0 G1 Z0 F{max_z_speed} diff --git a/Cura/gui/mainWindow.py b/Cura/gui/mainWindow.py index fd5ded49..c9ad00db 100644 --- a/Cura/gui/mainWindow.py +++ b/Cura/gui/mainWindow.py @@ -14,6 +14,7 @@ from gui import configWizard from gui import machineCom from gui import printWindow from gui import simpleMode +from gui import projectPlanner from gui import icon from util import profile from util import version @@ -50,6 +51,9 @@ class mainWindow(configBase.configWindowBase): i = fileMenu.Append(-1, 'Preferences...') self.Bind(wx.EVT_MENU, self.OnPreferences, i) fileMenu.AppendSeparator() + i = fileMenu.Append(-1, 'Open project planner...') + self.Bind(wx.EVT_MENU, self.OnProjectPlanner, i) + fileMenu.AppendSeparator() i = fileMenu.Append(wx.ID_EXIT, 'Quit') self.Bind(wx.EVT_MENU, self.OnQuit, i) menubar.Append(fileMenu, '&File') @@ -296,6 +300,11 @@ class mainWindow(configBase.configWindowBase): ecw = expertConfig.expertConfigWindow() ecw.Centre() ecw.Show(True) + + def OnProjectPlanner(self, e): + pp = projectPlanner.projectPlanner() + pp.Centre() + pp.Show(True) def removeSliceProgress(self, spp): self.progressPanelList.remove(spp) diff --git a/Cura/gui/printWindow.py b/Cura/gui/printWindow.py index 96538271..195b5942 100644 --- a/Cura/gui/printWindow.py +++ b/Cura/gui/printWindow.py @@ -1,7 +1,8 @@ from __future__ import absolute_import import __init__ -import wx, threading, re, subprocess, sys +import wx, threading, re, subprocess, sys, os +from wx.lib import buttons from gui import machineCom from gui import icon @@ -50,6 +51,23 @@ class printProcessMonitor(): self.handle = None self.thread = None +class PrintCommandButton(buttons.GenBitmapButton): + def __init__(self, parent, command, bitmapFilename, size=(20,20)): + self.bitmap = wx.Bitmap(os.path.join(os.path.split(__file__)[0], "../images", bitmapFilename)) + super(PrintCommandButton, self).__init__(parent.directControlPanel, -1, self.bitmap, size=size) + + self.command = command + self.parent = parent + + self.SetBezelWidth(1) + self.SetUseFocusIndicator(False) + + self.Bind(wx.EVT_BUTTON, self.OnClick) + + def OnClick(self, e): + self.parent.sendCommand(self.command) + e.Skip() + class printWindow(wx.Frame): "Main user interface window" def __init__(self): @@ -95,9 +113,38 @@ class printWindow(wx.Frame): self.sizer.Add(self.printButton, pos=(2,1)) self.sizer.Add(self.cancelButton, pos=(3,1)) self.sizer.Add(self.progress, pos=(4,0), span=(1,2), flag=wx.EXPAND) - + self.sizer.Add(wx.StaticText(self.panel, -1, "Temp:"), pos=(0,3)) self.sizer.Add(self.temperatureSelect, pos=(0,4)) + + self.directControlPanel = wx.Panel(self.panel) + self.sizer.Add(self.directControlPanel, pos=(1,3), span=(5,4)) + + sizer = wx.GridBagSizer(2, 2) + self.directControlPanel.SetSizer(sizer) + sizer.Add(PrintCommandButton(self, 'G1 Y100 F6000', 'print-move-y100.png'), pos=(0,3)) + sizer.Add(PrintCommandButton(self, 'G1 Y10 F6000', 'print-move-y10.png'), pos=(1,3)) + sizer.Add(PrintCommandButton(self, 'G1 Y1 F6000', 'print-move-y1.png'), pos=(2,3)) + + sizer.Add(PrintCommandButton(self, 'G1 Y-1 F6000', 'print-move-y-1.png'), pos=(4,3)) + sizer.Add(PrintCommandButton(self, 'G1 Y-10 F6000', 'print-move-y-10.png'), pos=(5,3)) + sizer.Add(PrintCommandButton(self, 'G1 Y-100 F6000', 'print-move-y-100.png'), pos=(6,3)) + + sizer.Add(PrintCommandButton(self, 'G1 X-100 F6000', 'print-move-x-100.png'), pos=(3,0)) + sizer.Add(PrintCommandButton(self, 'G1 X-10 F6000', 'print-move-x-10.png'), pos=(3,1)) + sizer.Add(PrintCommandButton(self, 'G1 X-1 F6000', 'print-move-x-1.png'), pos=(3,2)) + + sizer.Add(PrintCommandButton(self, 'G1 X1 F6000', 'print-move-x1.png'), pos=(3,4)) + sizer.Add(PrintCommandButton(self, 'G1 X10 F6000', 'print-move-x10.png'), pos=(3,5)) + sizer.Add(PrintCommandButton(self, 'G1 X100 F6000', 'print-move-x100.png'), pos=(3,6)) + + sizer.Add(PrintCommandButton(self, 'G1 Z10 F200', 'object-max-size.png'), pos=(0,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'object-max-size.png'), pos=(1,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'object-max-size.png'), pos=(2,6)) + + sizer.Add(PrintCommandButton(self, 'G1 Z0.1 F200', 'object-max-size.png'), pos=(4,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z1 F200', 'object-max-size.png'), pos=(5,6)) + sizer.Add(PrintCommandButton(self, 'G1 Z10 F200', 'object-max-size.png'), pos=(6,6)) self.sizer.AddGrowableRow(3) self.sizer.AddGrowableCol(0) @@ -122,6 +169,8 @@ class printWindow(wx.Frame): #self.loadButton.Enable(self.printIdx == None) self.printButton.Enable(self.machineConnected and self.gcodeList != None and self.printIdx == None) self.cancelButton.Enable(self.printIdx != None) + self.temperatureSelect.Enable(self.machineConnected) + self.directControlPanel.Enable(self.machineConnected) def UpdateProgress(self): status = "" diff --git a/Cura/gui/projectPlanner.py b/Cura/gui/projectPlanner.py index 0822a44a..14002802 100644 --- a/Cura/gui/projectPlanner.py +++ b/Cura/gui/projectPlanner.py @@ -56,7 +56,7 @@ class projectPlanner(wx.Frame): group = [] toolbarUtil.RadioButton(self.toolbar, group, 'object-3d-on.png', 'object-3d-off.png', '3D view', callback=self.On3DClick) - toolbarUtil.RadioButton(self.toolbar, group, 'object-top-on.png', 'object-top-off.png', 'Topdown view', callback=self.OnTopClick) + toolbarUtil.RadioButton(self.toolbar, group, 'object-top-on.png', 'object-top-off.png', 'Topdown view', callback=self.OnTopClick).SetValue(True) self.toolbar.Realize() @@ -259,7 +259,7 @@ class projectPlanner(wx.Frame): resultFile.write(';TYPE:CUSTOM\n') resultFile.write(profile.getAlterationFileContents('end.gcode')) - resultFile.close() + resultFile.close() def loadModelFile(self, item): item.load(item.filename) diff --git a/Cura/images/print-move-x-1.png b/Cura/images/print-move-x-1.png new file mode 100644 index 00000000..e7358c82 Binary files /dev/null and b/Cura/images/print-move-x-1.png differ diff --git a/Cura/images/print-move-x-10.png b/Cura/images/print-move-x-10.png new file mode 100644 index 00000000..184a398b Binary files /dev/null and b/Cura/images/print-move-x-10.png differ diff --git a/Cura/images/print-move-x-100.png b/Cura/images/print-move-x-100.png new file mode 100644 index 00000000..08dd9a9f Binary files /dev/null and b/Cura/images/print-move-x-100.png differ diff --git a/Cura/images/print-move-x1.png b/Cura/images/print-move-x1.png new file mode 100644 index 00000000..93f7a3f2 Binary files /dev/null and b/Cura/images/print-move-x1.png differ diff --git a/Cura/images/print-move-x10.png b/Cura/images/print-move-x10.png new file mode 100644 index 00000000..7d32c098 Binary files /dev/null and b/Cura/images/print-move-x10.png differ diff --git a/Cura/images/print-move-x100.png b/Cura/images/print-move-x100.png new file mode 100644 index 00000000..786bbf36 Binary files /dev/null and b/Cura/images/print-move-x100.png differ diff --git a/Cura/images/print-move-y-1.png b/Cura/images/print-move-y-1.png new file mode 100644 index 00000000..136c625f Binary files /dev/null and b/Cura/images/print-move-y-1.png differ diff --git a/Cura/images/print-move-y-10.png b/Cura/images/print-move-y-10.png new file mode 100644 index 00000000..5db06550 Binary files /dev/null and b/Cura/images/print-move-y-10.png differ diff --git a/Cura/images/print-move-y-100.png b/Cura/images/print-move-y-100.png new file mode 100644 index 00000000..cc66e4e8 Binary files /dev/null and b/Cura/images/print-move-y-100.png differ diff --git a/Cura/images/print-move-y1.png b/Cura/images/print-move-y1.png new file mode 100644 index 00000000..60455c49 Binary files /dev/null and b/Cura/images/print-move-y1.png differ diff --git a/Cura/images/print-move-y10.png b/Cura/images/print-move-y10.png new file mode 100644 index 00000000..d2a9ff82 Binary files /dev/null and b/Cura/images/print-move-y10.png differ diff --git a/Cura/images/print-move-y100.png b/Cura/images/print-move-y100.png new file mode 100644 index 00000000..db6cb3d6 Binary files /dev/null and b/Cura/images/print-move-y100.png differ