mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
parent
ca138794d9
commit
7a7187f9ed
5 changed files with 18 additions and 6 deletions
|
@ -1286,10 +1286,11 @@ namespace DoExport {
|
|||
// get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].time) : "N/A";
|
||||
// }
|
||||
|
||||
static void update_print_estimated_stats(const GCodeProcessor& processor, const std::vector<Extruder>& extruders, PrintStatistics& print_statistics)
|
||||
static void update_print_estimated_stats(const GCodeProcessor& processor, const std::vector<Extruder>& extruders, PrintStatistics& print_statistics, const PrintConfig& config)
|
||||
{
|
||||
const GCodeProcessorResult& result = processor.get_result();
|
||||
print_statistics.estimated_normal_print_time = get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time);
|
||||
double normal_print_time = result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Normal)].time;
|
||||
print_statistics.estimated_normal_print_time = get_time_dhms(normal_print_time);
|
||||
print_statistics.estimated_silent_print_time = processor.is_stealth_time_estimator_enabled() ?
|
||||
get_time_dhms(result.print_statistics.modes[static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Stealth)].time) : "N/A";
|
||||
|
||||
|
@ -1327,7 +1328,9 @@ namespace DoExport {
|
|||
total_weight += weight;
|
||||
total_cost += weight * extruder->filament_cost() * 0.001;
|
||||
}
|
||||
|
||||
|
||||
total_cost += config.time_cost.getFloat() * (normal_print_time/3600.0);
|
||||
|
||||
print_statistics.total_extruded_volume = total_extruded_volume;
|
||||
print_statistics.total_used_filament = total_used_filament;
|
||||
print_statistics.total_weight = total_weight;
|
||||
|
@ -1488,7 +1491,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
|
|||
// Post-process the G-code to update time stamps.
|
||||
m_processor.finalize(true);
|
||||
// DoExport::update_print_estimated_times_stats(m_processor, print->m_print_statistics);
|
||||
DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics);
|
||||
DoExport::update_print_estimated_stats(m_processor, m_writer.extruders(), print->m_print_statistics, print->config());
|
||||
if (result != nullptr) {
|
||||
*result = std::move(m_processor.extract_result());
|
||||
// set the filename to the correct value
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue