OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::PrintStatistics Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Print.hpp>

Collaboration diagram for Slic3r::PrintStatistics:

Public Member Functions

 PrintStatistics ()
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

std::string estimated_normal_print_time
std::string estimated_silent_print_time
double total_used_filament
double total_extruded_volume
double total_cost
int total_toolchanges
double total_weight
double total_wipe_tower_cost
double total_wipe_tower_filament
unsigned int initial_tool
unsigned int initial_no_support_tool
std::map< size_t, double > filament_stats

Static Public Attributes

static const std::string FilamentUsedG = "filament used [g]"
static const std::string FilamentUsedGMask = "; filament used [g] ="
static const std::string TotalFilamentUsedG = "total filament used [g]"
static const std::string TotalFilamentUsedGMask = "; total filament used [g] ="
static const std::string TotalFilamentUsedGValueMask = "; total filament used [g] = %.2lf\n"
static const std::string FilamentUsedCm3 = "filament used [cm3]"
static const std::string FilamentUsedCm3Mask = "; filament used [cm3] ="
static const std::string FilamentUsedMm = "filament used [mm]"
static const std::string FilamentUsedMmMask = "; filament used [mm] ="
static const std::string FilamentCost = "filament cost"
static const std::string FilamentCostMask = "; filament cost ="
static const std::string TotalFilamentCost = "total filament cost"
static const std::string TotalFilamentCostMask = "; total filament cost ="
static const std::string TotalFilamentCostValueMask = "; total filament cost = %.2lf\n"
static const std::string TotalFilamentUsedWipeTower = "total filament used for wipe tower [g]"
static const std::string TotalFilamentUsedWipeTowerValueMask = "; total filament used for wipe tower [g] = %.2lf\n"

Detailed Description

Constructor & Destructor Documentation

◆ PrintStatistics()

Slic3r::PrintStatistics::PrintStatistics ( )
inline
956{ clear(); }
void clear()
Definition Print.hpp:977

References clear().

Here is the call graph for this function:

Member Function Documentation

◆ clear()

void Slic3r::PrintStatistics::clear ( )
inline
977 {
980 total_cost = 0.;
982 total_weight = 0.;
985 initial_tool = 0;
987 filament_stats.clear();
988 }
unsigned int initial_no_support_tool
Definition Print.hpp:967
double total_wipe_tower_cost
Definition Print.hpp:964
unsigned int initial_tool
Definition Print.hpp:966
std::map< size_t, double > filament_stats
Definition Print.hpp:968
double total_used_filament
Definition Print.hpp:959
double total_wipe_tower_filament
Definition Print.hpp:965
int total_toolchanges
Definition Print.hpp:962
double total_extruded_volume
Definition Print.hpp:960
double total_cost
Definition Print.hpp:961
double total_weight
Definition Print.hpp:963

References filament_stats, initial_no_support_tool, initial_tool, total_cost, total_extruded_volume, total_toolchanges, total_used_filament, total_weight, total_wipe_tower_cost, and total_wipe_tower_filament.

Referenced by PrintStatistics(), and Slic3r::DoExport::update_print_stats_and_format_filament_stats().

Here is the caller graph for this function:

◆ config()

DynamicConfig Slic3r::PrintStatistics::config ( ) const
5820{
5821 DynamicConfig config;
5822 std::string normal_print_time = short_time(this->estimated_normal_print_time);
5823 std::string silent_print_time = short_time(this->estimated_silent_print_time);
5824 config.set_key_value("print_time", new ConfigOptionString(normal_print_time));
5825 config.set_key_value("normal_print_time", new ConfigOptionString(normal_print_time));
5826 config.set_key_value("silent_print_time", new ConfigOptionString(silent_print_time));
5827 config.set_key_value("used_filament", new ConfigOptionFloat(this->total_used_filament / 1000.));
5828 config.set_key_value("extruded_volume", new ConfigOptionFloat(this->total_extruded_volume));
5829 config.set_key_value("total_cost", new ConfigOptionFloat(this->total_cost));
5830 config.set_key_value("total_toolchanges", new ConfigOptionInt(this->total_toolchanges));
5831 config.set_key_value("total_weight", new ConfigOptionFloat(this->total_weight));
5832 config.set_key_value("extruded_weight_total", new ConfigOptionFloat(this->total_weight));
5833 config.set_key_value("extruded_volume_total", new ConfigOptionFloat(this->total_extruded_volume));
5834 config.set_key_value("total_wipe_tower_cost", new ConfigOptionFloat(this->total_wipe_tower_cost));
5835 config.set_key_value("total_wipe_tower_filament", new ConfigOptionFloat(this->total_wipe_tower_filament));
5836 config.set_key_value("initial_tool", new ConfigOptionInt(static_cast<int>(this->initial_tool)));
5837 config.set_key_value("initial_extruder", new ConfigOptionInt(static_cast<int>(this->initial_tool)));
5838 config.set_key_value("initial_no_support_extruder", new ConfigOptionInt(static_cast<int>(this->initial_no_support_tool)));
5839 return config;
5840}
zaa_minimize_perimeter_height ConfigOptionFloat
Definition PrintConfig.hpp:1954
std::string short_time(const std::string &time)
Definition Utils.hpp:563
zaa_minimize_perimeter_height ConfigOptionString
Definition PrintConfig.hpp:1702
std::string estimated_normal_print_time
Definition Print.hpp:957
std::string estimated_silent_print_time
Definition Print.hpp:958
DynamicConfig config() const
Definition Print.cpp:5819

References config(), estimated_normal_print_time, estimated_silent_print_time, initial_no_support_tool, initial_tool, Slic3r::short_time(), total_cost, total_extruded_volume, total_toolchanges, total_used_filament, total_weight, total_wipe_tower_cost, and total_wipe_tower_filament.

Referenced by config(), finalize_output_path(), and placeholders().

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

◆ finalize_output_path()

std::string Slic3r::PrintStatistics::finalize_output_path ( const std::string & path_in) const
5854{
5855 std::string final_path;
5856 try {
5857 boost::filesystem::path path(path_in);
5858 DynamicConfig cfg = this->config();
5859 PlaceholderParser pp;
5860 std::string new_stem = pp.process(path.stem().string(), 0, &cfg);
5861 final_path = (path.parent_path() / (new_stem + path.extension().string())).string();
5862 } catch (const std::exception &ex) {
5863 BOOST_LOG_TRIVIAL(error) << "Failed to apply the print statistics to the export file name: " << ex.what();
5864 final_path = path_in;
5865 }
5866 return final_path;
5867}

References config(), finalize_output_path(), and Slic3r::PlaceholderParser::process().

Referenced by finalize_output_path().

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

◆ placeholders()

DynamicConfig Slic3r::PrintStatistics::placeholders ( )
static
5843{
5844 DynamicConfig config;
5845 for (const std::string key : {
5846 "print_time", "normal_print_time", "silent_print_time",
5847 "used_filament", "extruded_volume", "extruded_volume_total", "total_cost", "total_weight", "extruded_weight_total",
5848 "initial_tool", "initial_extruder", "initial_no_support_extruder", "total_toolchanges", "total_wipe_tower_cost", "total_wipe_tower_filament"})
5849 config.set_key_value(key, new ConfigOptionString(std::string("{") + key + "}"));
5850 return config;
5851}

References config(), and placeholders().

Referenced by placeholders().

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

Member Data Documentation

◆ estimated_normal_print_time

std::string Slic3r::PrintStatistics::estimated_normal_print_time

◆ estimated_silent_print_time

std::string Slic3r::PrintStatistics::estimated_silent_print_time

◆ filament_stats

std::map<size_t, double> Slic3r::PrintStatistics::filament_stats

◆ FilamentCost

const std::string Slic3r::PrintStatistics::FilamentCost = "filament cost"
static

◆ FilamentCostMask

const std::string Slic3r::PrintStatistics::FilamentCostMask = "; filament cost ="
static

◆ FilamentUsedCm3

const std::string Slic3r::PrintStatistics::FilamentUsedCm3 = "filament used [cm3]"
static

◆ FilamentUsedCm3Mask

const std::string Slic3r::PrintStatistics::FilamentUsedCm3Mask = "; filament used [cm3] ="
static

◆ FilamentUsedG

const std::string Slic3r::PrintStatistics::FilamentUsedG = "filament used [g]"
static

◆ FilamentUsedGMask

const std::string Slic3r::PrintStatistics::FilamentUsedGMask = "; filament used [g] ="
static

◆ FilamentUsedMm

const std::string Slic3r::PrintStatistics::FilamentUsedMm = "filament used [mm]"
static

◆ FilamentUsedMmMask

const std::string Slic3r::PrintStatistics::FilamentUsedMmMask = "; filament used [mm] ="
static

◆ initial_no_support_tool

unsigned int Slic3r::PrintStatistics::initial_no_support_tool

◆ initial_tool

unsigned int Slic3r::PrintStatistics::initial_tool

◆ total_cost

◆ total_extruded_volume

◆ total_toolchanges

int Slic3r::PrintStatistics::total_toolchanges

◆ total_used_filament

◆ total_weight

◆ total_wipe_tower_cost

double Slic3r::PrintStatistics::total_wipe_tower_cost

◆ total_wipe_tower_filament

double Slic3r::PrintStatistics::total_wipe_tower_filament

◆ TotalFilamentCost

const std::string Slic3r::PrintStatistics::TotalFilamentCost = "total filament cost"
static

◆ TotalFilamentCostMask

const std::string Slic3r::PrintStatistics::TotalFilamentCostMask = "; total filament cost ="
static

◆ TotalFilamentCostValueMask

const std::string Slic3r::PrintStatistics::TotalFilamentCostValueMask = "; total filament cost = %.2lf\n"
static

◆ TotalFilamentUsedG

const std::string Slic3r::PrintStatistics::TotalFilamentUsedG = "total filament used [g]"
static

◆ TotalFilamentUsedGMask

const std::string Slic3r::PrintStatistics::TotalFilamentUsedGMask = "; total filament used [g] ="
static

◆ TotalFilamentUsedGValueMask

const std::string Slic3r::PrintStatistics::TotalFilamentUsedGValueMask = "; total filament used [g] = %.2lf\n"
static

◆ TotalFilamentUsedWipeTower

const std::string Slic3r::PrintStatistics::TotalFilamentUsedWipeTower = "total filament used for wipe tower [g]"
static

◆ TotalFilamentUsedWipeTowerValueMask

const std::string Slic3r::PrintStatistics::TotalFilamentUsedWipeTowerValueMask = "; total filament used for wipe tower [g] = %.2lf\n"
static

The documentation for this struct was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Print.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Print.cpp