From fc8cbedc8291033d3e60e17fedb72b71acabc6d3 Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Tue, 26 Sep 2017 09:39:18 +0200 Subject: [PATCH 1/7] Sorting imports and removing superfluous import .. Logger has been imported twice.. --- .../RemovableDriveOutputDevice/RemovableDrivePlugin.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py index 2fbd554849..01211b3d44 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py @@ -1,15 +1,19 @@ # Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the AGPLv3 or higher. +# Python build-ins import threading import time +# Uranium/Messaging from UM.Message import Message -from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin from UM.Logger import Logger +# Uranium/IO +from UM.OutputDevice.OutputDevicePlugin import OutputDevicePlugin from . import RemovableDriveOutputDevice -from UM.Logger import Logger + +# Uranium/l18n from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") From 98e3f2bdb28068ab402ba0b8ecb02a2f357d51cf Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 26 Sep 2017 21:10:52 +0200 Subject: [PATCH 2/7] Add definitions for the Raise3D N2 series See https://ultimaker.com/en/community/51242-please-add-these-raise3d-printer-definitions for source and details. --- .../definitions/raise3D_N2_dual.def.json | 95 +++++++++++++++++++ .../definitions/raise3D_N2_plus_dual.def.json | 95 +++++++++++++++++++ .../raise3D_N2_plus_single.def.json | 87 +++++++++++++++++ .../definitions/raise3D_N2_single.def.json | 87 +++++++++++++++++ .../raise3D_N2_dual_extruder_0.def.json | 26 +++++ .../raise3D_N2_dual_extruder_1.def.json | 28 ++++++ .../raise3D_N2_plus_dual_extruder_0.def.json | 26 +++++ .../raise3D_N2_plus_dual_extruder_1.def.json | 28 ++++++ 8 files changed, 472 insertions(+) create mode 100644 resources/definitions/raise3D_N2_dual.def.json create mode 100644 resources/definitions/raise3D_N2_plus_dual.def.json create mode 100644 resources/definitions/raise3D_N2_plus_single.def.json create mode 100644 resources/definitions/raise3D_N2_single.def.json create mode 100644 resources/extruders/raise3D_N2_dual_extruder_0.def.json create mode 100644 resources/extruders/raise3D_N2_dual_extruder_1.def.json create mode 100644 resources/extruders/raise3D_N2_plus_dual_extruder_0.def.json create mode 100644 resources/extruders/raise3D_N2_plus_dual_extruder_1.def.json diff --git a/resources/definitions/raise3D_N2_dual.def.json b/resources/definitions/raise3D_N2_dual.def.json new file mode 100644 index 0000000000..d3d8f0e651 --- /dev/null +++ b/resources/definitions/raise3D_N2_dual.def.json @@ -0,0 +1,95 @@ +{ + "id": "raise3D_N2_dual", + "version": 2, + "name": "Raise3D N2 Dual", + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Raise3D", + "manufacturer": "Raise3D", + "category": "Other", + "file_formats": "text/x-gcode", + "has_materials": true, + "machine_extruder_trains": + { + "0": "raise3D_N2_dual_extruder_0", + "1": "raise3D_N2_dual_extruder_1" + } + }, + + "overrides": { + "machine_name": { "default_value": "Raise3D N2 Dual" }, + "machine_width": { + "default_value": 305 + }, + "machine_height": { + "default_value": 305 + }, + "machine_depth": { + "default_value": 305 + }, + "machine_center_is_zero": { + "default_value": false + }, + "machine_heated_bed": { + "default_value": true + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "machine_nozzle_heat_up_speed": { + "default_value": 6 + }, + "machine_nozzle_cool_down_speed": { + "default_value": 4 + }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [ -75, 35 ], + [ -75, -18 ], + [ 18, 35 ], + [ 18, -18 ] + ] + }, + "machine_min_cool_heat_time_window": { + "default_value": 3600 + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "material_diameter": { + "default_value": 1.75 + }, + "retraction_amount": { + "default_value": 1.0 + }, + "adhesion_type": { + "default_value": "skirt" + }, + "gantry_height": { + "default_value": 55 + }, + "machine_use_extruder_offset_to_offset_coords": { + "default_value": true + }, + "machine_gcode_flavor": { + "default_value": "RepRap (Marlin/Sprinter)" + }, + "machine_start_gcode": { + "default_value": "G90\nG21\n; home all axes\nG28\nG92 X0 Y0 Z0\n; move heatbed into position\nG1 X20.0 Y20.0 Z1.0 F1000\n; zero extruders\nG92 E0 E1\nT0; right tool\n; set extruder steps per mm\nM92 E140\nT1; left tool\n; set extruder steps per mm\nM92 E140\nT0; left tool\nG92 E0 E1\n; purge nozzle\nG1 E25 F250\nT1; left tool\nG92 E0 E1\n; purge nozzle\nG1 E25 F250\n; zero extruders\nG92 E0 E1\n; move heatbed down a little more\nG1 Z5.0 F20\n; wait 600ms\nG4 600\n; move to tack down the strands\nG1 X20.0 Y30.0 Z0 F9000\n; wait 600ms\nG4 600\n;move up a bit\nG1 Z5.0 F9000\n; wait 300ms\nG4 300\n;fast move to center\nG1 X152.5 Y152.5 F9000\nT0\n;Raise3D Job Start\nM117 Printing…\nM1001\n" + }, + "machine_end_gcode": { + "default_value": "M107\nM1002\nM104 S0 T1\nM104 S0 T0\nM140 S0\nM117 Print Complete.\nG28 X0 Y0\nG91\nG1 Z10\nG90\nM84" + }, + "machine_extruder_count": { + "default_value": 2 + }, + "prime_tower_position_x": { + "default_value": 195 + }, + "prime_tower_position_y": { + "default_value": 149 + } + } +} diff --git a/resources/definitions/raise3D_N2_plus_dual.def.json b/resources/definitions/raise3D_N2_plus_dual.def.json new file mode 100644 index 0000000000..f49af40355 --- /dev/null +++ b/resources/definitions/raise3D_N2_plus_dual.def.json @@ -0,0 +1,95 @@ +{ + "id": "raise3D_N2_plus_dual", + "version": 2, + "name": "Raise3D N2 Plus Dual", + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Raise3D", + "manufacturer": "Raise3D", + "category": "Other", + "file_formats": "text/x-gcode", + "has_materials": true, + "machine_extruder_trains": + { + "0": "raise3D_N2_plus_dual_extruder_0", + "1": "raise3D_N2_plus_dual_extruder_1" + } + }, + + "overrides": { + "machine_name": { "default_value": "Raise3D N2 Plus Dual" }, + "machine_width": { + "default_value": 305 + }, + "machine_height": { + "default_value": 610 + }, + "machine_depth": { + "default_value": 305 + }, + "machine_center_is_zero": { + "default_value": false + }, + "machine_heated_bed": { + "default_value": true + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "machine_nozzle_heat_up_speed": { + "default_value": 6 + }, + "machine_nozzle_cool_down_speed": { + "default_value": 4 + }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [ -75, 35 ], + [ -75, -18 ], + [ 18, 35 ], + [ 18, -18 ] + ] + }, + "machine_min_cool_heat_time_window": { + "default_value": 3600 + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "material_diameter": { + "default_value": 1.75 + }, + "retraction_amount": { + "default_value": 1.0 + }, + "adhesion_type": { + "default_value": "skirt" + }, + "gantry_height": { + "default_value": 55 + }, + "machine_use_extruder_offset_to_offset_coords": { + "default_value": true + }, + "machine_gcode_flavor": { + "default_value": "RepRap (Marlin/Sprinter)" + }, + "machine_start_gcode": { + "default_value": "G90\nG21\n; home all axes\nG28\nG92 X0 Y0 Z0\n; move heatbed into position\nG1 X20.0 Y20.0 Z1.0 F1000\n; zero extruders\nG92 E0 E1\nT0; right tool\n; set extruder steps per mm\nM92 E140\nT1; left tool\n; set extruder steps per mm\nM92 E140\nT0; left tool\nG92 E0 E1\n; purge nozzle\nG1 E25 F250\nT1; left tool\nG92 E0 E1\n; purge nozzle\nG1 E25 F250\n; zero extruders\nG92 E0 E1\n; move heatbed down a little more\nG1 Z5.0 F20\n; wait 600ms\nG4 600\n; move to tack down the strands\nG1 X20.0 Y30.0 Z0 F9000\n; wait 600ms\nG4 600\n;move up a bit\nG1 Z5.0 F9000\n; wait 300ms\nG4 300\n;fast move to center\nG1 X152.5 Y152.5 F9000\nT0\n;Raise3D Job Start\nM117 Printing…\nM1001\n" + }, + "machine_end_gcode": { + "default_value": "M107\nM1002\nM104 S0 T1\nM104 S0 T0\nM140 S0\nM117 Print Complete.\nG28 X0 Y0\nG91\nG1 Z10\nG90\nM84" + }, + "machine_extruder_count": { + "default_value": 2 + }, + "prime_tower_position_x": { + "default_value": 195 + }, + "prime_tower_position_y": { + "default_value": 149 + } + } +} diff --git a/resources/definitions/raise3D_N2_plus_single.def.json b/resources/definitions/raise3D_N2_plus_single.def.json new file mode 100644 index 0000000000..5f10666528 --- /dev/null +++ b/resources/definitions/raise3D_N2_plus_single.def.json @@ -0,0 +1,87 @@ +{ + "id": "raise3D_N2_plus_single", + "version": 2, + "name": "Raise3D N2 Plus Single", + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Raise3D", + "manufacturer": "Raise3D", + "category": "Other", + "file_formats": "text/x-gcode", + "has_materials": true + }, + + "overrides": { + "machine_name": { "default_value": "Raise3D N2 Plus Single" }, + "machine_width": { + "default_value": 305 + }, + "machine_height": { + "default_value": 610 + }, + "machine_depth": { + "default_value": 305 + }, + "machine_center_is_zero": { + "default_value": false + }, + "machine_heated_bed": { + "default_value": true + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "machine_nozzle_heat_up_speed": { + "default_value": 6 + }, + "machine_nozzle_cool_down_speed": { + "default_value": 4 + }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [ -75, 35 ], + [ -75, -18 ], + [ 18, 35 ], + [ 18, -18 ] + ] + }, + "machine_min_cool_heat_time_window": { + "default_value": 3600 + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "material_diameter": { + "default_value": 1.75 + }, + "retraction_amount": { + "default_value": 1.0 + }, + "adhesion_type": { + "default_value": "skirt" + }, + "gantry_height": { + "default_value": 55 + }, + "machine_use_extruder_offset_to_offset_coords": { + "default_value": true + }, + "machine_gcode_flavor": { + "default_value": "RepRap (Marlin/Sprinter)" + }, + "machine_start_gcode": { + "default_value": "G90\nG21\n; home all axes\nG28\nG92 X0 Y0 Z0\n; move heatbed into position\nG1 X20.0 Y20.0 Z1.0 F1000\n; zero extruders\nG92 E0 E1\nT0; right tool\n; set extruder steps per mm\nM92 E140\n; purge nozzle\nG1 E25 F250\n; zero extruders\nG92 E0 E1\n; move heatbed down a little more\nG1 Z5.0 F20\n; wait 600ms\nG4 600\n; move to tack down the strands\nG1 X20.0 Y30.0 Z0 F9000\n; wait 600ms\nG4 600\n;move up a bit\nG1 Z5.0 F9000\n; wait 300ms\nG4 300\n;fast move to center\nG1 X152.5 Y152.5 F9000\nT0\n;Raise3D Job Start\nM117 Printing…\nM1001\n" + }, + "machine_end_gcode": { + "default_value": "M107\nM1002\nM104 S0 T1\nM104 S0 T0\nM140 S0\nM117 Print Complete.\nG28 X0 Y0\nG91\nG1 Z10\nG90\nM84" + }, + "prime_tower_position_x": { + "default_value": 195 + }, + "prime_tower_position_y": { + "default_value": 149 + } + } +} diff --git a/resources/definitions/raise3D_N2_single.def.json b/resources/definitions/raise3D_N2_single.def.json new file mode 100644 index 0000000000..225794130c --- /dev/null +++ b/resources/definitions/raise3D_N2_single.def.json @@ -0,0 +1,87 @@ +{ + "id": "raise3D_N2_single", + "version": 2, + "name": "Raise3D N2 Single", + "inherits": "fdmprinter", + "metadata": { + "visible": true, + "author": "Raise3D", + "manufacturer": "Raise3D", + "category": "Other", + "file_formats": "text/x-gcode", + "has_materials": true + }, + + "overrides": { + "machine_name": { "default_value": "Raise3D N2 Single" }, + "machine_width": { + "default_value": 305 + }, + "machine_height": { + "default_value": 305 + }, + "machine_depth": { + "default_value": 305 + }, + "machine_center_is_zero": { + "default_value": false + }, + "machine_heated_bed": { + "default_value": true + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "machine_nozzle_heat_up_speed": { + "default_value": 6 + }, + "machine_nozzle_cool_down_speed": { + "default_value": 4 + }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [ -75, 35 ], + [ -75, -18 ], + [ 18, 35 ], + [ 18, -18 ] + ] + }, + "machine_min_cool_heat_time_window": { + "default_value": 3600 + }, + "machine_nozzle_size": { + "default_value": 0.4 + }, + "material_diameter": { + "default_value": 1.75 + }, + "retraction_amount": { + "default_value": 1.0 + }, + "adhesion_type": { + "default_value": "skirt" + }, + "gantry_height": { + "default_value": 55 + }, + "machine_use_extruder_offset_to_offset_coords": { + "default_value": true + }, + "machine_gcode_flavor": { + "default_value": "RepRap (Marlin/Sprinter)" + }, + "machine_start_gcode": { + "default_value": "G90\nG21\n; home all axes\nG28\nG92 X0 Y0 Z0\n; move heatbed into position\nG1 X20.0 Y20.0 Z1.0 F1000\n; zero extruders\nG92 E0 E1\nT0; right tool\n; set extruder steps per mm\nM92 E140\n; purge nozzle\nG1 E25 F250\n; zero extruders\nG92 E0 E1\n; move heatbed down a little more\nG1 Z5.0 F20\n; wait 600ms\nG4 600\n; move to tack down the strands\nG1 X20.0 Y30.0 Z0 F9000\n; wait 600ms\nG4 600\n;move up a bit\nG1 Z5.0 F9000\n; wait 300ms\nG4 300\n;fast move to center\nG1 X152.5 Y152.5 F9000\nT0\n;Raise3D Job Start\nM117 Printing…\nM1001\n" + }, + "machine_end_gcode": { + "default_value": "M107\nM1002\nM104 S0 T1\nM104 S0 T0\nM140 S0\nM117 Print Complete.\nG28 X0 Y0\nG91\nG1 Z10\nG90\nM84" + }, + "prime_tower_position_x": { + "default_value": 195 + }, + "prime_tower_position_y": { + "default_value": 149 + } + } +} diff --git a/resources/extruders/raise3D_N2_dual_extruder_0.def.json b/resources/extruders/raise3D_N2_dual_extruder_0.def.json new file mode 100644 index 0000000000..330d016c55 --- /dev/null +++ b/resources/extruders/raise3D_N2_dual_extruder_0.def.json @@ -0,0 +1,26 @@ +{ + "id": "raise3D_N2_dual_extruder_0", + "version": 2, + "name": "Left Extruder", + "inherits": "fdmextruder", + "metadata": { + "machine": "raise3D_N2_dual", + "position": "0" + }, + + "overrides": { + "extruder_nr": { + "default_value": 0, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 0 }, + "machine_nozzle_offset_y": { "default_value": 0 }, + + "machine_extruder_start_pos_abs": { "default_value": true }, + "machine_extruder_start_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_start_pos_y": { "value": "prime_tower_position_y" }, + "machine_extruder_end_pos_abs": { "default_value": true }, + "machine_extruder_end_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_end_pos_y": { "value": "prime_tower_position_y" } + } +} diff --git a/resources/extruders/raise3D_N2_dual_extruder_1.def.json b/resources/extruders/raise3D_N2_dual_extruder_1.def.json new file mode 100644 index 0000000000..f79033e496 --- /dev/null +++ b/resources/extruders/raise3D_N2_dual_extruder_1.def.json @@ -0,0 +1,28 @@ +{ + "id": "raise3D_N2_dual_extruder_1", + "version": 2, + "name": "Right Extruder", + "inherits": "fdmextruder", + "metadata": { + "machine": "raise3D_N2_dual", + "position": "1" + }, + + "overrides": { + "extruder_nr": { + "default_value": 1, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 24.8 }, + "machine_nozzle_offset_y": { "default_value": 0.6 }, + + "machine_extruder_start_pos_abs": { "default_value": true }, + "machine_extruder_start_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_start_pos_y": { "value": "prime_tower_position_y" }, + "machine_extruder_end_pos_abs": { "default_value": true }, + "machine_extruder_end_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_end_pos_y": { "value": "prime_tower_position_y" } + } +} + + diff --git a/resources/extruders/raise3D_N2_plus_dual_extruder_0.def.json b/resources/extruders/raise3D_N2_plus_dual_extruder_0.def.json new file mode 100644 index 0000000000..f105dcbaf9 --- /dev/null +++ b/resources/extruders/raise3D_N2_plus_dual_extruder_0.def.json @@ -0,0 +1,26 @@ +{ + "id": "raise3D_N2_plus_dual_extruder_0", + "version": 2, + "name": "Left Extruder", + "inherits": "fdmextruder", + "metadata": { + "machine": "raise3D_N2_plus_dual", + "position": "0" + }, + + "overrides": { + "extruder_nr": { + "default_value": 0, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 0 }, + "machine_nozzle_offset_y": { "default_value": 0 }, + + "machine_extruder_start_pos_abs": { "default_value": true }, + "machine_extruder_start_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_start_pos_y": { "value": "prime_tower_position_y" }, + "machine_extruder_end_pos_abs": { "default_value": true }, + "machine_extruder_end_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_end_pos_y": { "value": "prime_tower_position_y" } + } +} diff --git a/resources/extruders/raise3D_N2_plus_dual_extruder_1.def.json b/resources/extruders/raise3D_N2_plus_dual_extruder_1.def.json new file mode 100644 index 0000000000..b0fa1b51d0 --- /dev/null +++ b/resources/extruders/raise3D_N2_plus_dual_extruder_1.def.json @@ -0,0 +1,28 @@ +{ + "id": "raise3D_N2_plus_dual_extruder_1", + "version": 2, + "name": "Right Extruder", + "inherits": "fdmextruder", + "metadata": { + "machine": "raise3D_N2_plus_dual", + "position": "1" + }, + + "overrides": { + "extruder_nr": { + "default_value": 1, + "maximum_value": "1" + }, + "machine_nozzle_offset_x": { "default_value": 24.8 }, + "machine_nozzle_offset_y": { "default_value": 0.6 }, + + "machine_extruder_start_pos_abs": { "default_value": true }, + "machine_extruder_start_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_start_pos_y": { "value": "prime_tower_position_y" }, + "machine_extruder_end_pos_abs": { "default_value": true }, + "machine_extruder_end_pos_x": { "value": "prime_tower_position_x" }, + "machine_extruder_end_pos_y": { "value": "prime_tower_position_y" } + } +} + + From b142a152669a3204dd25782382d9e8951a6bed6a Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 4 Oct 2017 14:59:39 +0200 Subject: [PATCH 3/7] Remove unused import And fixed the header and documentation spelling. --- plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py index ac20f572be..d59d1296e3 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDrivePlugin.py @@ -1,12 +1,11 @@ -# Copyright (c) 2015 Ultimaker B.V. -# Uranium is released under the terms of the LGPLv3 or higher. +# Copyright (c) 2017 Ultimaker B.V. +# Cura is released under the terms of the LGPLv3 or higher. -# Python build-ins +# Python built-ins import threading import time # Uranium/Messaging -from UM.Message import Message from UM.Logger import Logger # Uranium/IO From d458fcde5c22e57b9fc8cd210478e10e7e37e890 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 5 Oct 2017 10:58:49 +0200 Subject: [PATCH 4/7] Revert "Revert "Merge branch 'fix_garbled_fonts_macos' into 3.0"" This reverts commit e07e7bc9e714843cf853f0a255ee5a8432696886. Contributes to issue CURA-4414. --- .gitignore | 2 ++ cura/ConvexHullDecorator.py | 2 +- plugins/3MFReader/WorkspaceDialog.qml | 2 +- plugins/LayerView/LayerView.qml | 9 +++++-- plugins/PluginBrowser/PluginBrowser.qml | 2 +- .../UM3NetworkPrinting/DiscoverUM3Action.qml | 2 +- .../NetworkPrinterOutputDevice.py | 27 +++++++++++++++++++ .../NetworkPrinterOutputDevicePlugin.py | 7 ++++- .../UM3NetworkPrinting/OpenPanelButton.qml | 2 +- plugins/USBPrinting/USBPrinterOutputDevice.py | 3 ++- resources/definitions/fdmprinter.def.json | 24 ++++++++++++++++- resources/qml/Sidebar.qml | 6 ++--- 12 files changed, 75 insertions(+), 13 deletions(-) diff --git a/.gitignore b/.gitignore index 616d325ffb..5a077bd6b2 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,6 @@ cmake_install.cmake #Debug *.gcode run.sh +.scannerwork/ +CuraEngine diff --git a/cura/ConvexHullDecorator.py b/cura/ConvexHullDecorator.py index 8726ecb6e6..bfeb690192 100644 --- a/cura/ConvexHullDecorator.py +++ b/cura/ConvexHullDecorator.py @@ -266,7 +266,7 @@ class ConvexHullDecorator(SceneNodeDecorator): if self._getSettingProperty("mold_enabled", "value"): mold_width = self._getSettingProperty("mold_width", "value") hull_offset = horizontal_expansion + mold_width - if hull_offset != 0: + if hull_offset > 0: #TODO: Implement Minkowski subtraction for if the offset < 0. expansion_polygon = Polygon(numpy.array([ [-hull_offset, -hull_offset], [-hull_offset, hull_offset], diff --git a/plugins/3MFReader/WorkspaceDialog.qml b/plugins/3MFReader/WorkspaceDialog.qml index dc3b5f7823..ea07a1714d 100644 --- a/plugins/3MFReader/WorkspaceDialog.qml +++ b/plugins/3MFReader/WorkspaceDialog.qml @@ -362,7 +362,7 @@ UM.Dialog Label { id: warningLabel - text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the buildplate") + text: catalog.i18nc("@action:warning", "Loading a project will clear all models on the build plate.") wrapMode: Text.Wrap } } diff --git a/plugins/LayerView/LayerView.qml b/plugins/LayerView/LayerView.qml index 7b2b7ac2c2..5939102e65 100755 --- a/plugins/LayerView/LayerView.qml +++ b/plugins/LayerView/LayerView.qml @@ -1,7 +1,7 @@ // Copyright (c) 2017 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.4 import QtQuick.Controls 1.2 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 @@ -602,7 +602,7 @@ Item anchors.leftMargin: UM.Theme.getSize("default_margin").width / 2; anchors.verticalCenter: parent.verticalCenter; - width: Math.max(UM.Theme.getSize("line").width * maxValue.length + 2 * screenScaleFactor, 20 * screenScaleFactor); + width: fontMetrics.averageCharacterWidth * (maxValue.length) + UM.Theme.getSize("default_margin").width; style: TextFieldStyle { textColor: UM.Theme.getColor("setting_control_text"); @@ -630,4 +630,9 @@ Item } } } + + FontMetrics { + id: fontMetrics + font: UM.Theme.getFont("default") + } } diff --git a/plugins/PluginBrowser/PluginBrowser.qml b/plugins/PluginBrowser/PluginBrowser.qml index cbb60aed70..71e88c652b 100644 --- a/plugins/PluginBrowser/PluginBrowser.qml +++ b/plugins/PluginBrowser/PluginBrowser.qml @@ -217,7 +217,7 @@ UM.Dialog anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right - text: licenseDialog.pluginName + catalog.i18nc("@label", " plugin contains a license.\nYou need to accept this license to install this plugin.\nDo you agree with the terms below?") + text: licenseDialog.pluginName + catalog.i18nc("@label", "This plugin contains a license.\nYou need to accept this license to install this plugin.\nDo you agree with the terms below?") wrapMode: Text.Wrap } diff --git a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml index b1964c6c06..1bcbd1c4b9 100644 --- a/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml +++ b/plugins/UM3NetworkPrinting/DiscoverUM3Action.qml @@ -378,7 +378,7 @@ Cura.MachineAction }, Button { id: btnOk - text: catalog.i18nc("@action:button", "Ok") + text: catalog.i18nc("@action:button", "OK") onClicked: { manualPrinterDialog.accept() diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py index a3df717a67..5e608120ab 100755 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevice.py @@ -27,6 +27,7 @@ import zlib from time import time from time import sleep +from time import gmtime i18n_catalog = i18nCatalog("cura") @@ -1132,6 +1133,11 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): else: Logger.log("w", "Unable to save authentication for id %s and key %s", self._authentication_id, self._getSafeAuthKey()) + # Request 'system' printer data once, when we know we have authentication, so we know we can set the system time. + url = QUrl("http://" + self._address + self._api_prefix + "system") + system_data_request = QNetworkRequest(url) + self._manager.get(system_data_request) + else: # Got a response that we didn't expect, so something went wrong. Logger.log("e", "While trying to authenticate, we got an unexpected response: %s", reply.attribute(QNetworkRequest.HttpStatusCodeAttribute)) self.setAuthenticationState(AuthState.NotAuthenticated) @@ -1151,6 +1157,27 @@ class NetworkPrinterOutputDevice(PrinterOutputDevice): else: pass + elif self._api_prefix + "system" in reply_url: + # Check if the printer has time, and if this has a valid system time. + try: + data = json.loads(bytes(reply.readAll()).decode("utf-8")) + except json.decoder.JSONDecodeError: + Logger.log("w", "Received an invalid authentication request reply from printer: Not valid JSON.") + return + if "time" in data and "utc" in data["time"]: + try: + printer_time = gmtime(float(data["time"]["utc"])) + Logger.log("i", "Printer has system time of: %s", str(printer_time)) + except ValueError: + printer_time = None + if printer_time is not None and printer_time.tm_year < 1990: + # The system time is not valid, sync our current system time to it, so we at least have some reasonable time in the printer. + Logger.log("w", "Printer system time invalid, setting system time") + url = QUrl("http://" + self._address + self._api_prefix + "system/time/utc") + put_request = QNetworkRequest(url) + put_request.setHeader(QNetworkRequest.ContentTypeHeader, "application/json") + self._manager.put(put_request, str(time()).encode()) + elif reply.operation() == QNetworkAccessManager.PostOperation: if "/auth/request" in reply_url: # We got a response to requesting authentication. diff --git a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py index 0ed745d9d8..e4d554b2fa 100644 --- a/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py +++ b/plugins/UM3NetworkPrinting/NetworkPrinterOutputDevicePlugin.py @@ -31,6 +31,7 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin): self._zero_conf = None self._browser = None self._printers = {} + self._cluster_printers_seen = {} # do not forget a cluster printer when we have seen one, to not 'downgrade' from Connect to legacy printer self._api_version = "1" self._api_prefix = "/api/v" + self._api_version + "/" @@ -218,12 +219,16 @@ class NetworkPrinterOutputDevicePlugin(QObject, OutputDevicePlugin): ## Because the model needs to be created in the same thread as the QMLEngine, we use a signal. def addPrinter(self, name, address, properties, force_cluster=False): cluster_size = int(properties.get(b"cluster_size", -1)) - if force_cluster or cluster_size >= 0: + was_cluster_before = name in self._cluster_printers_seen + if was_cluster_before: + Logger.log("d", "Printer [%s] had Cura Connect before, so assume it's still equipped with Cura Connect.", name) + if force_cluster or cluster_size >= 0 or was_cluster_before: printer = NetworkClusterPrinterOutputDevice.NetworkClusterPrinterOutputDevice( name, address, properties, self._api_prefix, self._plugin_path) else: printer = NetworkPrinterOutputDevice.NetworkPrinterOutputDevice(name, address, properties, self._api_prefix) self._printers[printer.getKey()] = printer + self._cluster_printers_seen[printer.getKey()] = name # Cluster printers that may be temporary unreachable or is rebooted keep being stored here global_container_stack = Application.getInstance().getGlobalContainerStack() if global_container_stack and printer.getKey() == global_container_stack.getMetaDataEntry("um_network_key"): if printer.getKey() not in self._old_printers: # Was the printer already connected, but a re-scan forced? diff --git a/plugins/UM3NetworkPrinting/OpenPanelButton.qml b/plugins/UM3NetworkPrinting/OpenPanelButton.qml index a06a97f8f9..4bc1728f76 100644 --- a/plugins/UM3NetworkPrinting/OpenPanelButton.qml +++ b/plugins/UM3NetworkPrinting/OpenPanelButton.qml @@ -11,7 +11,7 @@ Button { UM.I18nCatalog { id: catalog; name: "cura"; } height: UM.Theme.getSize("save_button_save_to_button").height - tooltip: catalog.i18nc("@info:tooltip", "Opens the print jobs page with your default web browser.") + tooltip: catalog.i18nc("@info:tooltip", "Opens the print jobs page with your default web browser.") text: catalog.i18nc("@action:button", "View print jobs") // FIXME: This button style is copied and duplicated from SaveButton.qml diff --git a/plugins/USBPrinting/USBPrinterOutputDevice.py b/plugins/USBPrinting/USBPrinterOutputDevice.py index 06efd4d55b..3b9603cc1b 100644 --- a/plugins/USBPrinting/USBPrinterOutputDevice.py +++ b/plugins/USBPrinting/USBPrinterOutputDevice.py @@ -119,7 +119,8 @@ class USBPrinterOutputDevice(PrinterOutputDevice): self._sendCommand("G0 Y%s F%s" % (z, speed)) def _homeHead(self): - self._sendCommand("G28") + self._sendCommand("G28 X") + self._sendCommand("G28 Y") def _homeBed(self): self._sendCommand("G28 Z") diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 06bc04b1fe..5bc323dfbe 100755 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1405,6 +1405,28 @@ "limit_to_extruder": "infill_extruder_nr", "settable_per_mesh": true }, + "infill_offset_x": + { + "label": "Infill X Offset", + "description": "The infill pattern is offset this distance along the X axis.", + "unit": "mm", + "type": "float", + "default_value": 0, + "enabled": "infill_pattern == 'grid' or infill_pattern == 'lines' or infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'tetrahedral' or infill_pattern == 'quarter_cubic' or infill_pattern == 'zigzag'", + "limit_to_extruder": "infill_extruder_nr", + "settable_per_mesh": true + }, + "infill_offset_y": + { + "label": "Infill Y Offset", + "description": "The infill pattern is offset this distance along the Y axis.", + "unit": "mm", + "type": "float", + "default_value": 0, + "enabled": "infill_pattern == 'grid' or infill_pattern == 'lines' or infill_pattern == 'triangles' or infill_pattern == 'cubic' or infill_pattern == 'tetrahedral' or infill_pattern == 'quarter_cubic' or infill_pattern == 'zigzag'", + "limit_to_extruder": "infill_extruder_nr", + "settable_per_mesh": true + }, "sub_div_rad_add": { "label": "Cubic Subdivision Shell", @@ -3986,7 +4008,7 @@ "skirt_gap": { "label": "Skirt Distance", - "description": "The horizontal distance between the skirt and the first layer of the print.\nThis is the minimum distance, multiple skirt lines will extend outwards from this distance.", + "description": "The horizontal distance between the skirt and the first layer of the print.\nThis is the minimum distance. Multiple skirt lines will extend outwards from this distance.", "unit": "mm", "type": "float", "default_value": 3, diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index b1c5008d38..99948fc4fc 100755 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -324,7 +324,7 @@ Rectangle anchors.bottom: timeSpecDescription.top font: UM.Theme.getFont("large") color: UM.Theme.getColor("text_subtext") - text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) + text: (!base.printDuration || !base.printDuration.valid) ? catalog.i18nc("@label Hours and minutes", "00h 00min") : base.printDuration.getDisplayString(UM.DurationFormat.Short) MouseArea { @@ -407,12 +407,12 @@ Rectangle } if(someCostsKnown) { - return catalog.i18nc("@label", "%1m / ~ %2g / ~ %4 %3").arg(lengths.join(" + ")) + return catalog.i18nc("@label Print estimates: m for meters, g for grams, %4 is currency and %3 is print cost", "%1m / ~ %2g / ~ %4 %3").arg(lengths.join(" + ")) .arg(weights.join(" + ")).arg(costs.join(" + ")).arg(UM.Preferences.getValue("cura/currency")); } else { - return catalog.i18nc("@label", "%1m / ~ %2g").arg(lengths.join(" + ")).arg(weights.join(" + ")); + return catalog.i18nc("@label Print estimates: m for meters, g for grams", "%1m / ~ %2g").arg(lengths.join(" + ")).arg(weights.join(" + ")); } } } From 22889976979967e991b43a0f7bf2989ca12fa712 Mon Sep 17 00:00:00 2001 From: "A.Sasin" Date: Fri, 6 Oct 2017 18:56:17 +0200 Subject: [PATCH 5/7] Fixed: while project loading pass call upgrade plugin for preferences CURA-4344 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 7e185c8d9f..ad52b55163 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -304,7 +304,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): num_visible_settings = 0 try: temp_preferences = Preferences() - temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks. + serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8") + temp_preferences.deserialize(serialized) visible_settings_string = temp_preferences.getValue("general/visible_settings") if visible_settings_string is not None: @@ -407,7 +408,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # Create a shadow copy of the preferences (we don't want all of the preferences, but we do want to re-use its # parsing code. temp_preferences = Preferences() - temp_preferences.readFromFile(io.TextIOWrapper(archive.open("Cura/preferences.cfg"))) # We need to wrap it, else the archive parser breaks. + serialized = archive.open("Cura/preferences.cfg").read().decode("utf-8") + temp_preferences.deserialize(serialized) # Copy a number of settings from the temp preferences to the global global_preferences = Preferences.getInstance() From 2e957069a8b4bf102034c578982c62fd44942c5a Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 9 Oct 2017 11:58:00 +0200 Subject: [PATCH 6/7] first hide the dialog then release the lock CURA-4405 --- plugins/3MFReader/WorkspaceDialog.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 6acccbb1bc..7c803486eb 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -276,8 +276,8 @@ class WorkspaceDialog(QObject): def hide(self): self._visible = False - self._lock.release() self._view.hide() + self._lock.release() @pyqtSlot() def onOkButtonClicked(self): From 91e8e5812b40e69c8abd1ebcfb80d548e738f54f Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 10 Oct 2017 09:24:48 +0200 Subject: [PATCH 7/7] add back missing function --- plugins/3MFReader/WorkspaceDialog.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/plugins/3MFReader/WorkspaceDialog.py b/plugins/3MFReader/WorkspaceDialog.py index 349dec177b..5e5eaf985e 100644 --- a/plugins/3MFReader/WorkspaceDialog.py +++ b/plugins/3MFReader/WorkspaceDialog.py @@ -285,6 +285,14 @@ class WorkspaceDialog(QObject): except: pass + @pyqtSlot(bool) + def _onVisibilityChanged(self, visible): + if not visible: + try: + self._lock.release() + except: + pass + @pyqtSlot() def onOkButtonClicked(self): self._view.hide()