mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Save statistics values to the config.ini
This commit is contained in:
		
							parent
							
								
									88f04e0fae
								
							
						
					
					
						commit
						3f23bd5224
					
				
					 2 changed files with 25 additions and 1 deletions
				
			
		|  | @ -14,6 +14,12 @@ | |||
| 
 | ||||
| namespace Slic3r { | ||||
| 
 | ||||
| enum ePrintStatistics | ||||
| { | ||||
|     psObjectsUsedMaterial = 0, | ||||
|     psSupportUsedMaterial | ||||
| }; | ||||
| 
 | ||||
| enum class FilePrinterFormat { | ||||
|     SLA_PNGZIP, | ||||
|     SVG | ||||
|  | @ -118,6 +124,9 @@ template<> class FilePrinter<FilePrinterFormat::SLA_PNGZIP> | |||
|     double m_layer_height = .0; | ||||
|     Raster::Origin m_o = Raster::Origin::TOP_LEFT; | ||||
| 
 | ||||
|     double m_objects_used_material = 0.0; | ||||
|     double m_support_used_material = 0.0; | ||||
| 
 | ||||
|     std::string createIniContent(const std::string& projectname) { | ||||
|         double layer_height = m_layer_height; | ||||
| 
 | ||||
|  | @ -129,6 +138,9 @@ template<> class FilePrinter<FilePrinterFormat::SLA_PNGZIP> | |||
|         auto stepnum_str = to_string(static_cast<unsigned>(800*layer_height)); | ||||
|         auto layerh_str = to_string(layer_height); | ||||
| 
 | ||||
|         const std::string objects_used_material = to_string(m_objects_used_material); | ||||
|         const std::string support_used_material = to_string(m_support_used_material); | ||||
| 
 | ||||
|         return string( | ||||
|         "action = print\n" | ||||
|         "jobDir = ") + projectname + "\n" + | ||||
|  | @ -143,7 +155,9 @@ template<> class FilePrinter<FilePrinterFormat::SLA_PNGZIP> | |||
|         "layerHeight = " + layerh_str + "\n" | ||||
|         "noteInfo = " | ||||
|         "expTime="+expt_str+"+resinType=generic+layerHeight=" | ||||
|                   +layerh_str+"+printer=DWARF3\n"; | ||||
|                   +layerh_str+"+printer=DWARF3\n" | ||||
|         "objUsedMaterial=" + objects_used_material + "\n" | ||||
|         "supUsedMaterial=" + support_used_material + "\n"; | ||||
|     } | ||||
| 
 | ||||
| public: | ||||
|  | @ -277,6 +291,12 @@ public: | |||
|         out.close(); | ||||
|         m_layers_rst[i].first.reset(); | ||||
|     } | ||||
| 
 | ||||
|     void set_statistics(const std::vector<double> statistics) | ||||
|     { | ||||
|         m_objects_used_material = statistics[psObjectsUsedMaterial]; | ||||
|         m_support_used_material = statistics[psSupportUsedMaterial]; | ||||
|     } | ||||
| }; | ||||
| 
 | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka