Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::SLAPrintStatistics Struct Reference

#include <src/libslic3r/SLAPrint.hpp>

+ Collaboration diagram for Slic3r::SLAPrintStatistics:

Public Member Functions

 SLAPrintStatistics ()
 
DynamicConfig config () const
 
std::string finalize_output_path (const std::string &path_in) const
 
void clear ()
 

Static Public Member Functions

static DynamicConfig placeholders ()
 

Public Attributes

double estimated_print_time
 
double objects_used_material
 
double support_used_material
 
size_t slow_layers_count
 
size_t fast_layers_count
 
double total_cost
 
double total_weight
 
std::vector< double > layers_times
 

Detailed Description

Constructor & Destructor Documentation

◆ SLAPrintStatistics()

Slic3r::SLAPrintStatistics::SLAPrintStatistics ( )
inline
402{ clear(); }
void clear()
Definition SLAPrint.hpp:419

Member Function Documentation

◆ clear()

void Slic3r::SLAPrintStatistics::clear ( )
inline
419 {
425 total_cost = 0.;
426 total_weight = 0.;
427 layers_times.clear();
428 }
double total_cost
Definition SLAPrint.hpp:408
double total_weight
Definition SLAPrint.hpp:409
double support_used_material
Definition SLAPrint.hpp:405
size_t slow_layers_count
Definition SLAPrint.hpp:406
std::vector< double > layers_times
Definition SLAPrint.hpp:410
double estimated_print_time
Definition SLAPrint.hpp:403
size_t fast_layers_count
Definition SLAPrint.hpp:407
double objects_used_material
Definition SLAPrint.hpp:404

Referenced by Slic3r::SLAPrint::Steps::merge_slices_and_eval_stats().

+ Here is the caller graph for this function:

◆ config()

DynamicConfig Slic3r::SLAPrintStatistics::config ( ) const
1125{
1126 DynamicConfig config;
1127 const std::string print_time = Slic3r::short_time(get_time_dhms(float(this->estimated_print_time)));
1128 config.set_key_value("print_time", new ConfigOptionString(print_time));
1129 config.set_key_value("objects_used_material", new ConfigOptionFloat(this->objects_used_material));
1130 config.set_key_value("support_used_material", new ConfigOptionFloat(this->support_used_material));
1131 config.set_key_value("total_cost", new ConfigOptionFloat(this->total_cost));
1132 config.set_key_value("total_weight", new ConfigOptionFloat(this->total_weight));
1133 return config;
1134}
bool set_key_value(const std::string &opt_key, ConfigOption *opt)
Definition Config.hpp:2431
ConfigOptionFloat
Definition PrintConfig.hpp:570
std::string short_time(const std::string &time, bool force_localization)
Definition utils.cpp:989
std::string get_time_dhms(float time_in_secs)
Definition Utils.hpp:315
DynamicConfig config() const
Definition SLAPrint.cpp:1124

References Slic3r::SLAPrintObject::config(), Slic3r::get_time_dhms(), and Slic3r::short_time().

Referenced by Slic3r::SLAPrint::output_filename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ finalize_output_path()

std::string Slic3r::SLAPrintStatistics::finalize_output_path ( const std::string &  path_in) const
1148{
1149 std::string final_path;
1150 try {
1151 boost::filesystem::path path(path_in);
1152 DynamicConfig cfg = this->config();
1153 PlaceholderParser pp;
1154 std::string new_stem = pp.process(path.stem().string(), 0, &cfg);
1155 final_path = (path.parent_path() / (new_stem + path.extension().string())).string();
1156 }
1157 catch (const std::exception &ex) {
1158 BOOST_LOG_TRIVIAL(error) << "Failed to apply the print statistics to the export file name: " << ex.what();
1159 final_path = path_in;
1160 }
1161 return final_path;
1162}
static char error[256]
Definition tga.cpp:50

References Slic3r::SLAPrintObject::config(), error, and Slic3r::PlaceholderParser::process().

Referenced by Slic3r::BackgroundSlicingProcess::prepare_upload(), Slic3r::BackgroundSlicingProcess::process_sla(), and Slic3r::CLI::run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ placeholders()

DynamicConfig Slic3r::SLAPrintStatistics::placeholders ( )
static
1137{
1138 DynamicConfig config;
1139 for (const char *key : {
1140 "print_time", "total_cost", "total_weight",
1141 "objects_used_material", "support_used_material" })
1142 config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}"));
1143
1144 return config;
1145}

References Slic3r::SLAPrintObject::config().

Referenced by Slic3r::SLAPrint::output_filename().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ estimated_print_time

◆ fast_layers_count

size_t Slic3r::SLAPrintStatistics::fast_layers_count

◆ layers_times

std::vector<double> Slic3r::SLAPrintStatistics::layers_times

◆ objects_used_material

◆ slow_layers_count

size_t Slic3r::SLAPrintStatistics::slow_layers_count

◆ support_used_material

◆ total_cost

double Slic3r::SLAPrintStatistics::total_cost

◆ total_weight

double Slic3r::SLAPrintStatistics::total_weight

The documentation for this struct was generated from the following files: