chiark / gitweb /
Add default machine profiles for other machines then Ultimakers.
authordaid <daid303@gmail.com>
Sun, 6 Oct 2013 14:37:27 +0000 (16:37 +0200)
committerdaid <daid303@gmail.com>
Sun, 6 Oct 2013 14:37:27 +0000 (16:37 +0200)
12 files changed:
Cura/gui/aboutWindow.py
Cura/gui/configWizard.py
Cura/gui/preferencesDialog.py
Cura/resources/machine_profiles/MakerBotReplicator.ini [new file with mode: 0644]
Cura/resources/machine_profiles/Mendel.ini [new file with mode: 0644]
Cura/resources/machine_profiles/PrintrBot.ini [new file with mode: 0644]
Cura/resources/machine_profiles/PrintrBotLC+.ini [new file with mode: 0644]
Cura/resources/machine_profiles/Prusa Mendel i3.ini [new file with mode: 0644]
Cura/resources/meshes/Attribution.txt
Cura/util/profile.py
Cura/util/resources.py
build_app.py

index 1e4bed726c645708a6ef080704e5e8c4a4e1780e..703f0086084b8640d491891dbc09fab96d8ced06 100644 (file)
@@ -42,6 +42,12 @@ class aboutWindow(wx.Dialog):
                        self.addComponent('EjectMedia', 'Utility to safe-remove SD cards', 'Freeware', 'http://www.uwe-sieber.de/english.html')
                self.addComponent('Pymclevel', 'Python library for reading Minecraft levels.', 'ISC', 'https://github.com/mcedit/pymclevel')
 
+               #Translations done by:
+               #Dutch: Charlotte Jansen
+               #German: Gregor Luetolf
+               #Polish: Piotr Paczynski
+               #French: Jeremie Francois
+               #Spanish: Jose Gemez
                self.Fit()
 
        def addComponent(self, name, description, license, url):
index 2884d6925c21758e1022a1810ccf0495d97e36af..c26c8460162dbd13725dc46b0e87681fb86289ab 100644 (file)
@@ -1,6 +1,7 @@
 from __future__ import absolute_import
 __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AGPLv3 License"
 
+import os
 import webbrowser
 import threading
 import time
@@ -14,7 +15,7 @@ from Cura.gui import printWindow
 from Cura.util import machineCom
 from Cura.util import profile
 from Cura.util import gcodeGenerator
-from Cura.util.resources import getPathForImage
+from Cura.util import resources
 
 
 class InfoBox(wx.Panel):
@@ -25,14 +26,14 @@ class InfoBox(wx.Panel):
                self.sizer = wx.GridBagSizer(5, 5)
                self.SetSizer(self.sizer)
 
-               self.attentionBitmap = wx.Bitmap(getPathForImage('attention.png'))
-               self.errorBitmap = wx.Bitmap(getPathForImage('error.png'))
-               self.readyBitmap = wx.Bitmap(getPathForImage('ready.png'))
+               self.attentionBitmap = wx.Bitmap(resources.getPathForImage('attention.png'))
+               self.errorBitmap = wx.Bitmap(resources.getPathForImage('error.png'))
+               self.readyBitmap = wx.Bitmap(resources.getPathForImage('ready.png'))
                self.busyBitmap = [
-                       wx.Bitmap(getPathForImage('busy-0.png')),
-                       wx.Bitmap(getPathForImage('busy-1.png')),
-                       wx.Bitmap(getPathForImage('busy-2.png')),
-                       wx.Bitmap(getPathForImage('busy-3.png'))
+                       wx.Bitmap(resources.getPathForImage('busy-0.png')),
+                       wx.Bitmap(resources.getPathForImage('busy-1.png')),
+                       wx.Bitmap(resources.getPathForImage('busy-2.png')),
+                       wx.Bitmap(resources.getPathForImage('busy-3.png'))
                ]
 
                self.bitmap = wx.StaticBitmap(self, -1, wx.EmptyBitmapRGBA(24, 24, red=255, green=255, blue=255, alpha=1))
@@ -232,11 +233,47 @@ class FirstInfoPage(InfoPage):
                #self.AddText('* Do your first print')
 
 
-class RepRapInfoPage(InfoPage):
+class OtherMachineSelectPage(InfoPage):
        def __init__(self, parent):
-               super(RepRapInfoPage, self).__init__(parent, "RepRap information")
-               self.AddText(
-                       _("RepRap machines are vastly different, and there is no\ndefault configuration in Cura for any of them."))
+               super(OtherMachineSelectPage, self).__init__(parent, "Other machine information")
+               self.AddText(_("The following pre-defined machine profiles are available"))
+               self.AddText(_("Note that these profiles are not guaranteed to give good results,\nor work at all. Extra tweaks might be required."))
+               self.options = []
+               machines = resources.getDefaultMachineProfiles()
+               machines.sort()
+               for filename in machines:
+                       name = os.path.splitext(os.path.basename(filename))[0]
+                       item = self.AddRadioButton(name)
+                       item.filename = filename
+                       item.Bind(wx.EVT_RADIOBUTTON, self.OnProfileSelect)
+                       self.options.append(item)
+               self.AddSeperator()
+               item = self.AddRadioButton('Custom...')
+               item.SetValue(True)
+               item.Bind(wx.EVT_RADIOBUTTON, self.OnOtherSelect)
+
+       def OnProfileSelect(self, e):
+               wx.wizard.WizardPageSimple.Chain(self, self.GetParent().otherMachineInfoPage)
+
+       def OnOtherSelect(self, e):
+               wx.wizard.WizardPageSimple.Chain(self, self.GetParent().customRepRapInfoPage)
+
+       def StoreData(self):
+               for option in self.options:
+                       if option.GetValue():
+                               profile.loadProfile(option.filename)
+                               profile.loadMachineSettings(option.filename)
+
+class OtherMachineInfoPage(InfoPage):
+       def __init__(self, parent):
+               super(OtherMachineInfoPage, self).__init__(parent, "Cura Ready!")
+               self.AddText(_("Cura is now ready to be used!"))
+
+class CustomRepRapInfoPage(InfoPage):
+       def __init__(self, parent):
+               super(CustomRepRapInfoPage, self).__init__(parent, "Custom RepRap information")
+               self.AddText(_("RepRap machines can be vastly different, so here you can set your own settings."))
+               self.AddText(_("Be sure to review the default profile before running it on your machine."))
                self.AddText(_("If you like a default profile for your machine added,\nthen make an issue on github."))
                self.AddSeperator()
                self.AddText(_("You will have to manually install Marlin or Sprinter firmware."))
@@ -275,7 +312,7 @@ class MachineSelectPage(InfoPage):
                self.Ultimaker2Radio.Bind(wx.EVT_RADIOBUTTON, self.OnUltimaker2Select)
                self.UltimakerRadio = self.AddRadioButton("Ultimaker")
                self.UltimakerRadio.Bind(wx.EVT_RADIOBUTTON, self.OnUltimakerSelect)
-               self.OtherRadio = self.AddRadioButton(_("Other (Ex: RepRap)"))
+               self.OtherRadio = self.AddRadioButton(_("Other (Ex: RepRap, MakerBot)"))
                self.OtherRadio.Bind(wx.EVT_RADIOBUTTON, self.OnOtherSelect)
                self.AddSeperator()
                self.AddText(_("The collection of anonymous usage information helps with the continued improvement of Cura."))
@@ -291,7 +328,7 @@ class MachineSelectPage(InfoPage):
                wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimakerSelectParts)
 
        def OnOtherSelect(self, e):
-               wx.wizard.WizardPageSimple.Chain(self, self.GetParent().repRapInfoPage)
+               wx.wizard.WizardPageSimple.Chain(self, self.GetParent().otherMachineSelectPage)
 
        def AllowNext(self):
                wx.wizard.WizardPageSimple.Chain(self, self.GetParent().ultimaker2ReadyPage)
@@ -404,16 +441,16 @@ class UltimakerCheckupPage(InfoPage):
        def __init__(self, parent):
                super(UltimakerCheckupPage, self).__init__(parent, "Ultimaker Checkup")
 
-               self.checkBitmap = wx.Bitmap(getPathForImage('checkmark.png'))
-               self.crossBitmap = wx.Bitmap(getPathForImage('cross.png'))
-               self.unknownBitmap = wx.Bitmap(getPathForImage('question.png'))
-               self.endStopNoneBitmap = wx.Bitmap(getPathForImage('endstop_none.png'))
-               self.endStopXMinBitmap = wx.Bitmap(getPathForImage('endstop_xmin.png'))
-               self.endStopXMaxBitmap = wx.Bitmap(getPathForImage('endstop_xmax.png'))
-               self.endStopYMinBitmap = wx.Bitmap(getPathForImage('endstop_ymin.png'))
-               self.endStopYMaxBitmap = wx.Bitmap(getPathForImage('endstop_ymax.png'))
-               self.endStopZMinBitmap = wx.Bitmap(getPathForImage('endstop_zmin.png'))
-               self.endStopZMaxBitmap = wx.Bitmap(getPathForImage('endstop_zmax.png'))
+               self.checkBitmap = wx.Bitmap(resources.getPathForImage('checkmark.png'))
+               self.crossBitmap = wx.Bitmap(resources.getPathForImage('cross.png'))
+               self.unknownBitmap = wx.Bitmap(resources.getPathForImage('question.png'))
+               self.endStopNoneBitmap = wx.Bitmap(resources.getPathForImage('endstop_none.png'))
+               self.endStopXMinBitmap = wx.Bitmap(resources.getPathForImage('endstop_xmin.png'))
+               self.endStopXMaxBitmap = wx.Bitmap(resources.getPathForImage('endstop_xmax.png'))
+               self.endStopYMinBitmap = wx.Bitmap(resources.getPathForImage('endstop_ymin.png'))
+               self.endStopYMaxBitmap = wx.Bitmap(resources.getPathForImage('endstop_ymax.png'))
+               self.endStopZMinBitmap = wx.Bitmap(resources.getPathForImage('endstop_zmin.png'))
+               self.endStopZMaxBitmap = wx.Bitmap(resources.getPathForImage('endstop_zmax.png'))
 
                self.AddText(
                        _("It is a good idea to do a few sanity checks now on your Ultimaker.\nYou can skip these if you know your machine is functional."))
@@ -783,7 +820,9 @@ class configWizard(wx.wizard.Wizard):
                self.ultimakerCalibrateStepsPerEPage = UltimakerCalibrateStepsPerEPage(self)
                self.bedLevelPage = bedLevelWizardMain(self)
                self.headOffsetCalibration = headOffsetCalibrationPage(self)
-               self.repRapInfoPage = RepRapInfoPage(self)
+               self.otherMachineSelectPage = OtherMachineSelectPage(self)
+               self.customRepRapInfoPage = CustomRepRapInfoPage(self)
+               self.otherMachineInfoPage = OtherMachineInfoPage(self)
 
                self.ultimaker2ReadyPage = Ultimaker2ReadyPage(self)
 
@@ -794,6 +833,7 @@ class configWizard(wx.wizard.Wizard):
                wx.wizard.WizardPageSimple.Chain(self.ultimakerFirmwareUpgradePage, self.ultimakerCheckupPage)
                wx.wizard.WizardPageSimple.Chain(self.ultimakerCheckupPage, self.bedLevelPage)
                #wx.wizard.WizardPageSimple.Chain(self.ultimakerCalibrationPage, self.ultimakerCalibrateStepsPerEPage)
+               wx.wizard.WizardPageSimple.Chain(self.otherMachineSelectPage, self.customRepRapInfoPage)
 
                self.FitToPage(self.firstInfoPage)
                self.GetPageAreaSizer().Add(self.firstInfoPage)
index 8dc0199d0a1f23774db7593944b8b77af58b9300..fe012cffa391d44852f1333fc0bbe1ecaf85e3cb 100644 (file)
@@ -27,8 +27,9 @@ class preferencesDialog(wx.Dialog):
                for i in xrange(1, extruderCount):
                        configBase.SettingRow(left, 'model_colour%d' % (i+1), wx.Colour)
 
-               configBase.TitleRow(left, _("Language"))
-               configBase.SettingRow(left, 'language', map(lambda n: n[1], resources.getLanguageOptions()))
+               if len(resources.getLanguageOptions()) > 1:
+                       configBase.TitleRow(left, _("Language"))
+                       configBase.SettingRow(left, 'language', map(lambda n: n[1], resources.getLanguageOptions()))
 
                configBase.TitleRow(right, _("Filament settings"))
                configBase.SettingRow(right, 'filament_physical_density')
diff --git a/Cura/resources/machine_profiles/MakerBotReplicator.ini b/Cura/resources/machine_profiles/MakerBotReplicator.ini
new file mode 100644 (file)
index 0000000..793011c
--- /dev/null
@@ -0,0 +1,58 @@
+[machine]\r
+machine_name = MakerBot Replicator\r
+machine_type = MakerBot\r
+machine_width = 225\r
+machine_depth = 145\r
+machine_height = 150\r
+machine_center_is_zero = False\r
+has_heated_bed = True\r
+gcode_flavor = MakerBot\r
+extruder_amount = 1\r
+\r
+[profile]\r
+filament_diameter = 1.75\r
+nozzle_size = 0.4\r
+layer_height = 0.15\r
+fill_density = 10\r
+print_speed = 50\r
+print_temperature = 220\r
+travel_speed = 150\r
+\r
+[alterations]\r
+start.gcode = ; -- START GCODE --\r
+       M136 (enable build)\r
+       M73 P0\r
+       G162 X Y F2000(home XY axes maximum)\r
+       G161 Z F900(home Z axis minimum)\r
+       G92 X0 Y0 Z-5 A0 B0 (set Z to -5)\r
+       G1 Z0.0 F{max_z_speed}(move Z to '0')\r
+       G161 Z F100(home Z axis minimum)\r
+       M132 X Y Z A B (Recall stored home offsets for XYZAB axis)\r
+       G92 X152 Y72 Z0 A0 B0\r
+       G1 X-141 Y-74 Z40 F{travel_speed} (move to waiting position)\r
+       G130 X20 Y20 A20 B20 (Lower stepper Vrefs while heating)\r
+       M135 T0\r
+       M104 S220 T0\r
+       M133 T0\r
+       G130 X127 Y127 A127 B127 (Set Stepper motor Vref to defaults)\r
+       ; Sliced {filename} at: {day} {date} {time}\r
+       ; Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}\r
+       ; Print time: {print_time}\r
+       ; Filament used: {filament_amount}m {filament_weight}g\r
+       ; Filament cost: {filament_cost}\r
+       M73 P0; \r
+       ; -- end of START GCODE --\r
+\r
+end.gcode = ; -- END GCODE --\r
+       M127 T0; fan off\r
+       M127 T0 (Fan Off)\r
+       M18 A B(Turn off A and B Steppers)\r
+       G1 Z155 F900\r
+       G162 X Y F2000\r
+       M18 X Y Z(Turn off steppers after a build)\r
+       M104 S0 T0\r
+       M70 P5 (We <3 Making Things!)\r
+       M72 P1  ( Play Ta-Da song )\r
+       M73 P100\r
+       M137 (build end notification)\r
+       ; -- end of END GCODE --\r
diff --git a/Cura/resources/machine_profiles/Mendel.ini b/Cura/resources/machine_profiles/Mendel.ini
new file mode 100644 (file)
index 0000000..1309055
--- /dev/null
@@ -0,0 +1,18 @@
+[machine]\r
+machine_name = Mendel\r
+machine_type = RepRap\r
+machine_width = 200\r
+machine_depth = 200\r
+machine_height = 140\r
+machine_center_is_zero = False\r
+has_heated_bed = True\r
+gcode_flavor = RepRap (Marlin/Sprinter)\r
+extruder_amount = 1\r
+\r
+[profile]\r
+filament_diameter = 2.85\r
+nozzle_size = 0.5\r
+layer_height = 0.2\r
+print_speed = 50\r
+print_temperature = 240\r
+travel_speed = 150\r
diff --git a/Cura/resources/machine_profiles/PrintrBot.ini b/Cura/resources/machine_profiles/PrintrBot.ini
new file mode 100644 (file)
index 0000000..63cad09
--- /dev/null
@@ -0,0 +1,19 @@
+[machine]\r
+machine_name = PrintrBot\r
+machine_type = RepRap\r
+machine_width = 150\r
+machine_depth = 150\r
+machine_height = 150\r
+machine_center_is_zero = False\r
+has_heated_bed = True\r
+gcode_flavor = RepRap (Marlin/Sprinter)\r
+extruder_amount = 1\r
+\r
+[profile]\r
+filament_diameter = 2.85\r
+nozzle_size = 0.5\r
+layer_height = 0.2\r
+fill_density = 10\r
+print_speed = 30\r
+print_temperature = 240\r
+travel_speed = 150\r
diff --git a/Cura/resources/machine_profiles/PrintrBotLC+.ini b/Cura/resources/machine_profiles/PrintrBotLC+.ini
new file mode 100644 (file)
index 0000000..cbd6d02
--- /dev/null
@@ -0,0 +1,19 @@
+[machine]\r
+machine_name = PrintrBot LC+\r
+machine_type = RepRap\r
+machine_width = 200\r
+machine_depth = 200\r
+machine_height = 200\r
+machine_center_is_zero = False\r
+has_heated_bed = True\r
+gcode_flavor = RepRap (Marlin/Sprinter)\r
+extruder_amount = 1\r
+\r
+[profile]\r
+filament_diameter = 2.85\r
+nozzle_size = 0.5\r
+layer_height = 0.2\r
+fill_density = 10\r
+print_speed = 30\r
+print_temperature = 240\r
+travel_speed = 150\r
diff --git a/Cura/resources/machine_profiles/Prusa Mendel i3.ini b/Cura/resources/machine_profiles/Prusa Mendel i3.ini
new file mode 100644 (file)
index 0000000..a364681
--- /dev/null
@@ -0,0 +1,18 @@
+[machine]\r
+machine_name = Prusa Mendel i3\r
+machine_type = RepRap\r
+machine_width = 198\r
+machine_depth = 185\r
+machine_height = 200\r
+machine_center_is_zero = False\r
+has_heated_bed = True\r
+gcode_flavor = RepRap (Marlin/Sprinter)\r
+extruder_amount = 1\r
+\r
+[profile]\r
+filament_diameter = 2.85\r
+nozzle_size = 0.5\r
+layer_height = 0.2\r
+print_speed = 50\r
+print_temperature = 240\r
+travel_speed = 150\r
index de41baf478d6fc2996bfb8a1dd207f11f02e5aed..9630787da3e70035eb632cf132b8cebc3fac348b 100644 (file)
@@ -1,2 +1,3 @@
 * ultimaker_platform.stl: 3D platform from the Ultimaker. Derivative from Ultimaker lasercut drawings. CC BY-NC 3.0 license (http://creativecommons.org/licenses/by-nc/3.0/)\r
   http://www.thingiverse.com/thing:13571\r
+* ultimaker2_platform.stl: 3D platform from the Ultimaker2, released by Ultimaker for Cura. CC BY-NC 3.0 license (http://creativecommons.org/licenses/by-nc/3.0/)\r
index 66758c1cff81367d6cce4267a21aeab456345a94..878fe0ba3461b0392abbf83c62d36462c9e1caf6 100644 (file)
@@ -366,7 +366,7 @@ setting('machine_height', '200', float, 'machine', 'hidden').setLabel(_("Maximum
 setting('machine_center_is_zero', 'False', bool, 'machine', 'hidden')
 setting('ultimaker_extruder_upgrade', 'False', bool, 'machine', 'hidden')
 setting('has_heated_bed', 'False', bool, 'machine', 'hidden').setLabel(_("Heated bed"), _("If you have an heated bed, this enabled heated bed settings (requires restart)"))
-setting('gcode_flavor', 'RepRap (Marlin/Sprinter)', ['RepRap (Marlin/Sprinter)', 'UltiGCode'], 'machine', 'hidden').setLabel(_("GCode Flavor"), _("Flavor of generated GCode.\nRepRap is normal 5D GCode which works on Marlin/Sprinter based firmwares.\nUltiGCode is a variation of the RepRap GCode which puts more settings in the machine instead of the slicer."))
+setting('gcode_flavor', 'RepRap (Marlin/Sprinter)', ['RepRap (Marlin/Sprinter)', 'UltiGCode', 'MakerBot'], 'machine', 'hidden').setLabel(_("GCode Flavor"), _("Flavor of generated GCode.\nRepRap is normal 5D GCode which works on Marlin/Sprinter based firmwares.\nUltiGCode is a variation of the RepRap GCode which puts more settings in the machine instead of the slicer.\nMakerBot GCode has a few changes in the way GCode is generated, but still requires MakerWare to generate to X3G."))
 setting('extruder_amount', '1', ['1','2','3','4'], 'machine', 'hidden').setLabel(_("Extruder count"), _("Amount of extruders in your machine."))
 setting('extruder_offset_x1', '-21.6', float, 'machine', 'hidden').setLabel(_("Offset X"), _("The offset of your secondary extruder compared to the primary."))
 setting('extruder_offset_y1', '0.0', float, 'machine', 'hidden').setLabel(_("Offset Y"), _("The offset of your secondary extruder compared to the primary."))
@@ -654,6 +654,21 @@ def loadPreferences(filename):
 
        setActiveMachine(int(getPreferenceFloat('active_machine')))
 
+def loadMachineSettings(filename):
+       global settingsList
+       #Read a configuration file as global config
+       profileParser = ConfigParser.ConfigParser()
+       try:
+               profileParser.read(filename)
+       except ConfigParser.ParsingError:
+               return
+
+       for set in settingsList:
+               if set.isMachineSetting():
+                       if profileParser.has_option('machine', set.getName()):
+                               set.setValue(unicode(profileParser.get('machine', set.getName()), 'utf-8', 'replace'))
+       checkAndUpdateMachineName()
+
 def savePreferences(filename):
        global settingsList
        #Save the current profile to an ini file
index 8d744c1ff1ed44ea5a870ad34b2f4ef50d777cb3..d1f38358ea3dbf02c6556b1e2c3e3b02702bc9f8 100644 (file)
@@ -3,6 +3,7 @@ __copyright__ = "Copyright (C) 2013 David Braam - Released under terms of the AG
 
 import os
 import sys
+import glob
 
 #Cura/util classes should not depend on wx...
 import wx
@@ -44,6 +45,10 @@ def getPathForMesh(name):
 def getPathForFirmware(name):
        return getPathForResource(resourceBasePath, 'firmware', name)
 
+def getDefaultMachineProfiles():
+       path = os.path.normpath(os.path.join(resourceBasePath, 'machine_profiles', '*.ini'))
+       return glob.glob(path)
+
 def setupLocalization(selectedLanguage = None):
        try:
                if sys.platform.startswith('darwin'):
index 6371c4feeaab680b851551ea80017b70675f72af..22707a0f226575a0fad0afdb9e94fa1ec9451202 100644 (file)
@@ -6,7 +6,7 @@ if sys.platform.startswith('darwin'):
     from setuptools import setup
 
     APP = ['Cura/cura.py']
-    DATA_FILES = ['Cura/LICENSE', 'Cura/resources/images', 'Cura/resources/meshes', 'Cura/resources/example', 'Cura/resources/firmware', 'Cura/resources/locale']
+    DATA_FILES = ['Cura/LICENSE', 'Cura/resources/images', 'Cura/resources/meshes', 'Cura/resources/example', 'Cura/resources/firmware', 'Cura/resources/locale', 'Cura/resources/machine_profiles']
     PLIST = {
         u'CFBundleName': u'Cura',
         u'CFBundleShortVersionString': u'13.06.5',