Improve/fix pattern writer and config

This commit is contained in:
thewildmage
2023-07-07 01:27:28 -06:00
parent 456a20ffdc
commit 3378aaff4e
4 changed files with 136 additions and 86 deletions

View File

@@ -738,7 +738,7 @@ void Preview::load_print_as_fff(bool keep_z_range, bool only_gcode)
unsigned int number_extruders = wxGetApp().is_editor() ?
(unsigned int)print->extruders().size() :
m_canvas->get_gcode_extruders_count();
std::vector<Item> gcodes = wxGetApp().is_editor() ?
std::vector<CustomGCode::Item> gcodes = wxGetApp().is_editor() ?
//BBS
wxGetApp().plater()->model().get_curr_plate_custom_gcodes().gcodes :
m_canvas->get_custom_gcode_per_print_z();

View File

@@ -8131,22 +8131,14 @@ void Plater::_calib_pa_pattern(const Calib_Params& params)
changed_objects({ 0 });
_calib_pa_select_added_objects();
Print* print = p->background_process.fff_print();
print->apply(this->model(), wxGetApp().preset_bundle->full_config());
GCodeWriter writer;
const Vec3d origin = print->get_plate_origin();
writer.set_xy_offset(origin(0), origin(1));
writer.set_is_bbl_machine(print->is_BBL_printer()); // TODO: make sure this is correctly set!
writer.apply_print_config(print->config());
writer.set_extruders({0});
writer.set_extruder(0);
DynamicPrintConfig full_config = wxGetApp().preset_bundle->full_config();
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
CalibPressureAdvancePattern pa_pattern(
params,
print->config(),
writer
model(),
full_config,
preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(preset_bundle),
fff_print().get_plate_origin()
);
GizmoObjectManipulation& giz_obj_manip = p->view3D->get_canvas3d()->