chiark / gitweb /
Merge pull request #1012 from jbkim/SteamEngine
authordaid <daid303@gmail.com>
Wed, 26 Nov 2014 11:24:53 +0000 (12:24 +0100)
committerdaid <daid303@gmail.com>
Wed, 26 Nov 2014 11:24:53 +0000 (12:24 +0100)
Update Korean language file and add Korean in resource.py

Cura/gui/app.py
Cura/gui/configWizard.py
Cura/gui/firmwareInstall.py
Cura/gui/mainWindow.py
Cura/gui/preferencesDialog.py
Cura/gui/printWindow.py
Cura/util/profile.py
Cura/util/sliceEngine.py
package.sh
resources/images/Printrbot_logo.png [new file with mode: 0644]

index f557a9a07dc8a1a303b7d232350c03ae82a4bc12..7dff8e9d49ecb4adbc9a843aaa62530fe2911fbf 100644 (file)
@@ -131,7 +131,7 @@ class CuraApp(wx.App):
                        self.loadFiles = [exampleFile]
                        if self.splash is not None:
                                self.splash.Show(False)
-                       configWizard.configWizard()
+                       configWizard.ConfigWizard()
 
                if profile.getPreference('check_for_updates') == 'True':
                        newVersion = version.checkForNewerVersion()
index f6295745bffab48a7b05d989b9be641502618f8b..9ac26ce3563ad0b5865e8e14e2b7d13b302ffc17 100644 (file)
@@ -258,33 +258,40 @@ class FirstInfoPage(InfoPage):
 
 class PrintrbotPage(InfoPage):
        def __init__(self, parent):
-               self._printer_info = {
+               self._printer_info = [
                        # X, Y, Z, Filament Diameter, PrintTemperature, Print Speed, Travel Speed, Retract speed, Retract amount
-                       "Original": (130, 130, 130, 2.95, 208, 40, 70, 30, 1),
-                       "Simple Maker's Edition v1": (100, 100, 100, 1.75, 208, 40, 70, 30, 1),
-                       "Simple Maker's Edition v2 (2013 Printrbot Simple)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1),
-                       "Simple Maker's Edition v3 (2014 Printrbot Simple)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1),
-                       "Simple Maker's Edition v4 (Model 1405)": (100, 100, 100, 1.75, 208, 40, 70, 30, 1),
-                       "Simple Metal": (150, 150, 150, 1.75, 208, 40, 70, 30, 1),
-                       "Jr v1": (150, 100, 80, 1.75, 208, 40, 70, 30, 1),
-                       "Jr v2": (150, 150, 150, 1.75, 208, 40, 70, 30, 1),
-                       "LC v2": (150, 150, 150, 1.75, 208, 40, 70, 30, 1),
-                       "Plus v2": (200, 200, 200, 1.75, 208, 40, 70, 30, 1),
-                       "Plus v2.1": (200, 200, 200, 1.75, 208, 40, 70, 30, 1),
-                       "Plus v2.2 (Model 1404/140422)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1),
-                       "Plus v2.3 (Model 140501)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1),
-                       "Plus v2.4 (Model 140507)": (250, 250, 250, 1.75, 208, 40, 70, 30, 1),
-               }
+                       ("Simple Metal", 150, 150, 150, 1.75, 208, 40, 70, 30, 1),
+                       ("Metal Plus", 250, 250, 250, 1.75, 208, 40, 70, 30, 1),
+                       ("Simple Makers Kit", 100, 100, 100, 1.75, 208, 40, 70, 30, 1),
+                       (":" + _("Older models"),),
+                       ("Original", 130, 130, 130, 2.95, 208, 40, 70, 30, 1),
+                       ("Simple Maker's Edition v1", 100, 100, 100, 1.75, 208, 40, 70, 30, 1),
+                       ("Simple Maker's Edition v2 (2013 Printrbot Simple)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1),
+                       ("Simple Maker's Edition v3 (2014 Printrbot Simple)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1),
+                       ("Simple Maker's Edition v4 (Model 1405)", 100, 100, 100, 1.75, 208, 40, 70, 30, 1),
+                       ("Jr v1", 150, 100, 80, 1.75, 208, 40, 70, 30, 1),
+                       ("Jr v2", 150, 150, 150, 1.75, 208, 40, 70, 30, 1),
+                       ("LC v2", 150, 150, 150, 1.75, 208, 40, 70, 30, 1),
+                       ("Plus v2", 200, 200, 200, 1.75, 208, 40, 70, 30, 1),
+                       ("Plus v2.1", 200, 200, 200, 1.75, 208, 40, 70, 30, 1),
+                       ("Plus v2.2 (Model 1404/140422)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1),
+                       ("Plus v2.3 (Model 140501)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1),
+                       ("Plus v2.4 (Model 140507)", 250, 250, 250, 1.75, 208, 40, 70, 30, 1),
+                       ("Go v2 Large", 609, 305, 305, 1.75, 208, 35, 70, 30, 1),
+               ]
 
                super(PrintrbotPage, self).__init__(parent, _("Printrbot Selection"))
+               self.AddBitmap(wx.Bitmap(resources.getPathForImage('Printrbot_logo.png')))
                self.AddText(_("Select which Printrbot machine you have:"))
-               keys = self._printer_info.keys()
-               keys.sort()
                self._items = []
-               for name in keys:
-                       item = self.AddRadioButton(name)
-                       item.data = self._printer_info[name]
-                       self._items.append(item)
+               for printer in self._printer_info:
+                       if printer[0].startswith(":"):
+                               self.AddSeperator()
+                               self.AddText(printer[0][1:])
+                       else:
+                               item = self.AddRadioButton(printer[0])
+                               item.data = printer[1:]
+                               self._items.append(item)
 
        def StoreData(self):
                profile.putMachineSetting('machine_name', 'Printrbot ???')
@@ -980,12 +987,17 @@ class LulzbotReadyPage(InfoPage):
                self.AddText(_('Cura is now ready to be used with your Lulzbot.'))
                self.AddSeperator()
 
-class configWizard(wx.wizard.Wizard):
+class ConfigWizard(wx.wizard.Wizard):
        def __init__(self, addNew = False):
-               super(configWizard, self).__init__(None, -1, _("Configuration Wizard"))
+               super(ConfigWizard, self).__init__(None, -1, _("Configuration Wizard"))
+
+               self._old_machine_index = int(profile.getPreferenceFloat('active_machine'))
+               if addNew:
+                       profile.setActiveMachine(profile.getMachineCount())
 
                self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGED, self.OnPageChanged)
                self.Bind(wx.wizard.EVT_WIZARD_PAGE_CHANGING, self.OnPageChanging)
+               self.Bind(wx.wizard.EVT_WIZARD_CANCEL, self.OnCancel)
 
                self.firstInfoPage = FirstInfoPage(self, addNew)
                self.machineSelectPage = MachineSelectPage(self)
@@ -1033,6 +1045,9 @@ class configWizard(wx.wizard.Wizard):
                else:
                        self.FindWindowById(wx.ID_BACKWARD).Disable()
 
+       def OnCancel(self, e):
+               profile.setActiveMachine(self._old_machine_index)
+
 class bedLevelWizardMain(InfoPage):
        def __init__(self, parent):
                super(bedLevelWizardMain, self).__init__(parent, _("Bed leveling wizard"))
index 8c030a79dfc16b632653245771cd75b495f50ca5..8a2972e07fe7d2ee5a5f425b9669a0a66e128cdc 100644 (file)
@@ -44,6 +44,10 @@ def getDefaultFirmware(machineIndex = None):
                return resources.getPathForFirmware(name + '.hex')
 
        if profile.getMachineSetting('machine_type', machineIndex) == 'ultimaker2':
+               if profile.getMachineSettingFloat('extruder_amount', machineIndex) > 2:
+                       return None
+               if profile.getMachineSettingFloat('extruder_amount', machineIndex) == 2:
+                       return resources.getPathForFirmware("MarlinUltimaker2-dual.hex")
                return resources.getPathForFirmware("MarlinUltimaker2.hex")
        if profile.getMachineSetting('machine_type', machineIndex) == 'Witbox':
                return resources.getPathForFirmware("MarlinWitbox.hex")
index 0ec23a3236b055c1fc10968365b5a31d6bdab17d..2c49983428776345cdd3f7982f1743820ea62db5 100644 (file)
@@ -555,8 +555,7 @@ class mainWindow(wx.Frame):
 
        def OnAddNewMachine(self, e):
                self.Hide()
-               profile.setActiveMachine(profile.getMachineCount())
-               configWizard.configWizard(True)
+               configWizard.ConfigWizard(True)
                self.Show()
                self.reloadSettingPanels()
                self.updateMachineMenu()
index 8153876c28c94bb262f1eacf7d301207febeee3e..9aed77822117fe2e24d1d087839e76ef6956862c 100644 (file)
@@ -138,8 +138,7 @@ class machineSettingsDialog(wx.Dialog):
        def OnAddMachine(self, e):
                self.Hide()
                self.parent.Hide()
-               profile.setActiveMachine(profile.getMachineCount())
-               configWizard.configWizard(True)
+               configWizard.ConfigWizard(True)
                self.parent.Show()
                self.parent.reloadSettingPanels()
                self.parent.updateMachineMenu()
index dc186647f2bd58f10cfd4db2b50c990f9ef683db..5f3cb0637c904e215bf136446338ddca21c258c5 100644 (file)
@@ -444,6 +444,9 @@ class printWindowBasic(wx.Frame):
                info += '\n\n'
                self.statsText.SetLabel(info)
 
+       def _addTermLog(self, msg):
+               pass
+
        def _updateButtonStates(self):
                self.connectButton.Show(self._printerConnection.hasActiveConnection())
                self.connectButton.Enable(not self._printerConnection.isActiveConnectionOpen() and not self._printerConnection.isActiveConnectionOpening())
index 1f6c630ce37a75ff47ed5155fd59bb72602c91b8..a27e7f30950ff655c94bdae06982bf2f14a0bfda 100644 (file)
@@ -1108,7 +1108,7 @@ def calculateSolidLayerCount():
        solidThickness = getProfileSettingFloat('solid_layer_thickness')
        if layerHeight == 0.0:
                return 1
-       return int(math.ceil(solidThickness / (layerHeight - 0.0001)))
+       return int(math.ceil((solidThickness - 0.0001) / layerHeight))
 
 def calculateObjectSizeOffsets():
        size = 0.0
index f4232f60ce98d03ed9fdbab490cba3a22d239092..125d86aaf2818b4482b438b4b69acf595241d3b0 100644 (file)
@@ -8,17 +8,16 @@ import time
 import math
 import numpy
 import os
-import warnings
 import threading
 import traceback
 import platform
-import sys
 import urllib
 import urllib2
 import hashlib
 import socket
 import struct
 import errno
+import inspect
 
 from Cura.util.bigDataStorage import BigDataStorage
 from Cura.util import profile
@@ -31,22 +30,24 @@ def getEngineFilename():
                Finds and returns the path to the current engine executable. This is OS depended.
        :return: The full path to the engine executable.
        """
+       base_search_path = os.path.dirname(inspect.getfile(getEngineFilename))
+       search_filename = 'CuraEngine'
        if platform.system() == 'Windows':
+               search_filename += '.exe'
                if version.isDevVersion() and os.path.exists('C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe'):
                        return 'C:/Software/Cura_SteamEngine/_bin/Release/Cura_SteamEngine.exe'
-               if version.isDevVersion() and os.path.exists('C:/Program Files (x86)/Cura_14.09/CuraEngine.exe'):
-                       return 'C:/Program Files (x86)/Cura_14.09/CuraEngine.exe'
-               return os.path.abspath(os.path.join(os.path.dirname(__file__), '../..', 'CuraEngine.exe'))
-       if hasattr(sys, 'frozen'):
-               return os.path.abspath(os.path.join(os.path.dirname(__file__), '../../../../..', 'CuraEngine'))
+       for n in xrange(0, 10):
+               full_filename = os.path.abspath(os.path.join(base_search_path, '/'.join(['..'] * n), search_filename))
+               if os.path.isfile(full_filename):
+                       return full_filename
+               full_filename = os.path.abspath(os.path.join(base_search_path, '/'.join(['..'] * n), 'CuraEngine', search_filename))
+               if os.path.isfile(full_filename):
+                       return full_filename
        if os.path.isfile('/usr/bin/CuraEngine'):
                return '/usr/bin/CuraEngine'
        if os.path.isfile('/usr/local/bin/CuraEngine'):
                return '/usr/local/bin/CuraEngine'
-       tempPath = os.path.abspath(os.path.join(os.path.dirname(__file__), '../..', 'CuraEngine'))
-       if os.path.isdir(tempPath):
-               tempPath = os.path.join(tempPath,'CuraEngine')
-       return tempPath
+       return ''
 
 class EngineResult(object):
        """
@@ -182,6 +183,7 @@ class Engine(object):
                self._objCount = 0
                self._result = None
 
+               self._engine_executable = getEngineFilename()
                self._serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
                self._serverPortNr = 0xC20A
                for potential_port in xrange(0xC20A, 0xFFFF):
@@ -290,7 +292,7 @@ class Engine(object):
 
                extruderCount = max(extruderCount, profile.minimalExtruderCount())
 
-               commandList = [getEngineFilename(), '-v', '-p']
+               commandList = [self._engine_executable, '-v', '-p']
                for k, v in self._engineSettings(extruderCount).iteritems():
                        commandList += ['-s', '%s=%s' % (k, str(v))]
                commandList += ['-g', '%d' % (self._serverPortNr)]
index 5625331755b513fea2e9d426b40f0ff34a39d65b..2c514975abfa1165794b094a20713cc43cf74d5b 100755 (executable)
@@ -19,7 +19,7 @@ BUILD_TARGET=${1:-none}
 ##Do we need to create the final archive
 ARCHIVE_FOR_DISTRIBUTION=1
 ##Which version name are we appending to the final archive
-export BUILD_NAME=14.11-RC7
+export BUILD_NAME=14.11-RC8
 TARGET_DIR=Cura-${BUILD_NAME}-${BUILD_TARGET}
 
 ##Which versions of external programs to use
@@ -159,7 +159,7 @@ cd -
 gitClone git@github.com:Ultimaker/Ultimaker2Marlin.git _Ultimaker2Marlin
 cd _Ultimaker2Marlin/Marlin
 $MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2 DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=0 EXTRUDERS=1"
-$MAKE -j 3 V=1 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=20 EXTRUDERS=2"
+$MAKE -j 3 HARDWARE_MOTHERBOARD=72 ARDUINO_INSTALL_DIR=${ARDUINO_PATH} ARDUINO_VERSION=${ARDUINO_VERSION} BUILD_DIR=_Ultimaker2Dual DEFINES="'STRING_CONFIG_H_AUTHOR=\"Version:_${BUILD_NAME}\"' TEMP_SENSOR_1=20 EXTRUDERS=2"
 cd -
 
 cp _UltimakerMarlin/Marlin/_UltimakerMarlin_250000/Marlin.hex resources/firmware/MarlinUltimaker-250000.hex
diff --git a/resources/images/Printrbot_logo.png b/resources/images/Printrbot_logo.png
new file mode 100644 (file)
index 0000000..a959ba9
Binary files /dev/null and b/resources/images/Printrbot_logo.png differ