mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-14 02:07:54 -06:00
Fix a regression that total layer number is missign for BBL printers
This commit is contained in:
parent
189960af17
commit
43353a6036
1 changed files with 22 additions and 12 deletions
|
@ -4415,33 +4415,43 @@ void GCodeProcessor::run_post_process()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
} else if (line == reserved_tag(ETags::Estimated_Printing_Time_Placeholder)) {
|
||||||
else if (line == reserved_tag(ETags::Estimated_Printing_Time_Placeholder)) {
|
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||||
const TimeMachine& machine = m_time_processor.machines[i];
|
const TimeMachine& machine = m_time_processor.machines[i];
|
||||||
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
|
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
|
||||||
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
|
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(buf, "; estimated printing time (%s mode) = %s\n",
|
if (!s_IsBBLPrinter)
|
||||||
(mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
|
// Orca: compatibility with klipper_estimator
|
||||||
get_time_dhms(machine.time).c_str());
|
sprintf(buf, "; estimated printing time (%s mode) = %s\n",
|
||||||
|
(mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
|
||||||
|
get_time_dhms(machine.time).c_str());
|
||||||
|
else {
|
||||||
|
sprintf(buf, "; model printing time: %s; total estimated time: %s\n",
|
||||||
|
get_time_dhms(machine.time - machine.prepare_time).c_str(), get_time_dhms(machine.time).c_str());
|
||||||
|
}
|
||||||
export_lines.append_line(buf);
|
export_lines.append_line(buf);
|
||||||
processed = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||||
const TimeMachine& machine = m_time_processor.machines[i];
|
const TimeMachine& machine = m_time_processor.machines[i];
|
||||||
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
|
PrintEstimatedStatistics::ETimeMode mode = static_cast<PrintEstimatedStatistics::ETimeMode>(i);
|
||||||
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
|
if (mode == PrintEstimatedStatistics::ETimeMode::Normal || machine.enabled) {
|
||||||
char buf[128];
|
char buf[128];
|
||||||
sprintf(buf, "; estimated first layer printing time (%s mode) = %s\n",
|
sprintf(buf, "; estimated first layer printing time (%s mode) = %s\n",
|
||||||
(mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
|
(mode == PrintEstimatedStatistics::ETimeMode::Normal) ? "normal" : "silent",
|
||||||
get_time_dhms(machine.prepare_time).c_str());
|
get_time_dhms(machine.prepare_time).c_str());
|
||||||
export_lines.append_line(buf);
|
export_lines.append_line(buf);
|
||||||
processed = true;
|
processed = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Orca: write total layer number, this is used by Bambu printers only as of now
|
||||||
|
else if (line == reserved_tag(ETags::Total_Layer_Number_Placeholder)) {
|
||||||
|
char buf[128];
|
||||||
|
sprintf(buf, "; total layer number: %u\n", m_layer_id);
|
||||||
|
export_lines.append_line(buf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return processed;
|
return processed;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue