mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 01:59:02 +08:00
parent
8b28dfb5e2
commit
8ae0c695bd
@ -68,6 +68,7 @@ Column
|
||||
|
||||
property var printMaterialLengths: PrintInformation.materialLengths
|
||||
property var printMaterialWeights: PrintInformation.materialWeights
|
||||
property var printMaterialCosts: PrintInformation.materialCosts
|
||||
|
||||
text:
|
||||
{
|
||||
@ -77,6 +78,7 @@ Column
|
||||
}
|
||||
var totalLengths = 0
|
||||
var totalWeights = 0
|
||||
var totalCosts = 0.0
|
||||
if (printMaterialLengths)
|
||||
{
|
||||
for(var index = 0; index < printMaterialLengths.length; index++)
|
||||
@ -85,9 +87,16 @@ Column
|
||||
{
|
||||
totalLengths += printMaterialLengths[index]
|
||||
totalWeights += Math.round(printMaterialWeights[index])
|
||||
var cost = printMaterialCosts[index] == undefined ? 0.0 : printMaterialCosts[index]
|
||||
totalCosts += cost
|
||||
}
|
||||
}
|
||||
}
|
||||
if(totalCosts > 0)
|
||||
{
|
||||
var costString = "%1 %2".arg(UM.Preferences.getValue("cura/currency")).arg(totalCosts.toFixed(2))
|
||||
return totalWeights + "g · " + totalLengths.toFixed(2) + "m · " + costString
|
||||
}
|
||||
return totalWeights + "g · " + totalLengths.toFixed(2) + "m"
|
||||
}
|
||||
source: UM.Theme.getIcon("spool")
|
||||
|
Loading…
x
Reference in New Issue
Block a user