Browse Source

Merge remote-tracking branch 'origin/master' into refactoring_machine_manager

Lipu Fei 7 years ago
parent
commit
a29a6122f1

+ 1 - 0
cura/BuildVolume.py

@@ -826,6 +826,7 @@ class BuildVolume(SceneNode):
             offset_y = extruder.getProperty("machine_nozzle_offset_y", "value")
             if offset_y is None:
                 offset_y = 0
+            offset_y = -offset_y #Y direction of g-code is the inverse of Y direction of Cura's scene space.
             result[extruder_id] = []
 
             for polygon in machine_disallowed_polygons:

+ 22 - 4
cura/Settings/SettingOverrideDecorator.py

@@ -3,12 +3,14 @@
 
 import copy
 
+from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
 from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
 from UM.Signal import Signal, signalemitter
 from UM.Settings.InstanceContainer import InstanceContainer
 from UM.Settings.ContainerRegistry import ContainerRegistry
 from UM.Logger import Logger
-
+from UM.Settings.Validator import ValidatorState
+from PyQt5.QtCore import QTimer
 from UM.Application import Application
 
 from cura.Settings.PerObjectContainerStack import PerObjectContainerStack
@@ -38,6 +40,10 @@ class SettingOverrideDecorator(SceneNodeDecorator):
         self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId()
 
         self._is_non_printing_mesh = False
+        self._error_check_timer = QTimer()
+        self._error_check_timer.setInterval(250)
+        self._error_check_timer.setSingleShot(True)
+        self._error_check_timer.timeout.connect(self._checkStackForErrors)
 
         self._stack.propertyChanged.connect(self._onSettingChanged)
 
@@ -93,9 +99,21 @@ class SettingOverrideDecorator(SceneNodeDecorator):
         # Trigger slice/need slicing if the value has changed.
         if property_name == "value":
             self._is_non_printing_mesh = any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_printing_mesh_settings)
-
-            Application.getInstance().getBackend().needsSlicing()
-            Application.getInstance().getBackend().tickle()
+            if not self._is_non_printing_mesh:
+                # self._error_check_timer.start()
+                self._checkStackForErrors()
+        Application.getInstance().getBackend().needsSlicing()
+        Application.getInstance().getBackend().tickle()
+
+    def _checkStackForErrors(self):
+        hasErrors = False;
+        for key in self._stack.getAllKeys():
+            validation_state = self._stack.getProperty(key, "validationState")
+            if validation_state in (ValidatorState.Exception, ValidatorState.MaximumError, ValidatorState.MinimumError):
+                Logger.log("w", "Setting Per Object %s is not valid.", key)
+                hasErrors = True
+                break
+        Application.getInstance().getObjectsModel().setStacksHaveErrors(hasErrors)
 
     ##  Makes sure that the stack upon which the container stack is placed is
     #   kept up to date.

+ 5 - 3
plugins/PerObjectSettingsTool/PerObjectSettingsTool.py

@@ -44,7 +44,6 @@ class PerObjectSettingsTool(Tool):
         self._error_check_timer.setSingleShot(True)
         self._error_check_timer.timeout.connect(self._updateStacksHaveErrors)
 
-
     def event(self, event):
         super().event(event)
         if event.type == Event.MousePressEvent and self._controller.getToolsEnabled():
@@ -156,10 +155,12 @@ class PerObjectSettingsTool(Tool):
 
     def _onPropertyChanged(self, key: str, property_name: str) -> None:
         if property_name == "validationState":
-            self._error_check_timer.start()
+            # self._error_check_timer.start()
+            return
 
     def _updateStacksHaveErrors(self) -> None:
-        self._checkStacksHaveErrors()
+        return
+        # self._checkStacksHaveErrors()
 
 
     def _checkStacksHaveErrors(self):
@@ -180,6 +181,7 @@ class PerObjectSettingsTool(Tool):
 
 
     def _checkStackForErrors(self, stack):
+        print("checking for errors")
         if stack is None:
             return False
 

+ 2 - 2
resources/definitions/fabtotum.def.json

@@ -21,10 +21,10 @@
   "overrides": {
     "machine_name": { "default_value": "FABtotum Personal Fabricator" },
     "machine_start_gcode": {
-      "default_value": ";Layer height: {layer_height}\n;Walls: {wall_thickness}\n;Fill: {infill_sparse_density}\n;Top\\Bottom Thickness: {top_bottom_thickness}\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nG4 S1 ;1 millisecond pause to buffer the bep bep \nM728 ;FAB bep bep (start the print, go check the oozing and skirt lines adesion) \nG4 S1 ;1 second pause to reach the printer (run fast)\nG92 E0 ;zero the extruded length \nG1 F200 E35  ;slowly extrude 35mm of filament to clean the nozzle and build up extrusion pressure \nG92 E0 ;zero the extruded length again \nG1 F{speed_travel} ;Set travel speed \n;print"
+      "default_value": ";Layer height: {layer_height}\n;Walls: {wall_thickness}\n;Fill: {infill_sparse_density}\n;Top\\Bottom Thickness: {top_bottom_thickness}\nG90 ;absolute positioning\nM82 ;set extruder to absolute mode\nG4 S1 ;1 millisecond pause to buffer the bep bep \nM300 S2 ;FAB bep bep (start the print, go check the oozing and skirt lines adesion) \nG4 S1 ;1 second pause to reach the printer (run fast)\nG92 E0 ;zero the extruded length \nG1 F200 E35  ;slowly extrude 35mm of filament to clean the nozzle and build up extrusion pressure \nG92 E0 ;zero the extruded length again \n;print"
     },
     "machine_end_gcode": {
-      "default_value": "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+0.5 E-3 X+5 Y+5 F5000 ;move Z up a bit and retract filament even more\n;end of the print\nM84 ;steppers off\nG90 ;absolute positioning\nM728 ;FAB bep bep (end print)"
+      "default_value": "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+0.5 E-3 X+5 Y+5 F5000 ;move Z up a bit and retract filament even more\n;end of the print\nM84 ;steppers off\nG90 ;absolute positioning\nM300 S2 ;FAB bep bep (end print)"
     },
     "gantry_height": { "default_value": 55 },
     "machine_width": { "default_value": 214 },

+ 2 - 2
resources/definitions/ultimaker3.def.json

@@ -123,7 +123,6 @@
         "raft_margin": { "value": "10" },
         "raft_surface_layers": { "value": "1" },
         "retraction_amount": { "value": "2" },
-        "retraction_combing": { "default_value": "noskin" },		
         "retraction_count_max": { "value": "10" },
         "retraction_extrusion_window": { "value": "1" },
         "retraction_hop": { "value": "2" },
@@ -154,6 +153,7 @@
         "travel_avoid_distance": { "value": "3" },
         "wall_0_inset": { "value": "0" },
         "wall_line_width_x": { "value": "round(wall_line_width * 0.3 / 0.35, 2)" },
-        "wall_thickness": { "value": "1" }
+        "wall_thickness": { "value": "1" },
+        "zig_zaggify_infill": { "value": "True" }
     }
 }

+ 3 - 0
resources/preset_setting_visibility_groups/expert.cfg

@@ -109,6 +109,7 @@ material_diameter
 material_adhesion_tendency
 material_surface_energy
 material_flow
+material_flow_layer_0
 retraction_enable
 retract_at_layer_change
 retraction_amount
@@ -218,6 +219,7 @@ support_bottom_extruder_nr
 support_type
 support_angle
 support_pattern
+zig_zaggify_support
 support_connect_zigzags
 support_infill_rate
 support_line_distance
@@ -281,6 +283,7 @@ raft_fan_speed
 
 [dual]
 prime_tower_enable
+prime_tower_circular
 prime_tower_size
 prime_tower_min_volume
 prime_tower_wall_thickness

+ 10 - 0
resources/qml/Actions.qml

@@ -236,6 +236,16 @@ Item
         onTriggered: CuraActions.deleteSelection();
     }
 
+    Action //Also add backspace as the same function as delete because on Macintosh keyboards the button called "delete" is actually a backspace, and the user expects it to function as a delete.
+    {
+        id: backspaceSelectionAction
+        text: catalog.i18ncp("@action:inmenu menubar:edit", "Delete &Selected Model", "Delete &Selected Models", UM.Selection.selectionCount)
+        enabled: UM.Controller.toolsEnabled && UM.Selection.hasSelection
+        iconName: "edit-delete"
+        shortcut: StandardKey.Backspace
+        onTriggered: CuraActions.deleteSelection()
+    }
+
     Action
     {
         id: centerSelectionAction;

+ 2 - 1
resources/quality/fabtotum/fabtotum_abs_fast.inst.cfg

@@ -12,9 +12,10 @@ material = fabtotum_abs
 
 [values]
 adhesion_type = raft
+speed_print = 80
 layer_height = 0.2
 layer_height_0 = 0.2
-cool_fan_enabled = True
+cool_fan_enabled = False
 cool_fan_full_at_height = 0.4
 cool_fan_speed = 50
 cool_fan_speed_max = 50

+ 2 - 1
resources/quality/fabtotum/fabtotum_abs_high.inst.cfg

@@ -12,9 +12,10 @@ material = fabtotum_abs
 
 [values]
 adhesion_type = raft
+speed_print = 45
 layer_height = 0.1
 layer_height_0 = 0.1
-cool_fan_enabled = True
+cool_fan_enabled = False
 cool_fan_full_at_height = 0.2
 cool_fan_speed = 50
 cool_fan_speed_max = 50

+ 2 - 1
resources/quality/fabtotum/fabtotum_abs_normal.inst.cfg

@@ -12,9 +12,10 @@ material = fabtotum_abs
 
 [values]
 adhesion_type = raft
+speed_print = 60
 layer_height = 0.15
 layer_height_0 = 0.15
-cool_fan_enabled = True
+cool_fan_enabled = False
 cool_fan_full_at_height = 0.3
 cool_fan_speed = 50
 cool_fan_speed_max = 50

Some files were not shown because too many files changed in this diff