mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 12:19:03 +08:00
Merge remote-tracking branch 'origin/3.6' into CURA-5821_fix_camera_memory_leak
This commit is contained in:
commit
31bdeb8b73
@ -1,9 +1,12 @@
|
|||||||
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
from UM.Scene.SceneNodeDecorator import SceneNodeDecorator
|
||||||
|
|
||||||
|
|
||||||
class BlockSlicingDecorator(SceneNodeDecorator):
|
class BlockSlicingDecorator(SceneNodeDecorator):
|
||||||
def __init__(self):
|
def __init__(self) -> None:
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
def isBlockSlicing(self):
|
def isBlockSlicing(self) -> bool:
|
||||||
return True
|
return True
|
||||||
|
@ -195,10 +195,6 @@ class FlavorParser:
|
|||||||
self._previous_z = z
|
self._previous_z = z
|
||||||
elif self._previous_extrusion_value > e[self._extruder_number]:
|
elif self._previous_extrusion_value > e[self._extruder_number]:
|
||||||
path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveRetractionType])
|
path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveRetractionType])
|
||||||
|
|
||||||
# This case only for initial start, for the first coordinate in GCode
|
|
||||||
elif e[self._extruder_number] == 0 and self._previous_extrusion_value == 0:
|
|
||||||
path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveRetractionType])
|
|
||||||
else:
|
else:
|
||||||
path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveCombingType])
|
path.append([x, y, z, f, e[self._extruder_number] + self._extrusion_length_offset[self._extruder_number], LayerPolygon.MoveCombingType])
|
||||||
return self._position(x, y, z, f, e)
|
return self._position(x, y, z, f, e)
|
||||||
@ -235,6 +231,9 @@ class FlavorParser:
|
|||||||
# Sometimes a G92 E0 is introduced in the middle of the GCode so we need to keep those offsets for calculate the line_width
|
# Sometimes a G92 E0 is introduced in the middle of the GCode so we need to keep those offsets for calculate the line_width
|
||||||
self._extrusion_length_offset[self._extruder_number] += position.e[self._extruder_number] - params.e
|
self._extrusion_length_offset[self._extruder_number] += position.e[self._extruder_number] - params.e
|
||||||
position.e[self._extruder_number] = params.e
|
position.e[self._extruder_number] = params.e
|
||||||
|
self._previous_extrusion_value = params.e
|
||||||
|
else:
|
||||||
|
self._previous_extrusion_value = 0.0
|
||||||
return self._position(
|
return self._position(
|
||||||
params.x if params.x is not None else position.x,
|
params.x if params.x is not None else position.x,
|
||||||
params.y if params.y is not None else position.y,
|
params.y if params.y is not None else position.y,
|
||||||
@ -243,7 +242,6 @@ class FlavorParser:
|
|||||||
position.e)
|
position.e)
|
||||||
|
|
||||||
def processGCode(self, G: int, line: str, position: Position, path: List[List[Union[float, int]]]) -> Position:
|
def processGCode(self, G: int, line: str, position: Position, path: List[List[Union[float, int]]]) -> Position:
|
||||||
self._previous_extrusion_value = 0.0
|
|
||||||
func = getattr(self, "_gCode%s" % G, None)
|
func = getattr(self, "_gCode%s" % G, None)
|
||||||
line = line.split(";", 1)[0] # Remove comments (if any)
|
line = line.split(";", 1)[0] # Remove comments (if any)
|
||||||
if func is not None:
|
if func is not None:
|
||||||
@ -295,7 +293,7 @@ class FlavorParser:
|
|||||||
self._cancelled = False
|
self._cancelled = False
|
||||||
# We obtain the filament diameter from the selected extruder to calculate line widths
|
# We obtain the filament diameter from the selected extruder to calculate line widths
|
||||||
global_stack = CuraApplication.getInstance().getGlobalContainerStack()
|
global_stack = CuraApplication.getInstance().getGlobalContainerStack()
|
||||||
|
|
||||||
if not global_stack:
|
if not global_stack:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -338,6 +336,7 @@ class FlavorParser:
|
|||||||
min_layer_number = 0
|
min_layer_number = 0
|
||||||
negative_layers = 0
|
negative_layers = 0
|
||||||
previous_layer = 0
|
previous_layer = 0
|
||||||
|
self._previous_extrusion_value = 0.0
|
||||||
|
|
||||||
for line in stream.split("\n"):
|
for line in stream.split("\n"):
|
||||||
if self._cancelled:
|
if self._cancelled:
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# Copyright (c) 2017 Ultimaker B.V.
|
# Copyright (c) 2018 Ultimaker B.V.
|
||||||
# Cura is released under the terms of the LGPLv3 or higher.
|
# Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
from . import FlavorParser
|
from . import FlavorParser
|
||||||
|
|
||||||
# This parser is intented for interpret the RepRap Firmware flavor
|
## This parser is intended to interpret the RepRap Firmware g-code flavor.
|
||||||
class RepRapFlavorParser(FlavorParser.FlavorParser):
|
class RepRapFlavorParser(FlavorParser.FlavorParser):
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
@ -8,9 +8,6 @@ import UM 1.1 as UM
|
|||||||
|
|
||||||
UM.Dialog {
|
UM.Dialog {
|
||||||
id: base;
|
id: base;
|
||||||
property var printersModel: {
|
|
||||||
return ListModel{};
|
|
||||||
}
|
|
||||||
height: minimumHeight;
|
height: minimumHeight;
|
||||||
leftButtons: [
|
leftButtons: [
|
||||||
Button {
|
Button {
|
||||||
@ -87,7 +84,9 @@ UM.Dialog {
|
|||||||
id: printerSelectionCombobox;
|
id: printerSelectionCombobox;
|
||||||
Behavior on height { NumberAnimation { duration: 100 } }
|
Behavior on height { NumberAnimation { duration: 100 } }
|
||||||
height: 40 * screenScaleFactor;
|
height: 40 * screenScaleFactor;
|
||||||
model: base.printersModel;
|
model: ListModel {
|
||||||
|
id: printersModel;
|
||||||
|
}
|
||||||
textRole: "name";
|
textRole: "name";
|
||||||
width: parent.width;
|
width: parent.width;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2016 Ultimaker B.V.
|
// Copyright (c) 2018 Ultimaker B.V.
|
||||||
// Cura is released under the terms of the LGPLv3 or higher.
|
// Cura is released under the terms of the LGPLv3 or higher.
|
||||||
|
|
||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
@ -9,9 +9,8 @@ import Cura 1.0 as Cura
|
|||||||
|
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
title: catalog.i18nc("@title:menu menubar:toplevel", "&View");
|
title: catalog.i18nc("@title:menu menubar:toplevel", "&View")
|
||||||
id: base
|
id: base
|
||||||
enabled: !PrintInformation.preSliced
|
|
||||||
|
|
||||||
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
|
property var multiBuildPlateModel: CuraApplication.getMultiBuildPlateModel()
|
||||||
|
|
||||||
@ -26,11 +25,15 @@ Menu
|
|||||||
checked: model.active
|
checked: model.active
|
||||||
exclusiveGroup: group
|
exclusiveGroup: group
|
||||||
onTriggered: UM.Controller.setActiveView(model.id)
|
onTriggered: UM.Controller.setActiveView(model.id)
|
||||||
|
enabled: !PrintInformation.preSliced
|
||||||
}
|
}
|
||||||
onObjectAdded: base.insertItem(index, object)
|
onObjectAdded: base.insertItem(index, object)
|
||||||
onObjectRemoved: base.removeItem(object)
|
onObjectRemoved: base.removeItem(object)
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: group }
|
ExclusiveGroup
|
||||||
|
{
|
||||||
|
id: group
|
||||||
|
}
|
||||||
|
|
||||||
MenuSeparator {}
|
MenuSeparator {}
|
||||||
|
|
||||||
@ -44,36 +47,47 @@ Menu
|
|||||||
MenuItem { action: Cura.Actions.viewRightSideCamera; }
|
MenuItem { action: Cura.Actions.viewRightSideCamera; }
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuSeparator {
|
MenuSeparator
|
||||||
|
{
|
||||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||||
}
|
}
|
||||||
|
|
||||||
Menu
|
Menu
|
||||||
{
|
{
|
||||||
id: buildPlateMenu;
|
id: buildPlateMenu;
|
||||||
title: catalog.i18nc("@action:inmenu menubar:view","&Build plate");
|
title: catalog.i18nc("@action:inmenu menubar:view","&Build plate")
|
||||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||||
Instantiator
|
Instantiator
|
||||||
{
|
{
|
||||||
model: base.multiBuildPlateModel
|
model: base.multiBuildPlateModel
|
||||||
MenuItem {
|
MenuItem
|
||||||
|
{
|
||||||
text: base.multiBuildPlateModel.getItem(index).name;
|
text: base.multiBuildPlateModel.getItem(index).name;
|
||||||
onTriggered: Cura.SceneController.setActiveBuildPlate(base.multiBuildPlateModel.getItem(index).buildPlateNumber);
|
onTriggered: Cura.SceneController.setActiveBuildPlate(base.multiBuildPlateModel.getItem(index).buildPlateNumber)
|
||||||
checkable: true;
|
checkable: true
|
||||||
checked: base.multiBuildPlateModel.getItem(index).buildPlateNumber == base.multiBuildPlateModel.activeBuildPlate;
|
checked: base.multiBuildPlateModel.getItem(index).buildPlateNumber == base.multiBuildPlateModel.activeBuildPlate
|
||||||
exclusiveGroup: buildPlateGroup;
|
exclusiveGroup: buildPlateGroup
|
||||||
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
visible: UM.Preferences.getValue("cura/use_multi_build_plate")
|
||||||
}
|
}
|
||||||
onObjectAdded: buildPlateMenu.insertItem(index, object);
|
onObjectAdded: buildPlateMenu.insertItem(index, object)
|
||||||
onObjectRemoved: buildPlateMenu.removeItem(object)
|
onObjectRemoved: buildPlateMenu.removeItem(object)
|
||||||
}
|
}
|
||||||
ExclusiveGroup { id: buildPlateGroup; }
|
ExclusiveGroup
|
||||||
|
{
|
||||||
|
id: buildPlateGroup
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
MenuSeparator {}
|
MenuSeparator {}
|
||||||
|
|
||||||
MenuItem { action: Cura.Actions.expandSidebar; }
|
MenuItem
|
||||||
|
{
|
||||||
|
action: Cura.Actions.expandSidebar
|
||||||
|
}
|
||||||
|
|
||||||
MenuSeparator {}
|
MenuSeparator {}
|
||||||
MenuItem { action: Cura.Actions.toggleFullScreen; }
|
MenuItem
|
||||||
|
{
|
||||||
|
action: Cura.Actions.toggleFullScreen
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user