From df8207747a0fa9f00a90f515de31a3946b83eab9 Mon Sep 17 00:00:00 2001 From: Youness Alaoui Date: Mon, 18 Apr 2016 14:41:50 -0400 Subject: [PATCH 01/15] Force PYTHONPATH to be in the top of the sys.path list. This fixes https://github.com/Ultimaker/Cura/issues/704 --- cura_app.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cura_app.py b/cura_app.py index 853edabd5e..796ecd96a9 100755 --- a/cura_app.py +++ b/cura_app.py @@ -5,6 +5,15 @@ import sys +# It looks like setuptools creates a .pth file in +# the default /usr/lib which causes the default site-packages +# to be inserted into sys.path before PYTHONPATH. +# This can cause issues such as having libsip loaded from +# the system instead of the one provided with Cura, which causes +# incompatibility issues with libArcus +sys.path.insert(1, os.environ.get('PYTHONPATH', '')) + + def exceptHook(hook_type, value, traceback): import cura.CrashHandler cura.CrashHandler.show(hook_type, value, traceback) From a8e13f13ba2b837f7e39e2a69383e80559741f8c Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Tue, 19 Apr 2016 18:56:58 +0200 Subject: [PATCH 02/15] Add missing import of 'os' --- cura_app.py | 1 + 1 file changed, 1 insertion(+) diff --git a/cura_app.py b/cura_app.py index 796ecd96a9..2b24b2c664 100755 --- a/cura_app.py +++ b/cura_app.py @@ -3,6 +3,7 @@ # Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. +import os import sys # It looks like setuptools creates a .pth file in From 839bc1fec8b78188494ae9174218a20d10e4dbd2 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Tue, 19 Apr 2016 19:11:14 +0200 Subject: [PATCH 03/15] Making PR #708 more concrete Now a check is made whether PYTHONPATH is set at all. So 'normal' installations will pass that section. After that sys.path is checked whether the last element is PYTHONPATH. If it is PYTHONPATH will be moved before entry at sys.path[1], because sys.path[0] is os.curdir. Inserting PYTHONPATH in front of it might be unsave. --- cura_app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 2b24b2c664..aa09f22446 100755 --- a/cura_app.py +++ b/cura_app.py @@ -6,13 +6,17 @@ import os import sys +# WORKAROUND: GITHUB-704 GITHUB-708 # It looks like setuptools creates a .pth file in # the default /usr/lib which causes the default site-packages # to be inserted into sys.path before PYTHONPATH. # This can cause issues such as having libsip loaded from # the system instead of the one provided with Cura, which causes # incompatibility issues with libArcus -sys.path.insert(1, os.environ.get('PYTHONPATH', '')) +if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used + if sys.path[-1] == os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly at the end of sys.path. + sys.path.pop(-1) # If so remove that element.. + sys.path.insert(1, os.environ['PYTHONPATH']) # and add it at the correct place again. def exceptHook(hook_type, value, traceback): From e040029a410624a4e239ead892304c92a82b8bd4 Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Tue, 19 Apr 2016 19:18:05 +0200 Subject: [PATCH 04/15] Just a little typo --- cura_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index aa09f22446..afa3eb95df 100755 --- a/cura_app.py +++ b/cura_app.py @@ -15,7 +15,7 @@ import sys # incompatibility issues with libArcus if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used if sys.path[-1] == os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly at the end of sys.path. - sys.path.pop(-1) # If so remove that element.. + sys.path.pop(-1) # If so, remove that element.. sys.path.insert(1, os.environ['PYTHONPATH']) # and add it at the correct place again. From 102e13b152e678ab94db0adaa664796346d65010 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Tue, 19 Apr 2016 19:35:31 +0200 Subject: [PATCH 05/15] Doing the check the other way round.. --- cura_app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cura_app.py b/cura_app.py index aa09f22446..54d5d69b63 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,8 +14,8 @@ import sys # the system instead of the one provided with Cura, which causes # incompatibility issues with libArcus if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used - if sys.path[-1] == os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly at the end of sys.path. - sys.path.pop(-1) # If so remove that element.. + if sys.path[1] != os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly. + sys.path.remove(os.environ["PYTHONPATH"]) # If so remove that element.. sys.path.insert(1, os.environ['PYTHONPATH']) # and add it at the correct place again. From 98c84798c62cc94d29133f8935cbece4232f0071 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Tue, 19 Apr 2016 20:17:20 +0200 Subject: [PATCH 06/15] Making sure we got the realpath when using an absolute path --- cura_app.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cura_app.py b/cura_app.py index a2b29c92af..3561a3b06e 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,9 +14,10 @@ import sys # the system instead of the one provided with Cura, which causes # incompatibility issues with libArcus if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used - if sys.path[1] != os.environ["PYTHONPATH"]: # .. check whether PYTHONPATH is placed incorrectly. - sys.path.remove(os.environ["PYTHONPATH"]) # If so, remove that element.. - sys.path.insert(1, os.environ['PYTHONPATH']) # and add it at the correct place again. + PYTHONPATH_real = os.path.realpath(os.environ["PYTHONPATH"]) + if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly. + sys.path.remove(PYTHONPATH_real) # If so, remove that element.. + sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again. def exceptHook(hook_type, value, traceback): From 286673e812dc67a7311e6beffa146981ae2afb6a Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Tue, 19 Apr 2016 20:18:07 +0200 Subject: [PATCH 07/15] Making WORKAROUND a true marker --- cura_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 3561a3b06e..060abd5520 100755 --- a/cura_app.py +++ b/cura_app.py @@ -6,7 +6,7 @@ import os import sys -# WORKAROUND: GITHUB-704 GITHUB-708 +#WORKAROUND: GITHUB-704 GITHUB-708 # It looks like setuptools creates a .pth file in # the default /usr/lib which causes the default site-packages # to be inserted into sys.path before PYTHONPATH. From 61069e9a71c57a65eded4d9a9dc1213fd92e1d88 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Thu, 21 Apr 2016 17:34:33 +0200 Subject: [PATCH 08/15] Making the fix working with a list of PATHS seperated by os.pathsep Needs testing but should work. (fingers crossed) --- cura_app.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index 060abd5520..6c20910907 100755 --- a/cura_app.py +++ b/cura_app.py @@ -14,7 +14,13 @@ import sys # the system instead of the one provided with Cura, which causes # incompatibility issues with libArcus if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used - PYTHONPATH_real = os.path.realpath(os.environ["PYTHONPATH"]) + PYTHONPATH = os.environ["PYTHONPATH"] + PYTHONPATH = PYTHONPATH.split(os.pathsep) + PYTHONPATH_real = os.path.realpath(PYTHONPATH[0]) + PYTHONPATH = PYTHONPATH[1:] + while PYTHONPATH: + PYTHONPATH_real += ":%s" %(os.path.realpath(PYTHONPATH[0])) + PYTHONPATH = PYTHONPATH[1:] if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly. sys.path.remove(PYTHONPATH_real) # If so, remove that element.. sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again. From 1a5245416512441097b90104cecc8bf84e4b81b6 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Thu, 21 Apr 2016 19:09:15 +0200 Subject: [PATCH 09/15] This should be fine now.. --- cura_app.py | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/cura_app.py b/cura_app.py index 6c20910907..bd820337f2 100755 --- a/cura_app.py +++ b/cura_app.py @@ -13,18 +13,14 @@ import sys # This can cause issues such as having libsip loaded from # the system instead of the one provided with Cura, which causes # incompatibility issues with libArcus -if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used - PYTHONPATH = os.environ["PYTHONPATH"] - PYTHONPATH = PYTHONPATH.split(os.pathsep) - PYTHONPATH_real = os.path.realpath(PYTHONPATH[0]) - PYTHONPATH = PYTHONPATH[1:] - while PYTHONPATH: - PYTHONPATH_real += ":%s" %(os.path.realpath(PYTHONPATH[0])) - PYTHONPATH = PYTHONPATH[1:] - if sys.path[1] != PYTHONPATH_real: # .. check whether PYTHONPATH is placed incorrectly. - sys.path.remove(PYTHONPATH_real) # If so, remove that element.. - sys.path.insert(1, PYTHONPATH_real) # and add it at the correct place again. - +if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used + PYTHONPATH = os.environ["PYTHONPATH"].split(os.pathsep) # Get the value, split it.. + PYTHONPATH = PYTHONPATH.reverse() # and reverse it, because we always insert at 1 + for PATH in PYTHONPATH: # Now beginning with the last PATH + PATH_real = os.path.realpath(PATH) # Making the the path "real" + if PATH_real in sys.path: # This should always work, but keep it to be sure.. + sys.path.remove(PATH_real) + sys.path.insert(1, PATH_real) # Insert it at 1 before os.curdir, which is 0. def exceptHook(hook_type, value, traceback): import cura.CrashHandler From 3a61cf31523dc124a41c94802e7adc890f41db73 Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Thu, 21 Apr 2016 19:41:10 +0200 Subject: [PATCH 10/15] Little typo --- cura_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index bd820337f2..f7b03e273a 100755 --- a/cura_app.py +++ b/cura_app.py @@ -20,7 +20,7 @@ if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is u PATH_real = os.path.realpath(PATH) # Making the the path "real" if PATH_real in sys.path: # This should always work, but keep it to be sure.. sys.path.remove(PATH_real) - sys.path.insert(1, PATH_real) # Insert it at 1 before os.curdir, which is 0. + sys.path.insert(1, PATH_real) # Insert it at 1 after os.curdir, which is 0. def exceptHook(hook_type, value, traceback): import cura.CrashHandler From 7d2b329e78491c4bd8ab8ad84965de494906f55f Mon Sep 17 00:00:00 2001 From: Thomas-Karl Pietrowski Date: Thu, 21 Apr 2016 20:23:07 +0200 Subject: [PATCH 11/15] Just a stupid mistake .reverse() does not return anything (None) --- cura_app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura_app.py b/cura_app.py index f7b03e273a..dc748435f9 100755 --- a/cura_app.py +++ b/cura_app.py @@ -15,7 +15,7 @@ import sys # incompatibility issues with libArcus if "PYTHONPATH" in os.environ.keys(): # If PYTHONPATH is used PYTHONPATH = os.environ["PYTHONPATH"].split(os.pathsep) # Get the value, split it.. - PYTHONPATH = PYTHONPATH.reverse() # and reverse it, because we always insert at 1 + PYTHONPATH.reverse() # and reverse it, because we always insert at 1 for PATH in PYTHONPATH: # Now beginning with the last PATH PATH_real = os.path.realpath(PATH) # Making the the path "real" if PATH_real in sys.path: # This should always work, but keep it to be sure.. From 3c7ff49be304e33792c2a5b9569e744f3cb02650 Mon Sep 17 00:00:00 2001 From: zerr0 Date: Wed, 27 Apr 2016 13:19:36 +0500 Subject: [PATCH 12/15] Uniqbot by Unimatech machine profile --- resources/machines/uniqbot_one.json | 35 +++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 resources/machines/uniqbot_one.json diff --git a/resources/machines/uniqbot_one.json b/resources/machines/uniqbot_one.json new file mode 100644 index 0000000000..8f38039a19 --- /dev/null +++ b/resources/machines/uniqbot_one.json @@ -0,0 +1,35 @@ +{ + "id": "uniqbot_one", + "version": 1, + "name": "Uniqbot", + "manufacturer": "Unimatech", + "author": "Unimatech", + "icon": "icon_ultimaker2.png", + "file_formats": "text/x-gcode", + "inherits": "fdmprinter.json", + + "overrides": { + "machine_heated_bed": { "default": false }, + "machine_width": { "default": 140 }, + "machine_height": { "default": 120 }, + "machine_depth": { "default": 160 }, + "machine_center_is_zero": { "default": false }, + "machine_nozzle_size": { "default": 0.5 }, + "material_diameter": { "default": 1.75 }, + "machine_nozzle_heat_up_speed": { "default": 2.0 }, + "machine_nozzle_cool_down_speed": { "default": 2.0 }, + "machine_head_shape_min_x": { "default": 75 }, + "machine_head_shape_min_y": { "default": 18 }, + "machine_head_shape_max_x": { "default": 18 }, + "machine_head_shape_max_y": { "default": 35 }, + "machine_nozzle_gantry_distance": { "default": 55 }, + "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, + + "machine_start_gcode": { + "default": "G21 ;metric values\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nM107 ;start with the fan off\nG28 X0 Y0 ;move X/Y to min endstops\nG28 Z0 ;move Z to min endstops\nG1 Z15.0 F9000 ;move the platform down 15mm\nG92 E0 ;zero the extruded length\nG1 F200 E3 ;extrude 3mm of feed stock\nG92 E0 ;zero the extruded length again\nG1 F9000\n;Put printing message on LCD screen\nM117 Printing..." + }, + "machine_end_gcode": { + "default": "M104 S0 ;extruder heater off\nM140 S0 ;heated bed heater off (if you have it)\nG91 ;relative positioning\nG1 E-1 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure\nG1 Z+5 E-5 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more\nG28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way\nM84 ;steppers off\nG90 ;absolute positioning" + } + } +} From bc350cfe281d1b220cd2be3ed62d415b9d65a0f2 Mon Sep 17 00:00:00 2001 From: zerr0 Date: Thu, 28 Apr 2016 14:16:37 +0500 Subject: [PATCH 13/15] machine_head_shape_* removed --- resources/machines/uniqbot_one.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/resources/machines/uniqbot_one.json b/resources/machines/uniqbot_one.json index 8f38039a19..f07dae9b24 100644 --- a/resources/machines/uniqbot_one.json +++ b/resources/machines/uniqbot_one.json @@ -18,10 +18,6 @@ "material_diameter": { "default": 1.75 }, "machine_nozzle_heat_up_speed": { "default": 2.0 }, "machine_nozzle_cool_down_speed": { "default": 2.0 }, - "machine_head_shape_min_x": { "default": 75 }, - "machine_head_shape_min_y": { "default": 18 }, - "machine_head_shape_max_x": { "default": 18 }, - "machine_head_shape_max_y": { "default": 35 }, "machine_nozzle_gantry_distance": { "default": 55 }, "machine_gcode_flavor": { "default": "RepRap (Marlin/Sprinter)" }, From a176c6a977d099e9e92034008e7a522c5a465cc4 Mon Sep 17 00:00:00 2001 From: Tim Kuipers Date: Thu, 28 Apr 2016 12:30:03 +0200 Subject: [PATCH 14/15] JSON: fix for support roof vs infill speed visiblity --- resources/machines/fdmprinter.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/machines/fdmprinter.json b/resources/machines/fdmprinter.json index f0be309eaa..2751c69db2 100644 --- a/resources/machines/fdmprinter.json +++ b/resources/machines/fdmprinter.json @@ -912,7 +912,7 @@ "default": 60, "visible": false, "inherit_function": "speed_print", - "enabled": "support_enable", + "enabled": "support_roof_enable", "children": { "speed_support_infill": { "label": "Support Infill Speed", @@ -925,7 +925,7 @@ "max_value_warning": "150", "visible": false, "inherit": true, - "enabled": "support_roof_enable", + "enabled": "support_enable", "global_only": true }, "speed_support_roof": { From c810c22eb5687308145b1617b0d75e83cb9bab38 Mon Sep 17 00:00:00 2001 From: Simon Edwards Date: Thu, 28 Apr 2016 13:05:59 +0200 Subject: [PATCH 15/15] Set the default number of layers and current layer to 0. Now the layer view slider is empty while the initial slicing process is running. Fixes CURA-1273 Layer number doesn't fit --- plugins/LayerView/LayerView.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/LayerView/LayerView.py b/plugins/LayerView/LayerView.py index 97a2a0ab30..a98fab5c8a 100644 --- a/plugins/LayerView/LayerView.py +++ b/plugins/LayerView/LayerView.py @@ -34,8 +34,8 @@ class LayerView(View): self._layer_percentage = 0 # what percentage of layers need to be shown (SLider gives value between 0 - 100) self._proxy = LayerViewProxy.LayerViewProxy() self._controller.getScene().getRoot().childrenChanged.connect(self._onSceneChanged) - self._max_layers = 10 - self._current_layer_num = 10 + self._max_layers = 0 + self._current_layer_num = 0 self._current_layer_mesh = None self._current_layer_jumps = None self._top_layers_job = None