ENH: [STUDIO-2450] Update the bed type to be consistent with the gcode

Change-Id: Ic69face644bc193e7125535697905c35ba210058
This commit is contained in:
maosheng.wei 2023-05-19 18:30:42 +08:00 committed by Lane.Wei
parent 2718eafb5a
commit eb3a97f55b
3 changed files with 17 additions and 3 deletions

View File

@ -1218,6 +1218,11 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
const ConfigOptionBool* spiral_vase = config.option<ConfigOptionBool>("spiral_mode");
if (spiral_vase != nullptr)
m_spiral_vase_active = spiral_vase->value;
const ConfigOptionEnumGeneric *bed_type = config.option<ConfigOptionEnumGeneric>("curr_bed_type");
if (bed_type != nullptr)
m_result.bed_type = (BedType)bed_type->value;
}
void GCodeProcessor::enable_stealth_time_estimator(bool enabled)

View File

@ -191,7 +191,7 @@ namespace Slic3r {
//BBS
std::vector<SliceWarning> 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

View File

@ -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<BedType>(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