From 755b2e61e404ebee5181524d0777f15735913a91 Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Fri, 16 Sep 2016 15:16:34 +0200 Subject: [PATCH 1/2] CURA-1852: Sending material volumina per extruder --- plugins/SliceInfoPlugin/SliceInfo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index 047a03575d..b691cce387 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -87,7 +87,8 @@ class SliceInfo(Extension): material_radius = 0.5 * global_container_stack.getProperty("material_diameter", "value") # TODO: Send material per extruder instead of mashing it on a pile - material_used = math.pi * material_radius * material_radius * sum(print_information.materialLengths) #Volume of all materials used + material_used = [str(math.pi * material_radius * material_radius * material_length) for material_length in print_information.materialLengths] + material_used = ",".join(material_used) # Get model information (bounding boxes, hashes and transformation matrix) models_info = [] @@ -145,4 +146,4 @@ class SliceInfo(Extension): except Exception as e: # We really can't afford to have a mistake here, as this would break the sending of g-code to a device # (Either saving or directly to a printer). The functionality of the slice data is not *that* important. - Logger.log("e", "Exception raised while sending slice info: %s" %(repr(e))) # But we should be notified about these problems of course. \ No newline at end of file + Logger.log("e", "Exception raised while sending slice info: %s" %(repr(e))) # But we should be notified about these problems of course. From 8366cb8c9bdbe6290f6319e74ef7e9473556e11f Mon Sep 17 00:00:00 2001 From: Thomas Karl Pietrowski Date: Mon, 19 Sep 2016 09:50:09 +0200 Subject: [PATCH 2/2] CURA-1852: Removing TODO Removed the TODO tag, but left a little comment about what is happening in the following section. --- plugins/SliceInfoPlugin/SliceInfo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SliceInfoPlugin/SliceInfo.py b/plugins/SliceInfoPlugin/SliceInfo.py index b691cce387..80172ad9d7 100644 --- a/plugins/SliceInfoPlugin/SliceInfo.py +++ b/plugins/SliceInfoPlugin/SliceInfo.py @@ -86,7 +86,7 @@ class SliceInfo(Extension): print_information = Application.getInstance().getPrintInformation() material_radius = 0.5 * global_container_stack.getProperty("material_diameter", "value") - # TODO: Send material per extruder instead of mashing it on a pile + # Send material per extruder material_used = [str(math.pi * material_radius * material_radius * material_length) for material_length in print_information.materialLengths] material_used = ",".join(material_used)