Add "Manual filament change" option and logic (#2379)

* Add "Manual filament change" option and logic

* make suggested changes

* make suggested changes

* change tag from "CHANGE_TOOL" to "MANUAL_TOOL_CHANGE"

* some tweaks

* More fixes

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
Co-authored-by: SoftFever <103989404+SoftFever@users.noreply.github.com>
This commit is contained in:
Ocraftyone 2023-10-22 07:31:09 -04:00 committed by GitHub
parent 90601c098a
commit f84e94faf7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 32 additions and 5 deletions

View file

@ -5431,7 +5431,8 @@ std::string GCode::set_extruder(unsigned int extruder_id, double print_z)
// Process the custom change_filament_gcode.
const std::string& change_filament_gcode = m_config.change_filament_gcode.value;
std::string toolchange_gcode_parsed;
if (!change_filament_gcode.empty()) {
//Orca: Ignore change_filament_gcode if is the first call for a tool change and manual_filament_change is enabled
if (!change_filament_gcode.empty() && !(m_config.manual_filament_change.value && m_toolchange_count == 1)) {
toolchange_gcode_parsed = placeholder_parser_process("change_filament_gcode", change_filament_gcode, extruder_id, &dyn_config);
check_add_eol(toolchange_gcode_parsed);
gcode += toolchange_gcode_parsed;