Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGhostkeeper <rubend@tutanota.com>2020-03-20 13:16:08 +0300
committerGhostkeeper <rubend@tutanota.com>2020-03-20 13:16:16 +0300
commitc7e6553dbfb5cdcfbe0ba0e7b263d64062fe0952 (patch)
treea5ded49aa173441aa9901f302a279d1413e30cbf /plugins/MachineSettingsAction
parent3f69e11d905bf4a0f0c2110c61dbad232a77a5e6 (diff)
Disallow printers larger than 2km
To do this, I'm giving more power to the NumericTextFieldWithUnit QML element, to allow an arbitrary minimum and maximum. Enforcing this minimum and maximum is fairly simple with a JavaScript hook. This hook is necessary because the DoubleValidator allows intermediary values which defeats the purpose, essentially allowing any number as long as it has the correct number of digits. Printers larger than 2km would start to give overflow errors in its X and Y coordinates. Z is okay up to about 9 billion kilometres in theory, since we don't need to do any squaring math on those coordinates afaik. In practice I'm doing this because at very high values the Arranger also gives errors because Numpy can't handle those extremely big arrays (since the arranger creates a 2mm grid). Fixes Sentry issue CURA-CB.
Diffstat (limited to 'plugins/MachineSettingsAction')
-rw-r--r--plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml4
-rw-r--r--plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml14
2 files changed, 8 insertions, 10 deletions
diff --git a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml
index 2ceabf87d0..902388b669 100644
--- a/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml
+++ b/plugins/MachineSettingsAction/MachineSettingsExtruderTab.qml
@@ -107,7 +107,7 @@ Item
labelWidth: base.labelWidth
controlWidth: base.controlWidth
unitText: catalog.i18nc("@label", "mm")
- allowNegativeValue: true
+ minimum: Number.NEGATIVE_INFINITY
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -122,7 +122,7 @@ Item
labelWidth: base.labelWidth
controlWidth: base.controlWidth
unitText: catalog.i18nc("@label", "mm")
- allowNegativeValue: true
+ minimum: Number.NEGATIVE_INFINITY
forceUpdateOnChangeFunction: forceUpdateFunction
}
diff --git a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml
index 3780d6447b..88f73a86f8 100644
--- a/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml
+++ b/plugins/MachineSettingsAction/MachineSettingsPrinterTab.qml
@@ -72,6 +72,7 @@ Item
labelWidth: base.labelWidth
controlWidth: base.controlWidth
unitText: catalog.i18nc("@label", "mm")
+ maximum: 2000000
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -86,6 +87,7 @@ Item
labelWidth: base.labelWidth
controlWidth: base.controlWidth
unitText: catalog.i18nc("@label", "mm")
+ maximum: 2000000
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -204,8 +206,8 @@ Item
axisName: "x"
axisMinOrMax: "min"
- allowNegativeValue: true
- allowPositiveValue: false
+ minimum: Number.NEGATIVE_INFINITY
+ maximum: 0
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -224,8 +226,8 @@ Item
axisName: "y"
axisMinOrMax: "min"
- allowNegativeValue: true
- allowPositiveValue: false
+ minimum: Number.NEGATIVE_INFINITY
+ maximum: 0
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -244,8 +246,6 @@ Item
axisName: "x"
axisMinOrMax: "max"
- allowNegativeValue: false
- allowPositiveValue: true
forceUpdateOnChangeFunction: forceUpdateFunction
}
@@ -266,8 +266,6 @@ Item
axisName: "y"
axisMinOrMax: "max"
- allowNegativeValue: false
- allowPositiveValue: true
forceUpdateOnChangeFunction: forceUpdateFunction
}