mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-30 12:05:09 +08:00
Merge branch 'master' into feature_unify_pause_at_height
This commit is contained in:
commit
c4d1ab4ff1
@ -1,4 +1,4 @@
|
|||||||
# Copyright (c) 2018 Ultimaker B.V.
|
# Copyright (c) 2020 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 typing import List, Optional
|
from typing import List, Optional
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ LocationSuggestion = namedtuple("LocationSuggestion", ["x", "y", "penalty_points
|
|||||||
class Arrange:
|
class Arrange:
|
||||||
build_volume = None # type: Optional[BuildVolume]
|
build_volume = None # type: Optional[BuildVolume]
|
||||||
|
|
||||||
def __init__(self, x, y, offset_x, offset_y, scale= 0.5):
|
def __init__(self, x, y, offset_x, offset_y, scale = 0.5):
|
||||||
self._scale = scale # convert input coordinates to arrange coordinates
|
self._scale = scale # convert input coordinates to arrange coordinates
|
||||||
world_x, world_y = int(x * self._scale), int(y * self._scale)
|
world_x, world_y = int(x * self._scale), int(y * self._scale)
|
||||||
self._shape = (world_y, world_x)
|
self._shape = (world_y, world_x)
|
||||||
|
@ -285,13 +285,13 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||||||
serialized = archive.open(instance_container_file_name).read().decode("utf-8")
|
serialized = archive.open(instance_container_file_name).read().decode("utf-8")
|
||||||
|
|
||||||
# Qualities and variants don't have upgrades, so don't upgrade them
|
# Qualities and variants don't have upgrades, so don't upgrade them
|
||||||
parser = ConfigParser(interpolation = None)
|
parser = ConfigParser(interpolation = None, comment_prefixes = ())
|
||||||
parser.read_string(serialized)
|
parser.read_string(serialized)
|
||||||
container_type = parser["metadata"]["type"]
|
container_type = parser["metadata"]["type"]
|
||||||
if container_type not in ("quality", "variant"):
|
if container_type not in ("quality", "variant"):
|
||||||
serialized = InstanceContainer._updateSerialized(serialized, instance_container_file_name)
|
serialized = InstanceContainer._updateSerialized(serialized, instance_container_file_name)
|
||||||
|
|
||||||
parser = ConfigParser(interpolation = None)
|
parser = ConfigParser(interpolation = None, comment_prefixes = ())
|
||||||
parser.read_string(serialized)
|
parser.read_string(serialized)
|
||||||
container_info = ContainerInfo(instance_container_file_name, serialized, parser)
|
container_info = ContainerInfo(instance_container_file_name, serialized, parser)
|
||||||
instance_container_info_dict[container_id] = container_info
|
instance_container_info_dict[container_id] = container_info
|
||||||
|
@ -107,7 +107,7 @@ Item
|
|||||||
labelWidth: base.labelWidth
|
labelWidth: base.labelWidth
|
||||||
controlWidth: base.controlWidth
|
controlWidth: base.controlWidth
|
||||||
unitText: catalog.i18nc("@label", "mm")
|
unitText: catalog.i18nc("@label", "mm")
|
||||||
allowNegativeValue: true
|
minimum: Number.NEGATIVE_INFINITY
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -122,7 +122,7 @@ Item
|
|||||||
labelWidth: base.labelWidth
|
labelWidth: base.labelWidth
|
||||||
controlWidth: base.controlWidth
|
controlWidth: base.controlWidth
|
||||||
unitText: catalog.i18nc("@label", "mm")
|
unitText: catalog.i18nc("@label", "mm")
|
||||||
allowNegativeValue: true
|
minimum: Number.NEGATIVE_INFINITY
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -72,6 +72,7 @@ Item
|
|||||||
labelWidth: base.labelWidth
|
labelWidth: base.labelWidth
|
||||||
controlWidth: base.controlWidth
|
controlWidth: base.controlWidth
|
||||||
unitText: catalog.i18nc("@label", "mm")
|
unitText: catalog.i18nc("@label", "mm")
|
||||||
|
maximum: 2000000
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,6 +87,7 @@ Item
|
|||||||
labelWidth: base.labelWidth
|
labelWidth: base.labelWidth
|
||||||
controlWidth: base.controlWidth
|
controlWidth: base.controlWidth
|
||||||
unitText: catalog.i18nc("@label", "mm")
|
unitText: catalog.i18nc("@label", "mm")
|
||||||
|
maximum: 2000000
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,8 +206,8 @@ Item
|
|||||||
|
|
||||||
axisName: "x"
|
axisName: "x"
|
||||||
axisMinOrMax: "min"
|
axisMinOrMax: "min"
|
||||||
allowNegativeValue: true
|
minimum: Number.NEGATIVE_INFINITY
|
||||||
allowPositiveValue: false
|
maximum: 0
|
||||||
|
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
@ -224,8 +226,8 @@ Item
|
|||||||
|
|
||||||
axisName: "y"
|
axisName: "y"
|
||||||
axisMinOrMax: "min"
|
axisMinOrMax: "min"
|
||||||
allowNegativeValue: true
|
minimum: Number.NEGATIVE_INFINITY
|
||||||
allowPositiveValue: false
|
maximum: 0
|
||||||
|
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
@ -244,8 +246,6 @@ Item
|
|||||||
|
|
||||||
axisName: "x"
|
axisName: "x"
|
||||||
axisMinOrMax: "max"
|
axisMinOrMax: "max"
|
||||||
allowNegativeValue: false
|
|
||||||
allowPositiveValue: true
|
|
||||||
|
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
@ -266,8 +266,6 @@ Item
|
|||||||
|
|
||||||
axisName: "y"
|
axisName: "y"
|
||||||
axisMinOrMax: "max"
|
axisMinOrMax: "max"
|
||||||
allowNegativeValue: false
|
|
||||||
allowPositiveValue: true
|
|
||||||
|
|
||||||
forceUpdateOnChangeFunction: forceUpdateFunction
|
forceUpdateOnChangeFunction: forceUpdateFunction
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ pycollada==0.6
|
|||||||
pycparser==2.19
|
pycparser==2.19
|
||||||
pyparsing==2.4.2
|
pyparsing==2.4.2
|
||||||
pyserial==3.4
|
pyserial==3.4
|
||||||
|
pytest
|
||||||
python-dateutil==2.8.0
|
python-dateutil==2.8.0
|
||||||
python-utils==2.3.0
|
python-utils==2.3.0
|
||||||
requests==2.22.0
|
requests==2.22.0
|
||||||
|
@ -142,6 +142,8 @@
|
|||||||
"description": "The width (X-direction) of the printable area.",
|
"description": "The width (X-direction) of the printable area.",
|
||||||
"default_value": 100,
|
"default_value": 100,
|
||||||
"type": "float",
|
"type": "float",
|
||||||
|
"minimum_value": "0.001",
|
||||||
|
"maximum_value": "2000000",
|
||||||
"settable_per_mesh": false,
|
"settable_per_mesh": false,
|
||||||
"settable_per_extruder": false,
|
"settable_per_extruder": false,
|
||||||
"settable_per_meshgroup": false
|
"settable_per_meshgroup": false
|
||||||
@ -152,6 +154,8 @@
|
|||||||
"description": "The depth (Y-direction) of the printable area.",
|
"description": "The depth (Y-direction) of the printable area.",
|
||||||
"default_value": 100,
|
"default_value": 100,
|
||||||
"type": "float",
|
"type": "float",
|
||||||
|
"minimum_value": "0.001",
|
||||||
|
"maximum_value": "2000000",
|
||||||
"settable_per_mesh": false,
|
"settable_per_mesh": false,
|
||||||
"settable_per_extruder": false,
|
"settable_per_extruder": false,
|
||||||
"settable_per_meshgroup": false
|
"settable_per_meshgroup": false
|
||||||
|
@ -37,15 +37,13 @@ UM.TooltipArea
|
|||||||
|
|
||||||
property alias textField: textFieldWithUnit
|
property alias textField: textFieldWithUnit
|
||||||
property alias valueText: textFieldWithUnit.text
|
property alias valueText: textFieldWithUnit.text
|
||||||
property alias valueValidator: textFieldWithUnit.validator
|
|
||||||
property alias editingFinishedFunction: textFieldWithUnit.editingFinishedFunction
|
property alias editingFinishedFunction: textFieldWithUnit.editingFinishedFunction
|
||||||
|
|
||||||
property string tooltipText: propertyProvider.properties.description
|
property string tooltipText: propertyProvider.properties.description
|
||||||
|
|
||||||
// whether negative value is allowed. This affects the validation of the input field.
|
property real minimum: 0
|
||||||
property bool allowNegativeValue: false
|
property real maximum: Number.POSITIVE_INFINITY
|
||||||
// whether positive value is allowed. This affects the validation of the input field.
|
property int decimals: 6
|
||||||
property bool allowPositiveValue: true
|
|
||||||
|
|
||||||
// callback functions
|
// callback functions
|
||||||
property var afterOnEditingFinishedFunction: dummy_func
|
property var afterOnEditingFinishedFunction: dummy_func
|
||||||
@ -78,7 +76,7 @@ UM.TooltipArea
|
|||||||
id: textFieldWithUnit
|
id: textFieldWithUnit
|
||||||
anchors.left: fieldLabel.right
|
anchors.left: fieldLabel.right
|
||||||
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
anchors.leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
|
verticalAlignment: Text.AlignVCenter
|
||||||
width: numericTextFieldWithUnit.controlWidth
|
width: numericTextFieldWithUnit.controlWidth
|
||||||
height: numericTextFieldWithUnit.controlHeight
|
height: numericTextFieldWithUnit.controlHeight
|
||||||
|
|
||||||
@ -158,12 +156,26 @@ UM.TooltipArea
|
|||||||
}
|
}
|
||||||
validator: DoubleValidator
|
validator: DoubleValidator
|
||||||
{
|
{
|
||||||
bottom: allowNegativeValue ? Number.NEGATIVE_INFINITY : 0
|
bottom: numericTextFieldWithUnit.minimum
|
||||||
top: allowPositiveValue ? Number.POSITIVE_INFINITY : 0
|
top: numericTextFieldWithUnit.maximum
|
||||||
decimals: 6
|
decimals: numericTextFieldWithUnit.decimals
|
||||||
notation: DoubleValidator.StandardNotation
|
notation: DoubleValidator.StandardNotation
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Enforce actual minimum and maximum values.
|
||||||
|
//The DoubleValidator allows intermediate values, which essentially means that the maximum gets rounded up to the nearest power of 10.
|
||||||
|
//This is not accurate at all, so here if the value exceeds the maximum or the minimum we disallow it.
|
||||||
|
property string previousText
|
||||||
|
onTextChanged:
|
||||||
|
{
|
||||||
|
var value = Number(text);
|
||||||
|
if(value < numericTextFieldWithUnit.minimum || value > numericTextFieldWithUnit.maximum)
|
||||||
|
{
|
||||||
|
text = previousText;
|
||||||
|
}
|
||||||
|
previousText = text;
|
||||||
|
}
|
||||||
|
|
||||||
onEditingFinished: editingFinishedFunction()
|
onEditingFinished: editingFinishedFunction()
|
||||||
|
|
||||||
property var editingFinishedFunction: defaultEditingFinishedFunction
|
property var editingFinishedFunction: defaultEditingFinishedFunction
|
||||||
|
@ -46,13 +46,6 @@ NumericTextFieldWithUnit
|
|||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
valueValidator: DoubleValidator {
|
|
||||||
bottom: allowNegativeValue ? Number.NEGATIVE_INFINITY : 0
|
|
||||||
top: allowPositiveValue ? Number.POSITIVE_INFINITY : 0
|
|
||||||
decimals: 6
|
|
||||||
notation: DoubleValidator.StandardNotation
|
|
||||||
}
|
|
||||||
|
|
||||||
valueText: axisValue
|
valueText: axisValue
|
||||||
|
|
||||||
Connections
|
Connections
|
||||||
|
Loading…
x
Reference in New Issue
Block a user