chiark / gitweb /
Fix an issue in version upgrade for TAZ bed size. profile module can't be called...
[cura.git] / Cura / util / profile.py
index 8cb87ba508cb06b7e2d2cf3303ced4984b742d33..06c466a3397e3583038b4812740eb1d3c7199499 100644 (file)
@@ -516,7 +516,6 @@ setting('model_colour', '#C9E240', str, 'preference', 'hidden').setLabel(_('Mode
 setting('model_colour2', '#CB3030', str, 'preference', 'hidden').setLabel(_('Model colour (2)'), _('Display color for second extruder'))
 setting('model_colour3', '#DDD93C', str, 'preference', 'hidden').setLabel(_('Model colour (3)'), _('Display color for third extruder'))
 setting('model_colour4', '#4550D3', str, 'preference', 'hidden').setLabel(_('Model colour (4)'), _('Display color for forth extruder'))
-setting('printing_window', 'Pronterface UI', ['Basic'], 'preference', 'hidden').setLabel(_('Printing window type'), _('Select the interface used for USB printing.'))
 
 setting('window_maximized', 'True', bool, 'preference', 'hidden')
 setting('window_pos_x', '-1', float, 'preference', 'hidden')
@@ -552,6 +551,8 @@ setting('serial_port_auto', '', str, 'machine', 'hidden')
 setting('serial_baud', 'AUTO', str, 'machine', 'hidden').setLabel(_("Baudrate"), _("Speed of the serial port communication\nNeeds to match your firmware settings\nCommon values are 250000, 115200, 57600"))
 setting('serial_baud_auto', '', int, 'machine', 'hidden')
 
+setting('toolhead', 'Default', str, 'machine', 'hidden').setLabel(_("Installed Tool Head"), _("Which tool head is currently installed. This setting is only used by LulzBot machines."))
+setting('toolhead_shortname', '', str, 'machine', 'hidden')
 setting('extruder_head_size_min_x', '0.0', float, 'machine', 'hidden').setLabel(_("Head size towards X min (mm)"), _("The head size when printing multiple objects, measured from the tip of the nozzle towards the outer part of the head."))
 setting('extruder_head_size_min_y', '0.0', float, 'machine', 'hidden').setLabel(_("Head size towards Y min (mm)"), _("The head size when printing multiple objects, measured from the tip of the nozzle towards the outer part of the head."))
 setting('extruder_head_size_max_x', '0.0', float, 'machine', 'hidden').setLabel(_("Head size towards X max (mm)"), _("The head size when printing multiple objects, measured from the tip of the nozzle towards the outer part of the head."))
@@ -1103,6 +1104,15 @@ def getMachineCount():
                return 1
        return n
 
+def getMachineName(index = None):
+       name = getMachineSetting('machine_name', index)
+       type = getMachineSetting('machine_type', index)
+       if type.startswith('lulzbot_'):
+               toolhead = getMachineSetting('toolhead_shortname', index)
+               if toolhead != '':
+                       return "%s (%s)" % (name, toolhead)
+       return name
+
 def setActiveMachine(index):
        global _selectedMachineIndex
        _selectedMachineIndex = index
@@ -1359,4 +1369,14 @@ def getAlterationFileContents(filename, extruderCount = 1):
        return unicode(prefix + re.sub("(.)\{([^\}]*)\}", replaceTagMatch, alterationContents).rstrip() + '\n' + postfix).strip().encode('utf-8') + '\n'
 
 def performVersionUpgrade():
-       pass
+       for n in xrange(0, getMachineCount()):
+               # This is a hack around an issue where the machine type in the wizard
+               # changed and causes some people to have it set to lulzbot_TAZ and some
+               # people have it set to lulzbot_TAZ_4.
+               if getMachineSetting('machine_type', n) == 'lulzbot_TAZ':
+                       putMachineSetting('machine_type', 'lulzbot_TAZ_4', n)
+
+               # Change TAZ print bed so prints are centered when scaled to the max
+               if getMachineSetting('machine_type', n).startswith('lulzbot_TAZ_') and \
+                       getMachineSetting('machine_width', n) == '298':
+                       putMachineSetting('machine_width', '290')