mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-11-02 20:51:23 -07:00
NEW: Add Ellis' pattern method for pressure advance calibration
Add a new calibration pattern method for pressure advance calibration, which can better test the influence of k value on the corner. The changes of this patch are picked from OrcaSlicer by thewildmage, thanks to thewildmage for the great work! github issue: https://github.com/bambulab/BambuStudio/issues/2222 Change-Id: Icc8fd4d52b20c1668bfa08716b48549dfada515b (cherry picked from commit eb72d8b681bef270906406a2d10a36d4efbce900) (cherry picked from commit 2b07c1154f4a009612f951938e7865dc338b2d9b)
This commit is contained in:
parent
d3785577ef
commit
047015fa5e
12 changed files with 1131 additions and 279 deletions
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -8337,55 +8337,140 @@ void Plater::calib_pa(const Calib_Params ¶ms)
|
|||
const auto calib_pa_name = wxString::Format(L"Pressure Advance Test");
|
||||
new_project(false, false, calib_pa_name);
|
||||
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
|
||||
if (params.mode == CalibMode::Calib_PA_Line) {
|
||||
add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/pressure_advance_test.stl");
|
||||
} else {
|
||||
add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/tower_with_seam.stl");
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionInts{1});
|
||||
// todo: for 3rd printer
|
||||
//print_config->set_key_value("default_jerk", new ConfigOptionFloat(1.0f));
|
||||
//print_config->set_key_value("outer_wall_jerk", new ConfigOptionFloat(1.0f));
|
||||
//print_config->set_key_value("inner_wall_jerk", new ConfigOptionFloat(1.0f));
|
||||
if (print_config->option<ConfigOptionEnum<PerimeterGeneratorType>>("wall_generator")->value == PerimeterGeneratorType::Arachne)
|
||||
print_config->set_key_value("wall_transition_angle", new ConfigOptionFloat(25));
|
||||
model().objects[0]->config.set_key_value("seam_position", new ConfigOptionEnum<SeamPosition>(spRear));
|
||||
|
||||
changed_objects({0});
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINTER)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config();
|
||||
|
||||
auto new_height = std::ceil((params.end - params.start) / params.step) + 1;
|
||||
auto obj_bb = model().objects[0]->bounding_box();
|
||||
if (new_height < obj_bb.size().z()) {
|
||||
std::array<Vec3d, 4> plane_pts = get_cut_plane(obj_bb, new_height);
|
||||
cut(0, 0, plane_pts, ModelObjectCutAttribute::KeepLower);
|
||||
}
|
||||
|
||||
// automatic selection of added objects
|
||||
// update printable state for new volumes on canvas3D
|
||||
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_objects({0});
|
||||
|
||||
Selection &selection = p->view3D->get_canvas3d()->get_selection();
|
||||
selection.clear();
|
||||
selection.add_object(0, false);
|
||||
|
||||
// BBS: update object list selection
|
||||
p->sidebar->obj_list()->update_selections();
|
||||
selection.notify_instance_update(-1, -1);
|
||||
if (p->view3D->get_canvas3d()->get_gizmos_manager().is_enabled())
|
||||
// this is required because the selected object changed and the flatten on face an sla support gizmos need to be updated accordingly
|
||||
p->view3D->get_canvas3d()->update_gizmos_on_off_state();
|
||||
switch (params.mode) {
|
||||
case CalibMode::Calib_PA_Line:
|
||||
add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/pressure_advance_test.stl");
|
||||
break;
|
||||
case CalibMode::Calib_PA_Pattern:
|
||||
_calib_pa_pattern(params);
|
||||
break;
|
||||
case CalibMode::Calib_PA_Tower:
|
||||
_calib_pa_tower(params);
|
||||
break;
|
||||
default: break;
|
||||
}
|
||||
|
||||
p->background_process.fff_print()->set_calib_params(params);
|
||||
}
|
||||
|
||||
void Plater::_calib_pa_pattern(const Calib_Params ¶ms)
|
||||
{
|
||||
// add "handle" cube
|
||||
sidebar().obj_list()->load_generic_subobject("Cube", ModelVolumeType::INVALID);
|
||||
orient();
|
||||
changed_objects({0});
|
||||
_calib_pa_select_added_objects();
|
||||
|
||||
const DynamicPrintConfig &printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||
DynamicPrintConfig & print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
float nozzle_diameter = printer_config.option<ConfigOptionFloats>("nozzle_diameter")->get_at(0);
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().float_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloat(opt.second));
|
||||
}
|
||||
print_config.set_key_value("outer_wall_speed",
|
||||
new ConfigOptionFloat(CalibPressureAdvance::find_optimal_PA_speed(
|
||||
wxGetApp().preset_bundle->full_config(), print_config.get_abs_value("line_width"),
|
||||
print_config.get_abs_value("layer_height"), 0)));
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().nozzle_ratio_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionFloat(nozzle_diameter * opt.second / 100));
|
||||
}
|
||||
|
||||
for (const auto opt : SuggestedConfigCalibPAPattern().int_pairs) {
|
||||
print_config.set_key_value(opt.first, new ConfigOptionInt(opt.second));
|
||||
}
|
||||
|
||||
print_config.set_key_value(SuggestedConfigCalibPAPattern().brim_pair.first,
|
||||
new ConfigOptionEnum<BrimType>(SuggestedConfigCalibPAPattern().brim_pair.second));
|
||||
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config();
|
||||
|
||||
const DynamicPrintConfig full_config = wxGetApp().preset_bundle->full_config();
|
||||
PresetBundle * preset_bundle = wxGetApp().preset_bundle;
|
||||
const bool is_bbl_machine = preset_bundle->printers.get_edited_preset().has_lidar(preset_bundle);
|
||||
const Vec3d plate_origin = get_partplate_list().get_current_plate_origin();
|
||||
CalibPressureAdvancePattern pa_pattern(params, full_config, is_bbl_machine, model(), plate_origin);
|
||||
|
||||
// scale cube to suit test
|
||||
GizmoObjectManipulation &giz_obj_manip = p->view3D->get_canvas3d()->get_gizmos_manager().get_object_manipulation();
|
||||
giz_obj_manip.set_uniform_scaling(true);
|
||||
giz_obj_manip.on_change("size", 0, pa_pattern.handle_xy_size());
|
||||
giz_obj_manip.set_uniform_scaling(false);
|
||||
giz_obj_manip.on_change("size", 2, pa_pattern.max_layer_z());
|
||||
// start with pattern centered on plate
|
||||
center_selection();
|
||||
const Vec3d plate_center = get_partplate_list().get_curr_plate()->get_center_origin();
|
||||
giz_obj_manip.on_change("position", 0, plate_center.x() - (pa_pattern.print_size_x() / 2));
|
||||
giz_obj_manip.on_change("position", 1, plate_center.y() - (pa_pattern.print_size_y() / 2) - pa_pattern.handle_spacing());
|
||||
|
||||
pa_pattern.generate_custom_gcodes(full_config, is_bbl_machine, model(), plate_origin);
|
||||
model().calib_pa_pattern = std::make_unique<CalibPressureAdvancePattern>(pa_pattern);
|
||||
changed_objects({0});
|
||||
}
|
||||
|
||||
void Plater::_calib_pa_tower(const Calib_Params ¶ms)
|
||||
{
|
||||
add_model(false, Slic3r::resources_dir() + "/calib/pressure_advance/tower_with_seam.stl");
|
||||
|
||||
auto print_config = &wxGetApp().preset_bundle->prints.get_edited_preset().config;
|
||||
auto printer_config = &wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||
auto filament_config = &wxGetApp().preset_bundle->filaments.get_edited_preset().config;
|
||||
|
||||
const float nozzle_diameter = printer_config->option<ConfigOptionFloats>("nozzle_diameter")->get_at(0);
|
||||
|
||||
filament_config->set_key_value("slow_down_layer_time", new ConfigOptionInts{1});
|
||||
//print_config->set_key_value("default_jerk", new ConfigOptionFloat(1.0f));
|
||||
//print_config->set_key_value("outer_wall_jerk", new ConfigOptionFloat(1.0f));
|
||||
//print_config->set_key_value("inner_wall_jerk", new ConfigOptionFloat(1.0f));
|
||||
auto full_config = wxGetApp().preset_bundle->full_config();
|
||||
auto wall_speed = CalibPressureAdvance::find_optimal_PA_speed(full_config, full_config.get_abs_value("line_width"),
|
||||
full_config.get_abs_value("layer_height"), 0);
|
||||
print_config->set_key_value("outer_wall_speed", new ConfigOptionFloat(wall_speed));
|
||||
print_config->set_key_value("inner_wall_speed", new ConfigOptionFloat(wall_speed));
|
||||
// print_config->set_key_value("wall_generator", new ConfigOptionEnum<PerimeterGeneratorType>(PerimeterGeneratorType::Classic));
|
||||
const auto _wall_generator = print_config->option<ConfigOptionEnum<PerimeterGeneratorType>>("wall_generator");
|
||||
if (_wall_generator->value == PerimeterGeneratorType::Arachne) print_config->set_key_value("wall_transition_angle", new ConfigOptionFloat(25));
|
||||
model().objects[0]->config.set_key_value("seam_position", new ConfigOptionEnum<SeamPosition>(spRear));
|
||||
|
||||
changed_objects({0});
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINTER)->update_dirty();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINT)->reload_config();
|
||||
wxGetApp().get_tab(Preset::TYPE_FILAMENT)->reload_config();
|
||||
wxGetApp().get_tab(Preset::TYPE_PRINTER)->reload_config();
|
||||
|
||||
auto new_height = std::ceil((params.end - params.start) / params.step) + 1;
|
||||
auto obj_bb = model().objects[0]->bounding_box();
|
||||
if (new_height < obj_bb.size().z()) {
|
||||
std::array<Vec3d, 4> plane_pts = get_cut_plane(obj_bb, new_height);
|
||||
cut(0, 0, plane_pts, ModelObjectCutAttribute::KeepLower);
|
||||
}
|
||||
|
||||
_calib_pa_select_added_objects();
|
||||
}
|
||||
|
||||
void Plater::_calib_pa_select_added_objects()
|
||||
{
|
||||
// update printable state for new volumes on canvas3D
|
||||
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_objects({0});
|
||||
|
||||
Selection &selection = p->view3D->get_canvas3d()->get_selection();
|
||||
selection.clear();
|
||||
selection.add_object(0, false);
|
||||
|
||||
// BBS: update object list selection
|
||||
p->sidebar->obj_list()->update_selections();
|
||||
selection.notify_instance_update(-1, -1);
|
||||
if (p->view3D->get_canvas3d()->get_gizmos_manager().is_enabled()) {
|
||||
// this is required because the selected object changed and the flatten on face an sla support gizmos need to be updated accordingly
|
||||
p->view3D->get_canvas3d()->update_gizmos_on_off_state();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Plater::calib_flowrate(int pass)
|
||||
{
|
||||
if (pass != 1 && pass != 2) return;
|
||||
|
|
@ -10554,6 +10639,19 @@ void Plater::reslice()
|
|||
// Stop arrange and (or) optimize rotation tasks.
|
||||
this->stop_jobs();
|
||||
|
||||
// softfever: regenerate CalibPressureAdvancePattern custom G-code to apply changes
|
||||
if (model().calib_pa_pattern) {
|
||||
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
||||
|
||||
model().calib_pa_pattern->generate_custom_gcodes(
|
||||
wxGetApp().preset_bundle->full_config(),
|
||||
preset_bundle->printers.get_edited_preset().is_bbl_vendor_preset(preset_bundle),
|
||||
model(),
|
||||
get_partplate_list().get_current_plate_origin()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
if (printer_technology() == ptSLA) {
|
||||
for (auto& object : model().objects)
|
||||
if (object->sla_points_status == sla::PointsStatus::NoPoints)
|
||||
|
|
|
|||
|
|
@ -736,6 +736,10 @@ private:
|
|||
// BBS: add project slice related functions
|
||||
int start_next_slice();
|
||||
|
||||
void _calib_pa_pattern(const Calib_Params ¶ms);
|
||||
void _calib_pa_tower(const Calib_Params ¶ms);
|
||||
void _calib_pa_select_added_objects();
|
||||
|
||||
friend class SuppressBackgroundProcessingUpdate;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||
//choice_sizer->Add(m_rbExtruderType, 0, wxALL, 5);
|
||||
//choice_sizer->Add(FromDIP(5), 0, 0, wxEXPAND, 5);
|
||||
|
||||
wxString m_rbMethodChoices[] = { _L("PA Tower"), _L("PA Line") };
|
||||
wxString m_rbMethodChoices[] = { _L("PA Tower"), _L("PA Line"), _L("PA Pattern") };
|
||||
int m_rbMethodNChoices = sizeof(m_rbMethodChoices) / sizeof(wxString);
|
||||
m_rbMethod = new wxRadioBox(this, wxID_ANY, _L("Method"), wxDefaultPosition, wxDefaultSize, m_rbMethodNChoices, m_rbMethodChoices, 2, wxRA_SPECIFY_COLS);
|
||||
m_rbMethod->SetSelection(0);
|
||||
|
|
@ -75,7 +75,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||
// start PA
|
||||
auto start_PA_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto start_pa_text = new wxStaticText(this, wxID_ANY, start_pa_str, wxDefaultPosition, st_size, wxALIGN_LEFT);
|
||||
m_tiStartPA = new TextInput(this, wxString::FromDouble(0.0), "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiStartPA = new TextInput(this, "", "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiStartPA->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
|
||||
start_PA_sizer->Add(start_pa_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
|
|
@ -85,7 +85,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||
// end PA
|
||||
auto end_PA_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto end_pa_text = new wxStaticText(this, wxID_ANY, end_pa_str, wxDefaultPosition, st_size, wxALIGN_LEFT);
|
||||
m_tiEndPA = new TextInput(this, wxString::FromDouble(0.1), "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiEndPA = new TextInput(this, "", "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiStartPA->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
end_PA_sizer->Add(end_pa_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
end_PA_sizer->Add(m_tiEndPA, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
|
|
@ -94,7 +94,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||
// PA step
|
||||
auto PA_step_sizer = new wxBoxSizer(wxHORIZONTAL);
|
||||
auto PA_step_text = new wxStaticText(this, wxID_ANY, PA_step_str, wxDefaultPosition, st_size, wxALIGN_LEFT);
|
||||
m_tiPAStep = new TextInput(this, wxString::FromDouble(0.002), "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiPAStep = new TextInput(this, "", "", "", wxDefaultPosition, ti_size, wxTE_CENTRE | wxTE_PROCESS_ENTER);
|
||||
m_tiStartPA->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
|
||||
PA_step_sizer->Add(PA_step_text, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
PA_step_sizer->Add(m_tiPAStep, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2);
|
||||
|
|
@ -120,6 +120,8 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||
m_btnStart->Bind(wxEVT_BUTTON, &PA_Calibration_Dlg::on_start, this);
|
||||
v_sizer->Add(m_btnStart, 0, wxALL | wxALIGN_RIGHT, FromDIP(5));
|
||||
|
||||
PA_Calibration_Dlg::reset_params();
|
||||
|
||||
// Connect Events
|
||||
//m_rbExtruderType->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_extruder_type_changed), NULL, this);
|
||||
m_rbMethod->Connect(wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler(PA_Calibration_Dlg::on_method_changed), NULL, this);
|
||||
|
|
@ -149,6 +151,49 @@ PA_Calibration_Dlg::~PA_Calibration_Dlg() {
|
|||
m_btnStart->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(PA_Calibration_Dlg::on_start), NULL, this);
|
||||
}
|
||||
|
||||
void PA_Calibration_Dlg::reset_params() {
|
||||
Preset &printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
|
||||
int extruder_type = printer_preset.config.opt_enum("extruder_type", 0);
|
||||
bool isDDE =extruder_type == 0 ? true : false;
|
||||
int method = m_rbMethod->GetSelection();
|
||||
|
||||
m_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
|
||||
|
||||
switch (method) {
|
||||
case 1:
|
||||
m_params.mode = CalibMode::Calib_PA_Line;
|
||||
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.1));
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.002));
|
||||
m_cbPrintNum->SetValue(true);
|
||||
m_cbPrintNum->Enable(true);
|
||||
break;
|
||||
case 2:
|
||||
m_params.mode = CalibMode::Calib_PA_Pattern;
|
||||
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.08));
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.005));
|
||||
m_cbPrintNum->SetValue(true);
|
||||
m_cbPrintNum->Enable(false);
|
||||
break;
|
||||
default:
|
||||
m_params.mode = CalibMode::Calib_PA_Tower;
|
||||
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.1));
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.002));
|
||||
m_cbPrintNum->SetValue(false);
|
||||
m_cbPrintNum->Enable(false);
|
||||
break;
|
||||
}
|
||||
|
||||
if (!isDDE) {
|
||||
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(1.0));
|
||||
|
||||
if (m_params.mode == CalibMode::Calib_PA_Pattern) {
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.05));
|
||||
} else {
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.02));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
|
||||
bool read_double = false;
|
||||
read_double = m_tiStartPA->GetTextCtrl()->GetValue().ToDouble(&m_params.start);
|
||||
|
|
@ -159,7 +204,18 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
|
|||
msg_dlg.ShowModal();
|
||||
return;
|
||||
}
|
||||
m_params.mode = m_rbMethod->GetSelection() == 0 ? CalibMode::Calib_PA_Tower : CalibMode::Calib_PA_Line;
|
||||
|
||||
switch (m_rbMethod->GetSelection()) {
|
||||
case 1:
|
||||
m_params.mode = CalibMode::Calib_PA_Line;
|
||||
break;
|
||||
case 2:
|
||||
m_params.mode = CalibMode::Calib_PA_Pattern;
|
||||
break;
|
||||
default:
|
||||
m_params.mode = CalibMode::Calib_PA_Tower;
|
||||
}
|
||||
|
||||
m_params.print_numbers = m_cbPrintNum->GetValue();
|
||||
|
||||
m_plater->calib_pa(m_params);
|
||||
|
|
@ -167,41 +223,21 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
|
|||
|
||||
}
|
||||
void PA_Calibration_Dlg::on_extruder_type_changed(wxCommandEvent& event) {
|
||||
int selection = event.GetSelection();
|
||||
m_bDDE = selection == 0 ? true : false;
|
||||
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(m_bDDE ? 0.1 : 1.0));
|
||||
m_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
|
||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(m_bDDE ? 0.002 : 0.02));
|
||||
PA_Calibration_Dlg::reset_params();
|
||||
event.Skip();
|
||||
}
|
||||
void PA_Calibration_Dlg::on_method_changed(wxCommandEvent& event) {
|
||||
int selection = event.GetSelection();
|
||||
m_params.mode = selection == 0 ? CalibMode::Calib_PA_Tower : CalibMode::Calib_PA_Line;
|
||||
if (selection == 0) {
|
||||
m_cbPrintNum->SetValue(false);
|
||||
m_cbPrintNum->Enable(false);
|
||||
}
|
||||
else {
|
||||
m_cbPrintNum->SetValue(true);
|
||||
m_cbPrintNum->Enable(true);
|
||||
}
|
||||
|
||||
PA_Calibration_Dlg::reset_params();
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
|
||||
void PA_Calibration_Dlg::on_dpi_changed(const wxRect& suggested_rect) {
|
||||
this->Refresh();
|
||||
Fit();
|
||||
|
||||
}
|
||||
|
||||
void PA_Calibration_Dlg::on_show(wxShowEvent& event) {
|
||||
|
||||
if (m_rbMethod->GetSelection() == 0)
|
||||
m_cbPrintNum->Enable(false);
|
||||
else
|
||||
m_cbPrintNum->Enable(true);
|
||||
PA_Calibration_Dlg::reset_params();
|
||||
}
|
||||
|
||||
// Temp Calib dlg
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ public:
|
|||
void on_dpi_changed(const wxRect& suggested_rect) override;
|
||||
void on_show(wxShowEvent& event);
|
||||
protected:
|
||||
void reset_params();
|
||||
virtual void on_start(wxCommandEvent& event);
|
||||
virtual void on_extruder_type_changed(wxCommandEvent& event);
|
||||
virtual void on_method_changed(wxCommandEvent& event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue