mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-11 16:57:53 -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 {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
enum ePrintStatistics
|
||||||
|
{
|
||||||
|
psObjectsUsedMaterial = 0,
|
||||||
|
psSupportUsedMaterial
|
||||||
|
};
|
||||||
|
|
||||||
enum class FilePrinterFormat {
|
enum class FilePrinterFormat {
|
||||||
SLA_PNGZIP,
|
SLA_PNGZIP,
|
||||||
SVG
|
SVG
|
||||||
|
@ -118,6 +124,9 @@ template<> class FilePrinter<FilePrinterFormat::SLA_PNGZIP>
|
||||||
double m_layer_height = .0;
|
double m_layer_height = .0;
|
||||||
Raster::Origin m_o = Raster::Origin::TOP_LEFT;
|
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) {
|
std::string createIniContent(const std::string& projectname) {
|
||||||
double layer_height = m_layer_height;
|
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 stepnum_str = to_string(static_cast<unsigned>(800*layer_height));
|
||||||
auto layerh_str = to_string(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(
|
return string(
|
||||||
"action = print\n"
|
"action = print\n"
|
||||||
"jobDir = ") + projectname + "\n" +
|
"jobDir = ") + projectname + "\n" +
|
||||||
|
@ -143,7 +155,9 @@ template<> class FilePrinter<FilePrinterFormat::SLA_PNGZIP>
|
||||||
"layerHeight = " + layerh_str + "\n"
|
"layerHeight = " + layerh_str + "\n"
|
||||||
"noteInfo = "
|
"noteInfo = "
|
||||||
"expTime="+expt_str+"+resinType=generic+layerHeight="
|
"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:
|
public:
|
||||||
|
@ -277,6 +291,12 @@ public:
|
||||||
out.close();
|
out.close();
|
||||||
m_layers_rst[i].first.reset();
|
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];
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -969,6 +969,10 @@ void SLAPrint::process()
|
||||||
|
|
||||||
// Fill statistics
|
// Fill statistics
|
||||||
fill_statistics();
|
fill_statistics();
|
||||||
|
// Set statistics values to the printer
|
||||||
|
SLAPrinter& printer = *m_printer;
|
||||||
|
printer.set_statistics({m_print_statistics.objects_used_material,
|
||||||
|
m_print_statistics.support_used_material});
|
||||||
|
|
||||||
// If everything vent well
|
// If everything vent well
|
||||||
report_status(*this, 100, L("Slicing done"));
|
report_status(*this, 100, L("Slicing done"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue