diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index d3e3c6c7e..0383fa958 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -1218,6 +1218,11 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) const ConfigOptionBool* spiral_vase = config.option("spiral_mode"); if (spiral_vase != nullptr) m_spiral_vase_active = spiral_vase->value; + + const ConfigOptionEnumGeneric *bed_type = config.option("curr_bed_type"); + if (bed_type != nullptr) + m_result.bed_type = (BedType)bed_type->value; + } void GCodeProcessor::enable_stealth_time_estimator(bool enabled) diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index de1a94657..93babf3aa 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -191,7 +191,7 @@ namespace Slic3r { //BBS std::vector warnings; int nozzle_hrc; - + BedType bed_type = BedType::btCount; #if ENABLE_GCODE_VIEWER_STATISTICS int64_t time{ 0 }; #endif // ENABLE_GCODE_VIEWER_STATISTICS @@ -218,6 +218,7 @@ namespace Slic3r { custom_gcode_per_print_z = other.custom_gcode_per_print_z; spiral_vase_layers = other.spiral_vase_layers; warnings = other.warnings; + bed_type = other.bed_type; #if ENABLE_GCODE_VIEWER_STATISTICS time = other.time; #endif diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index c79f25ff2..3c4a6fa06 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -8172,8 +8172,6 @@ void Plater::load_gcode(const wxString& filename) p->get_current_canvas3D()->render(); //p->notification_manager->bbl_show_plateinfo_notification(into_u8(_L("Preview only mode for gcode file."))); - current_print.apply(this->model(), wxGetApp().preset_bundle->full_config()); - wxBusyCursor wait; // process gcode @@ -8189,6 +8187,16 @@ void Plater::load_gcode(const wxString& filename) } *current_result = std::move(processor.extract_result()); //current_result->filename = filename; + + BedType bed_type = current_result->bed_type; + if (bed_type != BedType::btCount) { + DynamicPrintConfig &proj_config = wxGetApp().preset_bundle->project_config; + proj_config.set_key_value("curr_bed_type", new ConfigOptionEnum(bed_type)); + on_bed_type_change(bed_type); + } + + current_print.apply(this->model(), wxGetApp().preset_bundle->full_config()); + current_print.set_gcode_file_ready(); // show results