#6117 - Allow import of gcode files processed by ArcWelder

This commit is contained in:
enricoturri1966 2021-02-24 09:46:42 +01:00
parent dfae147a15
commit e44c1006d5
3 changed files with 4 additions and 4 deletions

View File

@ -616,11 +616,11 @@ void ConfigBase::load(const boost::property_tree::ptree &tree)
}
// Load the config keys from the tail of a G-code file.
void ConfigBase::load_from_gcode_file(const std::string &file)
void ConfigBase::load_from_gcode_file(const std::string& file, bool check_header)
{
// Read a 64k block from the end of the G-code.
boost::nowide::ifstream ifs(file);
{
if (check_header) {
const char slic3r_gcode_header[] = "; generated by Slic3r ";
const char prusaslicer_gcode_header[] = "; generated by PrusaSlicer ";
std::string firstline;

View File

@ -1791,7 +1791,7 @@ public:
void setenv_() const;
void load(const std::string &file);
void load_from_ini(const std::string &file);
void load_from_gcode_file(const std::string &file);
void load_from_gcode_file(const std::string& file, bool check_header = true);
// Returns number of key/value pairs extracted.
size_t load_from_gcode_string(const char* str);
void load(const boost::property_tree::ptree &tree);

View File

@ -970,7 +970,7 @@ void GCodeProcessor::process_file(const std::string& filename, bool apply_postpr
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
DynamicPrintConfig config;
config.apply(FullPrintConfig::defaults());
config.load_from_gcode_file(filename);
config.load_from_gcode_file(filename, false);
apply_config(config);
}
}