mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-08 07:27:41 -06:00
Merge branch 'v1.7.2-remote'
Signed-off-by: SoftFever <softfeverever@gmail.com> # Conflicts: # deps/ZLIB/ZLIB.cmake # localization/i18n/OrcaSlicer.pot # localization/i18n/de/OrcaSlicer_de.po # localization/i18n/en/OrcaSlicer_en.po # localization/i18n/es/OrcaSlicer_es.po # localization/i18n/fr/OrcaSlicer_fr.po # localization/i18n/hu/OrcaSlicer_hu.po # localization/i18n/it/OrcaSlicer_it.po # localization/i18n/ja/OrcaSlicer_ja.po # localization/i18n/ko/OrcaSlicer_ko.po # localization/i18n/list.txt # localization/i18n/nl/OrcaSlicer_nl.po # localization/i18n/sv/OrcaSlicer_sv.po # localization/i18n/zh_cn/OrcaSlicer_zh_CN.po # resources/calib/PressureAdvance/pa_pattern.3mf # resources/handy_models/Disc.stl # resources/i18n/de/BambuStudio.mo # resources/i18n/en/BambuStudio.mo # resources/i18n/es/BambuStudio.mo # resources/i18n/fr/BambuStudio.mo # resources/i18n/hu/BambuStudio.mo # resources/i18n/it/BambuStudio.mo # resources/i18n/ja/BambuStudio.mo # resources/i18n/ko/BambuStudio.mo # resources/i18n/nl/BambuStudio.mo # resources/i18n/sv/BambuStudio.mo # resources/i18n/zh_cn/BambuStudio.mo # resources/profiles/Anycubic.json # resources/profiles/Anycubic/machine/Anycubic Kobra 2 0.4 nozzle.json # resources/profiles/BBL.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C 0.4 nozzle.json # resources/profiles/BBL/filament/Bambu ASA @BBL X1C.json # resources/profiles/BBL/filament/Bambu PA-CF @base.json # resources/profiles/BBL/filament/Bambu PA6-CF @BBL X1C.json # resources/profiles/BBL/filament/Bambu PA6-CF @base.json # resources/profiles/BBL/filament/Bambu PETG-CF @BBL X1C.json # resources/profiles/BBL/filament/Bambu Support W @BBL X1.json # resources/profiles/BBL/filament/Bambu TPU 95A @BBL X1.json # resources/profiles/BBL/filament/Generic HIPS @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Generic HIPS @BBL X1C.json # resources/profiles/BBL/filament/Generic PA-CF.json # resources/profiles/BBL/filament/Generic PC.json # resources/profiles/BBL/filament/Generic PETG-CF @BBL X1C.json # resources/profiles/BBL/filament/Generic PLA @0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL P1P.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Generic PLA High Speed @BBL X1C.json # resources/profiles/BBL/filament/Generic PLA-CF.json # resources/profiles/BBL/filament/Generic PLA.json # resources/profiles/BBL/filament/Generic TPU.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL P1P.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Overture Matte PLA @BBL X1C.json # resources/profiles/BBL/filament/Overture Matte PLA @base.json # resources/profiles/BBL/filament/Overture PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/Overture PLA @BBL P1P.json # resources/profiles/BBL/filament/Overture PLA @BBL X1.json # resources/profiles/BBL/filament/Overture PLA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/Overture PLA @BBL X1C.json # resources/profiles/BBL/filament/Overture PLA @base.json # resources/profiles/BBL/filament/P1P/Bambu TPU 95A @BBL P1P.json # resources/profiles/BBL/filament/P1P/Generic PLA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/P1P/Generic TPU @BBL P1P.json # resources/profiles/BBL/filament/P1P/eSUN PLA+ @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/P1P/eSUN PLA+ @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ABS @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ABS @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ABS @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ABS @BBL X1C.json # resources/profiles/BBL/filament/PolyLite ABS @base.json # resources/profiles/BBL/filament/PolyLite ASA @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ASA @BBL P1P.json # resources/profiles/BBL/filament/PolyLite ASA @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite ASA @BBL X1C.json # resources/profiles/BBL/filament/PolyLite ASA @base.json # resources/profiles/BBL/filament/PolyLite PETG @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite PETG @BBL P1P.json # resources/profiles/BBL/filament/PolyLite PETG @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/PolyLite PETG @BBL X1C.json # resources/profiles/BBL/filament/PolyLite PETG @base.json # resources/profiles/BBL/filament/PolyLite PLA @BBL X1.json # resources/profiles/BBL/filament/PolyTerra PLA @BBL X1.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/filament/eSUN PLA+ @BBL X1C.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1P 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab P1S 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 0.8 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.2 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.4 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.6 nozzle.json # resources/profiles/BBL/machine/Bambu Lab X1 Carbon 0.8 nozzle.json # resources/profiles/BBL/machine/fdm_bbl_3dp_001_common.json # resources/profiles/BBL/process/0.06mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.08mm Extra Fine @BBL P1P.json # resources/profiles/BBL/process/0.08mm Extra Fine @BBL X1C.json # resources/profiles/BBL/process/0.08mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.10mm Standard @BBL P1P 0.2 nozzle.json # resources/profiles/BBL/process/0.10mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.12mm Fine @BBL P1P.json # resources/profiles/BBL/process/0.12mm Fine @BBL X1C.json # resources/profiles/BBL/process/0.12mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.14mm Standard @BBL X1C 0.2 nozzle.json # resources/profiles/BBL/process/0.16mm Optimal @BBL P1P.json # resources/profiles/BBL/process/0.16mm Optimal @BBL X1C.json # resources/profiles/BBL/process/0.18mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.20mm Standard @BBL P1P.json # resources/profiles/BBL/process/0.20mm Standard @BBL X1C.json # resources/profiles/BBL/process/0.20mm Strength @BBL P1P.json # resources/profiles/BBL/process/0.20mm Strength @BBL X1C.json # resources/profiles/BBL/process/0.24mm Draft @BBL P1P.json # resources/profiles/BBL/process/0.24mm Draft @BBL X1C.json # resources/profiles/BBL/process/0.24mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.24mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.28mm Extra Draft @BBL P1P.json # resources/profiles/BBL/process/0.28mm Extra Draft @BBL X1C.json # resources/profiles/BBL/process/0.30mm Standard @BBL P1P 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Standard @BBL X1 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.30mm Strength @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.32mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.36mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL P1P 0.8 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL X1 0.8 nozzle.json # resources/profiles/BBL/process/0.40mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.42mm Standard @BBL X1C 0.6 nozzle.json # resources/profiles/BBL/process/0.48mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/0.56mm Standard @BBL X1C 0.8 nozzle.json # resources/profiles/BBL/process/fdm_process_bbl_common.json # resources/profiles/Creality.json # resources/profiles/Creality/machine/Creality CR-10 Max 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-10 V2 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.2 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.6 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 Max 0.8 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.2 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.4 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.6 nozzle.json # resources/profiles/Creality/machine/Creality CR-6 SE 0.8 nozzle.json # resources/profiles/Creality/machine/Creality Ender-3 S1 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-3 S1 Pro 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 Plus 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5 S1 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-5S 0.4 nozzle.json # resources/profiles/Creality/machine/Creality Ender-6 0.4 nozzle.json # resources/profiles/Elegoo.json # resources/profiles/Elegoo/machine/Elegoo Neptune 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2D 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 2S 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Max 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Plus 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune 3 Pro 0.4 nozzle.json # resources/profiles/Elegoo/machine/Elegoo Neptune X 0.4 nozzle.json # resources/profiles/Prusa.json # resources/profiles/Prusa/machine/Prusa MINI 0.4 nozzle.json # resources/profiles/Prusa/machine/Prusa MK3S 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-CF Pro 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Max 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Max 3 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Plus 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Plus 3 0.4 nozzle.json # resources/profiles/Qidi/machine/Qidi X-Smart 3 0.4 nozzle.json # resources/profiles/Tronxy.json # resources/profiles/Tronxy/machine/Tronxy X5SA 400 0.4 nozzle.json # resources/profiles/Tronxy/process/0.08mm Extra Fine @Tronxy.json # resources/profiles/Tronxy/process/0.12mm Fine @Tronxy.json # resources/profiles/Tronxy/process/0.15mm Optimal @Tronxy.json # resources/profiles/Tronxy/process/0.20mm Standard @Tronxy.json # resources/profiles/Tronxy/process/0.24mm Draft @Tronxy.json # resources/profiles/Tronxy/process/0.28mm Extra Draft @Tronxy.json # resources/profiles/Voxelab/machine/Voxelab Aquila X2 0.4 nozzle.json # resources/web/data/text.js # src/OrcaSlicer.cpp # src/libslic3r/GCode.cpp # src/libslic3r/GCode/SeamPlacer.cpp # src/libslic3r/GCode/SeamPlacer.hpp # src/libslic3r/GCodeWriter.cpp # src/libslic3r/GCodeWriter.hpp # src/libslic3r/Preset.cpp # src/libslic3r/PresetBundle.cpp # src/libslic3r/Print.cpp # src/libslic3r/PrintConfig.cpp # src/libslic3r/PrintConfig.hpp # src/libslic3r/TreeSupport.cpp # src/libslic3r/calib.cpp # src/libslic3r/calib.hpp # src/slic3r/GUI/BackgroundSlicingProcess.cpp # src/slic3r/GUI/BedShapeDialog.cpp # src/slic3r/GUI/ConfigManipulation.cpp # src/slic3r/GUI/GUI.cpp # src/slic3r/GUI/GUI_App.cpp # src/slic3r/GUI/GUI_Factories.cpp # src/slic3r/GUI/GUI_ObjectList.cpp # src/slic3r/GUI/Jobs/ArrangeJob.cpp # src/slic3r/GUI/OptionsGroup.cpp # src/slic3r/GUI/PartPlate.cpp # src/slic3r/GUI/PartPlate.hpp # src/slic3r/GUI/Plater.cpp # src/slic3r/GUI/StatusPanel.cpp # src/slic3r/GUI/Tab.cpp # src/slic3r/GUI/Widgets/AMSControl.hpp # version.inc
This commit is contained in:
commit
b8172316b8
608 changed files with 23446 additions and 10493 deletions
|
@ -980,6 +980,33 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
|
|||
return gcode;
|
||||
}
|
||||
|
||||
bool WipeTowerIntegration::is_empty_wipe_tower_gcode(GCode &gcodegen, int extruder_id, bool finish_layer)
|
||||
{
|
||||
assert(m_layer_idx >= 0);
|
||||
if (m_layer_idx >= (int) m_tool_changes.size())
|
||||
return true;
|
||||
|
||||
bool ignore_sparse = false;
|
||||
if (gcodegen.config().wipe_tower_no_sparse_layers.value) {
|
||||
ignore_sparse = (m_tool_changes[m_layer_idx].size() == 1 && m_tool_changes[m_layer_idx].front().initial_tool == m_tool_changes[m_layer_idx].front().new_tool);
|
||||
}
|
||||
|
||||
if (m_enable_timelapse_print && m_is_first_print) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (gcodegen.writer().need_toolchange(extruder_id) || finish_layer) {
|
||||
if (!(size_t(m_tool_change_idx) < m_tool_changes[m_layer_idx].size()))
|
||||
throw Slic3r::RuntimeError("Wipe tower generation failed, possibly due to empty first layer.");
|
||||
|
||||
if (!ignore_sparse) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
// Print is finished. Now it remains to unload the filament safely with ramming over the wipe tower.
|
||||
std::string WipeTowerIntegration::finalize(GCode &gcodegen)
|
||||
{
|
||||
|
@ -1364,6 +1391,7 @@ namespace DoExport {
|
|||
if (ret.size() < MAX_TAGS_COUNT) check(_(L("Machine end G-code")), config.machine_end_gcode.value);
|
||||
if (ret.size() < MAX_TAGS_COUNT) check(_(L("Before layer change G-code")), config.before_layer_change_gcode.value);
|
||||
if (ret.size() < MAX_TAGS_COUNT) check(_(L("Layer change G-code")), config.layer_change_gcode.value);
|
||||
if (ret.size() < MAX_TAGS_COUNT) check(_(L("Time lapse G-code")), config.time_lapse_gcode.value);
|
||||
if (ret.size() < MAX_TAGS_COUNT) check(_(L("Change filament G-code")), config.change_filament_gcode.value);
|
||||
//BBS
|
||||
//if (ret.size() < MAX_TAGS_COUNT) check(_(L("Printing by object G-code")), config.printing_by_object_gcode.value);
|
||||
|
@ -1486,6 +1514,16 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
|
|||
|
||||
BOOST_LOG_TRIVIAL(debug) << "Start processing gcode, " << log_memory_info();
|
||||
// Post-process the G-code to update time stamps.
|
||||
|
||||
m_timelapse_warning_code = 0;
|
||||
if (m_config.printer_structure.value == PrinterStructure::psI3 && m_spiral_vase) {
|
||||
m_timelapse_warning_code += 1;
|
||||
}
|
||||
if (m_config.printer_structure.value == PrinterStructure::psI3 && print->config().print_sequence == PrintSequence::ByObject) {
|
||||
m_timelapse_warning_code += (1 << 1);
|
||||
}
|
||||
m_processor.result().timelapse_warning_code = m_timelapse_warning_code;
|
||||
m_processor.result().support_traditional_timelapse = m_support_traditional_timelapse;
|
||||
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);
|
||||
|
@ -1648,16 +1686,13 @@ namespace DoExport {
|
|||
output((boost::format("; thumbnail begin %dx%d %d\n") % data.width % data.height % encoded.size()).str().c_str());
|
||||
|
||||
unsigned int row_count = 0;
|
||||
while (encoded.size() > max_row_length)
|
||||
{
|
||||
output((boost::format("; %s\n") % encoded.substr(0, max_row_length)).str().c_str());
|
||||
encoded = encoded.substr(max_row_length);
|
||||
//BBS: optimize performance ,reduce too much memeory operation
|
||||
size_t current_index = 0;
|
||||
while(current_index<encoded.size()){
|
||||
output((boost::format("; %s\n") % encoded.substr(current_index, max_row_length)).str().c_str());
|
||||
current_index+=std::min(max_row_length,encoded.size()-current_index);
|
||||
++row_count;
|
||||
}
|
||||
|
||||
if (encoded.size() > 0)
|
||||
output((boost::format("; %s\n") % encoded).str().c_str());
|
||||
|
||||
output("; thumbnail end\n");
|
||||
output("; THUMBNAIL_BLOCK_END\n\n");
|
||||
|
||||
|
@ -1946,7 +1981,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
[&print]() { print.throw_if_canceled(); });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Write some terse information on the slicing parameters.
|
||||
const PrintObject *first_object = print.objects().front();
|
||||
|
@ -2246,8 +2281,12 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
file.writeln(this->placeholder_parser_process("filament_start_gcode", print.config().filament_start_gcode.values[initial_extruder_id], initial_extruder_id, &config));
|
||||
}
|
||||
*/
|
||||
if (is_bbl_printers)
|
||||
if (is_bbl_printers) {
|
||||
this->_print_first_layer_extruder_temperatures(file, print, machine_start_gcode, initial_extruder_id, true);
|
||||
if (m_config.support_air_filtration.getBool() && m_config.activate_air_filtration.get_at(initial_extruder_id)) {
|
||||
file.write(m_writer.set_exhaust_fan(m_config.during_print_exhaust_fan_speed.get_at(initial_extruder_id), true));
|
||||
}
|
||||
}
|
||||
print.throw_if_canceled();
|
||||
|
||||
// Set other general things.
|
||||
|
@ -2518,6 +2557,9 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
file.write(m_writer.update_progress(m_layer_count, m_layer_count, true)); // 100%
|
||||
file.write(m_writer.postamble());
|
||||
|
||||
file.write(m_writer.set_chamber_temperature(0, false)); //close chamber_temperature
|
||||
|
||||
|
||||
// adds tags for time estimators
|
||||
file.write_format(";%s\n", GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Last_Line_M73_Placeholder).c_str());
|
||||
file.write_format("; EXECUTABLE_BLOCK_END\n\n");
|
||||
|
@ -2567,6 +2609,19 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
|
|||
}
|
||||
file.write("\n");
|
||||
|
||||
bool activate_air_filtration = false;
|
||||
for (const auto& extruder : m_writer.extruders())
|
||||
activate_air_filtration |= m_config.activate_air_filtration.get_at(extruder.id());
|
||||
activate_air_filtration &= m_config.support_air_filtration.getBool();
|
||||
|
||||
if (activate_air_filtration) {
|
||||
int complete_print_exhaust_fan_speed = 0;
|
||||
for (const auto& extruder : m_writer.extruders())
|
||||
if (m_config.activate_air_filtration.get_at(extruder.id()))
|
||||
complete_print_exhaust_fan_speed = std::max(complete_print_exhaust_fan_speed, m_config.complete_print_exhaust_fan_speed.get_at(extruder.id()));
|
||||
file.write(m_writer.set_exhaust_fan(complete_print_exhaust_fan_speed, true));
|
||||
}
|
||||
|
||||
print.throw_if_canceled();
|
||||
}
|
||||
|
||||
|
@ -2885,6 +2940,7 @@ int GCode::get_bed_temperature(const int extruder_id, const bool is_first_layer,
|
|||
return bed_temp_opt->get_at(extruder_id);
|
||||
}
|
||||
|
||||
|
||||
// Write 1st layer bed temperatures into the G-code.
|
||||
// Only do that if the start G-code does not already contain any M-code controlling an extruder temperature.
|
||||
// M140 - Set Extruder Temperature
|
||||
|
@ -3320,10 +3376,45 @@ GCode::LayerResult GCode::process_layer(
|
|||
+ "\n";
|
||||
}
|
||||
|
||||
PrinterStructure printer_structure = m_config.printer_structure.value;
|
||||
bool need_insert_timelapse_gcode_for_traditional = false;
|
||||
if (printer_structure == PrinterStructure::psI3 &&
|
||||
!m_spiral_vase &&
|
||||
(!m_wipe_tower || !m_wipe_tower->enable_timelapse_print()) &&
|
||||
print.config().print_sequence == PrintSequence::ByLayer) {
|
||||
need_insert_timelapse_gcode_for_traditional = true;
|
||||
}
|
||||
bool has_insert_timelapse_gcode = false;
|
||||
bool has_wipe_tower = (layer_tools.has_wipe_tower && m_wipe_tower);
|
||||
|
||||
auto insert_timelapse_gcode = [this, print_z, &print]() -> std::string {
|
||||
std::string gcode_res;
|
||||
if (!print.config().time_lapse_gcode.value.empty()) {
|
||||
DynamicConfig config;
|
||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||
config.set_key_value("layer_z", new ConfigOptionFloat(print_z));
|
||||
config.set_key_value("max_layer_z", new ConfigOptionFloat(m_max_layer_z));
|
||||
gcode_res = this->placeholder_parser_process("timelapse_gcode", print.config().time_lapse_gcode.value, m_writer.extruder()->id(), &config) + "\n";
|
||||
}
|
||||
return gcode_res;
|
||||
};
|
||||
|
||||
// BBS: don't use lazy_raise when enable spiral vase
|
||||
gcode += this->change_layer(print_z); // this will increase m_layer_index
|
||||
m_layer = &layer;
|
||||
m_object_layer_over_raft = false;
|
||||
if (printer_structure == PrinterStructure::psI3 && !need_insert_timelapse_gcode_for_traditional && !m_spiral_vase && print.config().print_sequence == PrintSequence::ByLayer) {
|
||||
std::string timepals_gcode = insert_timelapse_gcode();
|
||||
gcode += timepals_gcode;
|
||||
m_writer.set_current_position_clear(false);
|
||||
//BBS: check whether custom gcode changes the z position. Update if changed
|
||||
double temp_z_after_timepals_gcode;
|
||||
if (GCodeProcessor::get_last_z_from_gcode(timepals_gcode, temp_z_after_timepals_gcode)) {
|
||||
Vec3d pos = m_writer.get_position();
|
||||
pos(2) = temp_z_after_timepals_gcode;
|
||||
m_writer.set_position(pos);
|
||||
}
|
||||
}
|
||||
if (! print.config().layer_change_gcode.value.empty()) {
|
||||
DynamicConfig config;
|
||||
config.set_key_value("layer_num", new ConfigOptionInt(m_layer_index));
|
||||
|
@ -3633,9 +3724,29 @@ GCode::LayerResult GCode::process_layer(
|
|||
// Extrude the skirt, brim, support, perimeters, infill ordered by the extruders.
|
||||
for (unsigned int extruder_id : layer_tools.extruders)
|
||||
{
|
||||
gcode += (layer_tools.has_wipe_tower && m_wipe_tower) ?
|
||||
m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()) :
|
||||
this->set_extruder(extruder_id, print_z);
|
||||
if (has_wipe_tower) {
|
||||
if (!m_wipe_tower->is_empty_wipe_tower_gcode(*this, extruder_id, extruder_id == layer_tools.extruders.back())) {
|
||||
if (need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode) {
|
||||
gcode += this->retract(false, false, LiftType::NormalLift);
|
||||
m_writer.add_object_change_labels(gcode);
|
||||
|
||||
std::string timepals_gcode = insert_timelapse_gcode();
|
||||
gcode += timepals_gcode;
|
||||
m_writer.set_current_position_clear(false);
|
||||
//BBS: check whether custom gcode changes the z position. Update if changed
|
||||
double temp_z_after_timepals_gcode;
|
||||
if (GCodeProcessor::get_last_z_from_gcode(timepals_gcode, temp_z_after_timepals_gcode)) {
|
||||
Vec3d pos = m_writer.get_position();
|
||||
pos(2) = temp_z_after_timepals_gcode;
|
||||
m_writer.set_position(pos);
|
||||
}
|
||||
has_insert_timelapse_gcode = true;
|
||||
}
|
||||
gcode += m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back());
|
||||
}
|
||||
} else {
|
||||
gcode += this->set_extruder(extruder_id, print_z);
|
||||
}
|
||||
|
||||
// let analyzer tag generator aware of a role type change
|
||||
if (layer_tools.has_wipe_tower && m_wipe_tower)
|
||||
|
@ -3829,11 +3940,11 @@ GCode::LayerResult GCode::process_layer(
|
|||
//BBS: for first layer, we always print wall firstly to get better bed adhesive force
|
||||
//This behaviour is same with cura
|
||||
if (is_infill_first && !first_layer) {
|
||||
gcode += this->extrude_infill(print, by_region_specific, false);
|
||||
gcode += this->extrude_infill(print, by_region_specific, false);
|
||||
gcode += this->extrude_perimeters(print, by_region_specific);
|
||||
} else {
|
||||
gcode += this->extrude_perimeters(print, by_region_specific);
|
||||
gcode += this->extrude_infill(print,by_region_specific, false);
|
||||
gcode += this->extrude_infill(print,by_region_specific, false);
|
||||
}
|
||||
// ironing
|
||||
gcode += this->extrude_infill(print,by_region_specific, true);
|
||||
|
@ -3892,6 +4003,25 @@ GCode::LayerResult GCode::process_layer(
|
|||
BOOST_LOG_TRIVIAL(trace) << "Exported layer " << layer.id() << " print_z " << print_z <<
|
||||
log_memory_info();
|
||||
|
||||
if (!has_wipe_tower && need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode) {
|
||||
if (m_support_traditional_timelapse)
|
||||
m_support_traditional_timelapse = false;
|
||||
|
||||
gcode += this->retract(false, false, LiftType::NormalLift);
|
||||
m_writer.add_object_change_labels(gcode);
|
||||
|
||||
std::string timepals_gcode = insert_timelapse_gcode();
|
||||
gcode += timepals_gcode;
|
||||
m_writer.set_current_position_clear(false);
|
||||
//BBS: check whether custom gcode changes the z position. Update if changed
|
||||
double temp_z_after_timepals_gcode;
|
||||
if (GCodeProcessor::get_last_z_from_gcode(timepals_gcode, temp_z_after_timepals_gcode)) {
|
||||
Vec3d pos = m_writer.get_position();
|
||||
pos(2) = temp_z_after_timepals_gcode;
|
||||
m_writer.set_position(pos);
|
||||
}
|
||||
}
|
||||
|
||||
result.gcode = std::move(gcode);
|
||||
result.cooling_buffer_flush = object_layer || raft_layer || last_layer;
|
||||
return result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue