mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-25 03:54:27 +08:00
fix settings printing & failsafe for gcode viewer
This commit is contained in:
parent
be088cc149
commit
027bf9f132
@ -465,7 +465,7 @@ private:
|
||||
#endif // ENABLE_GCODE_VIEWER
|
||||
|
||||
// Write a string into a file.
|
||||
void _write(FILE* file, const std::string& what, bool flush = false) { this->_write(file, what.c_str()); }
|
||||
void _write(FILE* file, const std::string& what, bool flush = false) { this->_write(file, what.c_str(), flush); }
|
||||
void _write(FILE* file, const char *what, bool flush = false);
|
||||
|
||||
// Write a string into a file.
|
||||
|
@ -812,11 +812,16 @@ void GCodeProcessor::process_file(const std::string& filename, std::function<voi
|
||||
|
||||
// if the gcode was produced by SuperSlicer,
|
||||
// extract the config from it
|
||||
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||
DynamicPrintConfig config;
|
||||
config.apply(FullPrintConfig::defaults());
|
||||
config.load_from_gcode_file(filename);
|
||||
apply_config(config);
|
||||
try {
|
||||
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||
DynamicPrintConfig config;
|
||||
config.apply(FullPrintConfig::defaults());
|
||||
config.load_from_gcode_file(filename);
|
||||
apply_config(config);
|
||||
}
|
||||
}
|
||||
catch (Exception ex) {
|
||||
m_producer = EProducer::Unknown;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user