This commit is contained in:
fieldOfView 2016-07-28 07:49:16 +02:00
commit 329a3dce00
9 changed files with 55 additions and 66 deletions

View File

@ -23,7 +23,7 @@ class ConvexHullNode(SceneNode):
self._original_parent = parent self._original_parent = parent
# Color of the drawn convex hull # Color of the drawn convex hull
self._color = Color(35, 35, 35, 192) self._color = Color(0.4, 0.4, 0.4, 1.0)
# The y-coordinate of the convex hull mesh. Must not be 0, to prevent z-fighting. # The y-coordinate of the convex hull mesh. Must not be 0, to prevent z-fighting.
self._mesh_height = 0.1 self._mesh_height = 0.1

View File

@ -95,11 +95,11 @@ class PlatformPhysics:
# Get the overlap distance for both convex hulls. If this returns None, there is no intersection. # Get the overlap distance for both convex hulls. If this returns None, there is no intersection.
head_hull = node.callDecoration("getConvexHullHead") head_hull = node.callDecoration("getConvexHullHead")
if head_hull: if head_hull:
overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHull")) overlap = head_hull.intersectsPolygon(other_node.callDecoration("getConvexHullHead"))
if not overlap: if not overlap:
other_head_hull = other_node.callDecoration("getConvexHullHead") other_head_hull = other_node.callDecoration("getConvexHullHead")
if other_head_hull: if other_head_hull:
overlap = node.callDecoration("getConvexHull").intersectsPolygon(other_head_hull) overlap = node.callDecoration("getConvexHullHead").intersectsPolygon(other_head_hull)
else: else:
own_convex_hull = node.callDecoration("getConvexHull") own_convex_hull = node.callDecoration("getConvexHull")
other_convex_hull = other_node.callDecoration("getConvexHull") other_convex_hull = other_node.callDecoration("getConvexHull")

View File

@ -269,11 +269,14 @@ class MachineManager(QObject):
if property_name == "global_inherits_stack": if property_name == "global_inherits_stack":
if self._active_container_stack and self._active_container_stack != self._global_container_stack: if self._active_container_stack and self._active_container_stack != self._global_container_stack:
# Update the global user value when the "global_inherits_stack" function points to a different stack # Update the global user value when the "global_inherits_stack" function points to a different stack
stack_index = int(self._active_container_stack.getProperty(key, property_name)) extruder_stacks = list(ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId()))
extruder_stacks = [stack for stack in ExtruderManager.getInstance().getMachineExtruders(self._global_container_stack.getId())] target_stack_position = int(self._active_container_stack.getProperty(key, "global_inherits_stack"))
if target_stack_position == -1: # Prevent -1 from selecting wrong stack.
target_stack = self._active_container_stack
else:
target_stack = extruder_stacks[target_stack_position]
if len(extruder_stacks) > stack_index: new_value = target_stack.getProperty(key, "value")
new_value = extruder_stacks[stack_index].getProperty(key, "value")
if self._global_container_stack.getProperty(key, "value") != new_value: if self._global_container_stack.getProperty(key, "value") != new_value:
self._global_container_stack.getTop().setProperty(key, "value", new_value) self._global_container_stack.getTop().setProperty(key, "value", new_value)
@ -549,7 +552,7 @@ class MachineManager(QObject):
return "" return ""
@pyqtSlot(str, str) @pyqtSlot(str, str)
def renameQualityContainer(self, container_id, new_name): def renameQualityContainer(self, container_id, nbalew_name):
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id, type = "quality") containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(id = container_id, type = "quality")
if containers: if containers:
new_name = self._createUniqueName("quality", containers[0].getName(), new_name, new_name = self._createUniqueName("quality", containers[0].getName(), new_name,

View File

@ -92,7 +92,7 @@ class CuraEngineBackend(Backend):
self._always_restart = True #Always restart the engine when starting a new slice. Don't keep the process running. TODO: Fix engine statelessness. self._always_restart = True #Always restart the engine when starting a new slice. Don't keep the process running. TODO: Fix engine statelessness.
self._process_layers_job = None #The currently active job to process layers, or None if it is not processing layers. self._process_layers_job = None #The currently active job to process layers, or None if it is not processing layers.
self._backend_log_max_lines = 200 # Maximal count of lines to buffer self._backend_log_max_lines = 20000 # Maximum number of lines to buffer
self._error_message = None #Pop-up message that shows errors. self._error_message = None #Pop-up message that shows errors.
self.backendQuit.connect(self._onBackendQuit) self.backendQuit.connect(self._onBackendQuit)
@ -252,6 +252,9 @@ class CuraEngineBackend(Backend):
return return
super()._onSocketError(error) super()._onSocketError(error)
if error.getErrorCode() == Arcus.ErrorCode.Debug:
return
self._terminate() self._terminate()
if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, Arcus.ErrorCode.ConnectionResetError, Arcus.ErrorCode.Debug]: if error.getErrorCode() not in [Arcus.ErrorCode.BindFailedError, Arcus.ErrorCode.ConnectionResetError, Arcus.ErrorCode.Debug]:

View File

@ -630,9 +630,8 @@
"type": "float", "type": "float",
"enabled": "support_enable", "enabled": "support_enable",
"value": "line_width", "value": "line_width",
"global_inherits_stack": "support_extruder_nr",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"support_roof_line_width": "support_roof_line_width":
{ {
@ -645,9 +644,8 @@
"type": "float", "type": "float",
"enabled": "support_roof_enable", "enabled": "support_roof_enable",
"value": "line_width", "value": "line_width",
"global_inherits_stack": "support_extruder_nr",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"prime_tower_line_width": "prime_tower_line_width":
{ {
@ -1444,10 +1442,9 @@
"maximum_value_warning": "150", "maximum_value_warning": "150",
"default_value": 60, "default_value": 60,
"value": "speed_print", "value": "speed_print",
"global_inherits_stack": "support_extruder_nr",
"enabled": "support_enable", "enabled": "support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": true,
"children": "children":
{ {
"speed_support_infill": "speed_support_infill":
@ -1461,10 +1458,9 @@
"maximum_value": "299792458000", "maximum_value": "299792458000",
"maximum_value_warning": "150", "maximum_value_warning": "150",
"value": "speed_support", "value": "speed_support",
"global_inherits_stack": "support_extruder_nr",
"enabled": "support_enable", "enabled": "support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"speed_support_roof": "speed_support_roof":
{ {
@ -1478,9 +1474,8 @@
"maximum_value_warning": "150", "maximum_value_warning": "150",
"enabled": "support_roof_enable and support_enable", "enabled": "support_roof_enable and support_enable",
"value": "speed_support / 1.5", "value": "speed_support / 1.5",
"global_inherits_stack": "support_extruder_nr",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
} }
} }
}, },
@ -1650,10 +1645,9 @@
"maximum_value_warning": "10000", "maximum_value_warning": "10000",
"default_value": 3000, "default_value": 3000,
"value": "acceleration_print", "value": "acceleration_print",
"global_inherits_stack": "support_extruder_nr",
"enabled": "acceleration_enabled and support_enable", "enabled": "acceleration_enabled and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": true,
"children": { "children": {
"acceleration_support_infill": { "acceleration_support_infill": {
"label": "Support Infill Acceleration", "label": "Support Infill Acceleration",
@ -1662,13 +1656,12 @@
"type": "float", "type": "float",
"default_value": 3000, "default_value": 3000,
"value": "acceleration_support", "value": "acceleration_support",
"global_inherits_stack": "support_extruder_nr",
"minimum_value": "0.1", "minimum_value": "0.1",
"minimum_value_warning": "100", "minimum_value_warning": "100",
"maximum_value_warning": "10000", "maximum_value_warning": "10000",
"enabled": "acceleration_enabled and support_enable", "enabled": "acceleration_enabled and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"acceleration_support_roof": { "acceleration_support_roof": {
"label": "Support Roof Acceleration", "label": "Support Roof Acceleration",
@ -1677,13 +1670,12 @@
"type": "float", "type": "float",
"default_value": 3000, "default_value": 3000,
"value": "acceleration_support", "value": "acceleration_support",
"global_inherits_stack": "support_extruder_nr",
"minimum_value": "0.1", "minimum_value": "0.1",
"minimum_value_warning": "100", "minimum_value_warning": "100",
"maximum_value_warning": "10000", "maximum_value_warning": "10000",
"enabled": "acceleration_enabled and support_roof_enable and support_enable", "enabled": "acceleration_enabled and support_roof_enable and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
} }
} }
}, },
@ -1841,10 +1833,9 @@
"maximum_value_warning": "50", "maximum_value_warning": "50",
"default_value": 20, "default_value": 20,
"value": "jerk_print", "value": "jerk_print",
"global_inherits_stack": "support_extruder_nr",
"enabled": "jerk_enabled and support_enable", "enabled": "jerk_enabled and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": true,
"children": { "children": {
"jerk_support_infill": { "jerk_support_infill": {
"label": "Support Infill Jerk", "label": "Support Infill Jerk",
@ -1853,13 +1844,12 @@
"type": "float", "type": "float",
"default_value": 20, "default_value": 20,
"value": "jerk_support", "value": "jerk_support",
"global_inherits_stack": "support_extruder_nr",
"minimum_value": "0.1", "minimum_value": "0.1",
"minimum_value_warning": "5", "minimum_value_warning": "5",
"maximum_value_warning": "50", "maximum_value_warning": "50",
"enabled": "jerk_enabled and support_enable", "enabled": "jerk_enabled and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"jerk_support_roof": { "jerk_support_roof": {
"label": "Support Roof Jerk", "label": "Support Roof Jerk",
@ -1868,13 +1858,12 @@
"type": "float", "type": "float",
"default_value": 20, "default_value": 20,
"value": "jerk_support", "value": "jerk_support",
"global_inherits_stack": "support_extruder_nr",
"minimum_value": "0.1", "minimum_value": "0.1",
"minimum_value_warning": "5", "minimum_value_warning": "5",
"maximum_value_warning": "50", "maximum_value_warning": "50",
"enabled": "jerk_enabled and support_roof_enable and support_enable", "enabled": "jerk_enabled and support_roof_enable and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
} }
} }
}, },
@ -2180,7 +2169,7 @@
"default_value": "zigzag", "default_value": "zigzag",
"enabled": "support_enable", "enabled": "support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"support_connect_zigzags": "support_connect_zigzags":
{ {
@ -2190,7 +2179,7 @@
"default_value": true, "default_value": true,
"enabled": "support_enable and (support_pattern == \"zigzag\")", "enabled": "support_enable and (support_pattern == \"zigzag\")",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"support_infill_rate": "support_infill_rate":
{ {
@ -2203,7 +2192,7 @@
"default_value": 15, "default_value": 15,
"enabled": "support_enable", "enabled": "support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": true,
"children": { "children": {
"support_line_distance": "support_line_distance":
{ {
@ -2216,7 +2205,7 @@
"enabled": "support_enable", "enabled": "support_enable",
"value": "(support_line_width * 100) / support_infill_rate * (2 if support_pattern == \"grid\" else (3 if support_pattern == \"triangles\" else 1))", "value": "(support_line_width * 100) / support_infill_rate * (2 if support_pattern == \"grid\" else (3 if support_pattern == \"triangles\" else 1))",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
} }
} }
}, },
@ -2389,7 +2378,7 @@
"maximum_value_warning": "100", "maximum_value_warning": "100",
"enabled":"support_roof_enable and support_enable", "enabled":"support_roof_enable and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false, "settable_per_extruder": true,
"children": "children":
{ {
"support_roof_line_distance": "support_roof_line_distance":
@ -2403,7 +2392,7 @@
"value": "0 if support_roof_density == 0 else (support_roof_line_width * 100) / support_roof_density * (2 if support_roof_pattern == \"grid\" else (3 if support_roof_pattern == \"triangles\" else 1))", "value": "0 if support_roof_density == 0 else (support_roof_line_width * 100) / support_roof_density * (2 if support_roof_pattern == \"grid\" else (3 if support_roof_pattern == \"triangles\" else 1))",
"enabled": "support_roof_enable and support_enable", "enabled": "support_roof_enable and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
} }
} }
}, },
@ -2423,7 +2412,7 @@
"default_value": "concentric", "default_value": "concentric",
"enabled": "support_roof_enable and support_enable", "enabled": "support_roof_enable and support_enable",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": true
}, },
"support_use_towers": "support_use_towers":
{ {
@ -3359,7 +3348,7 @@
"maximum_value_warning": "9999", "maximum_value_warning": "9999",
"default_value": 0, "default_value": 0,
"value": "9999 if draft_shield_height_limitation == 'full' and draft_shield_enabled else 0.0", "value": "9999 if draft_shield_height_limitation == 'full' and draft_shield_enabled else 0.0",
"enabled": "draft_shield_height_limitation == \"limited\"", "enabled": "draft_shield_enabled and draft_shield_height_limitation == \"limited\"",
"settable_per_mesh": false, "settable_per_mesh": false,
"settable_per_extruder": false "settable_per_extruder": false
}, },

View File

@ -57,7 +57,7 @@
"default_value": 2 "default_value": 2
}, },
"gantry_height": { "gantry_height": {
"default_value": 55 "default_value": 48
}, },
"machine_use_extruder_offset_to_offset_coords": { "machine_use_extruder_offset_to_offset_coords": {
"default_value": true "default_value": true

View File

@ -22,7 +22,7 @@ Rectangle
{ {
if(!printerConnected) if(!printerConnected)
return UM.Theme.getColor("status_offline") return UM.Theme.getColor("status_offline")
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print") else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
return UM.Theme.getColor("status_busy") return UM.Theme.getColor("status_busy")
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "") else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
return UM.Theme.getColor("status_ready") return UM.Theme.getColor("status_ready")
@ -53,6 +53,10 @@ Rectangle
{ {
return catalog.i18nc("@label:", "Preparing...") return catalog.i18nc("@label:", "Preparing...")
} }
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup")
{
return catalog.i18nc("@label:", "Waiting for cleanup...")
}
else else
{ {
return " " return " "

View File

@ -108,7 +108,7 @@ Rectangle
iconSource: { iconSource: {
if(!printerConnected) if(!printerConnected)
return UM.Theme.getIcon("tab_monitor") return UM.Theme.getIcon("tab_monitor")
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print") else if(Cura.MachineManager.printerOutputDevices[0].jobState == "printing" || Cura.MachineManager.printerOutputDevices[0].jobState == "pre_print" || Cura.MachineManager.printerOutputDevices[0].jobState == "wait_cleanup" )
return UM.Theme.getIcon("tab_monitor_busy") return UM.Theme.getIcon("tab_monitor_busy")
else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "") else if(Cura.MachineManager.printerOutputDevices[0].jobState == "ready" || Cura.MachineManager.printerOutputDevices[0].jobState == "")
return UM.Theme.getIcon("tab_monitor_connected") return UM.Theme.getIcon("tab_monitor_connected")

View File

@ -1,7 +1,7 @@
[shaders] [shaders]
vertex = vertex =
uniform highp mat4 u_viewProjectionMatrix;
uniform highp mat4 u_modelMatrix; uniform highp mat4 u_modelMatrix;
uniform highp mat4 u_viewProjectionMatrix;
uniform highp mat4 u_normalMatrix; uniform highp mat4 u_normalMatrix;
attribute highp vec4 a_vertex; attribute highp vec4 a_vertex;
@ -10,7 +10,6 @@ vertex =
varying highp vec3 v_vertex; varying highp vec3 v_vertex;
varying highp vec3 v_normal; varying highp vec3 v_normal;
varying highp vec2 v_uvs;
void main() void main()
{ {
@ -19,56 +18,47 @@ vertex =
v_vertex = world_space_vert.xyz; v_vertex = world_space_vert.xyz;
v_normal = (u_normalMatrix * normalize(a_normal)).xyz; v_normal = (u_normalMatrix * normalize(a_normal)).xyz;
v_uvs = a_uvs;
} }
fragment = fragment =
uniform mediump vec4 u_ambientColor; uniform mediump vec4 u_ambientColor;
uniform mediump vec4 u_diffuseColor; uniform mediump vec4 u_diffuseColor;
uniform highp vec3 u_lightPosition; uniform highp vec3 u_lightPosition;
uniform highp vec3 u_viewPosition;
uniform mediump float u_opacity; uniform mediump float u_opacity;
uniform sampler2D u_texture;
varying highp vec3 v_vertex; varying highp vec3 v_vertex;
varying highp vec3 v_normal; varying highp vec3 v_normal;
varying highp vec2 v_uvs;
void main() void main()
{ {
// Copied from platform.shader, removed texture mediump vec4 finalColor = vec4(0.0);
mediump vec4 final_color = vec4(0.0);
/* Ambient Component */ /* Ambient Component */
final_color += u_ambientColor; finalColor += u_ambientColor;
highp vec3 normal = normalize(v_normal); highp vec3 normal = normalize(v_normal);
highp vec3 light_dir = normalize(u_lightPosition - v_vertex); highp vec3 lightDir = normalize(u_lightPosition - v_vertex);
/* Diffuse Component */ /* Diffuse Component */
highp float n_dot_l = clamp(dot(normal, light_dir), 0.0, 1.0); highp float NdotL = clamp(abs(dot(normal, lightDir)), 0.0, 1.0);
final_color += (n_dot_l * u_diffuseColor); finalColor += (NdotL * u_diffuseColor);
final_color.a = u_opacity; gl_FragColor = finalColor;
gl_FragColor.a = u_opacity;
gl_FragColor = final_color;
} }
[defaults] [defaults]
u_ambientColor = [0.3, 0.3, 0.3, 1.0] u_ambientColor = [0.1, 0.1, 0.1, 1.0]
u_diffuseColor = [1.0, 1.0, 1.0, 1.0] u_diffuseColor = [0.4, 0.4, 0.4, 1.0]
u_opacity = 0.5 u_opacity = 0.5
u_texture = 0
[bindings] [bindings]
u_viewProjectionMatrix = view_projection_matrix
u_modelMatrix = model_matrix u_modelMatrix = model_matrix
u_viewProjectionMatrix = view_projection_matrix
u_normalMatrix = normal_matrix u_normalMatrix = normal_matrix
u_lightPosition = light_0_position u_lightPosition = light_0_position
u_viewPosition = camera_position
[attributes] [attributes]
a_vertex = vertex a_vertex = vertex
a_normal = normal a_normal = normal
a_uvs = uv0