mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-18 04:08:02 -06:00
#6117 - Allow import of gcode files processed by ArcWelder
This commit is contained in:
parent
dfae147a15
commit
e44c1006d5
3 changed files with 4 additions and 4 deletions
|
@ -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.
|
// 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.
|
// Read a 64k block from the end of the G-code.
|
||||||
boost::nowide::ifstream ifs(file);
|
boost::nowide::ifstream ifs(file);
|
||||||
{
|
if (check_header) {
|
||||||
const char slic3r_gcode_header[] = "; generated by Slic3r ";
|
const char slic3r_gcode_header[] = "; generated by Slic3r ";
|
||||||
const char prusaslicer_gcode_header[] = "; generated by PrusaSlicer ";
|
const char prusaslicer_gcode_header[] = "; generated by PrusaSlicer ";
|
||||||
std::string firstline;
|
std::string firstline;
|
||||||
|
|
|
@ -1791,7 +1791,7 @@ public:
|
||||||
void setenv_() const;
|
void setenv_() const;
|
||||||
void load(const std::string &file);
|
void load(const std::string &file);
|
||||||
void load_from_ini(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.
|
// Returns number of key/value pairs extracted.
|
||||||
size_t load_from_gcode_string(const char* str);
|
size_t load_from_gcode_string(const char* str);
|
||||||
void load(const boost::property_tree::ptree &tree);
|
void load(const boost::property_tree::ptree &tree);
|
||||||
|
|
|
@ -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) {
|
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||||
DynamicPrintConfig config;
|
DynamicPrintConfig config;
|
||||||
config.apply(FullPrintConfig::defaults());
|
config.apply(FullPrintConfig::defaults());
|
||||||
config.load_from_gcode_file(filename);
|
config.load_from_gcode_file(filename, false);
|
||||||
apply_config(config);
|
apply_config(config);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue