mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-07-26 08:54:25 +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
|
#endif // ENABLE_GCODE_VIEWER
|
||||||
|
|
||||||
// Write a string into a file.
|
// 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);
|
void _write(FILE* file, const char *what, bool flush = false);
|
||||||
|
|
||||||
// Write a string into a file.
|
// 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,
|
// if the gcode was produced by SuperSlicer,
|
||||||
// extract the config from it
|
// extract the config from it
|
||||||
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
try {
|
||||||
DynamicPrintConfig config;
|
if (m_producer == EProducer::PrusaSlicer || m_producer == EProducer::SuperSlicer || m_producer == EProducer::Slic3rPE || m_producer == EProducer::Slic3r) {
|
||||||
config.apply(FullPrintConfig::defaults());
|
DynamicPrintConfig config;
|
||||||
config.load_from_gcode_file(filename);
|
config.apply(FullPrintConfig::defaults());
|
||||||
apply_config(config);
|
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