mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 01:07:52 -06:00
Optimize code
This commit is contained in:
parent
67d66905ba
commit
ba06f06cd0
1 changed files with 1 additions and 1 deletions
|
@ -126,6 +126,7 @@ class PrintInformation(QObject):
|
||||||
return
|
return
|
||||||
|
|
||||||
# Material amount is sent as an amount of mm^3, so calculate length from that
|
# Material amount is sent as an amount of mm^3, so calculate length from that
|
||||||
|
radius = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "value") / 2
|
||||||
self._material_lengths = []
|
self._material_lengths = []
|
||||||
self._material_weights = []
|
self._material_weights = []
|
||||||
self._material_costs = []
|
self._material_costs = []
|
||||||
|
@ -160,7 +161,6 @@ class PrintInformation(QObject):
|
||||||
else:
|
else:
|
||||||
cost = 0
|
cost = 0
|
||||||
|
|
||||||
radius = Application.getInstance().getGlobalContainerStack().getProperty("material_diameter", "value") / 2
|
|
||||||
if radius != 0:
|
if radius != 0:
|
||||||
length = round((amount / (math.pi * radius ** 2)) / 1000, 2)
|
length = round((amount / (math.pi * radius ** 2)) / 1000, 2)
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue