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

@ -5,6 +5,7 @@
#include <iostream>
#include <map>
#include <assert.h>
#include <GCode/GCodeProcessor.hpp>
#ifdef __APPLE__
#include <boost/spirit/include/karma.hpp>
@ -312,7 +313,8 @@ std::string GCodeWriter::update_progress(unsigned int num, unsigned int tot, boo
std::string GCodeWriter::toolchange_prefix() const
{
return FLAVOR_IS(gcfMakerWare) ? "M135 T" :
return config.manual_filament_change ? ";" + GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Manual_Tool_Change) + "T":
FLAVOR_IS(gcfMakerWare) ? "M135 T" :
FLAVOR_IS(gcfSailfish) ? "M108 T" : "T";
}