mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-10 18:56:13 +00:00
Add pattern method to Pressure Advance dialog
This commit is contained in:
@@ -46,7 +46,7 @@ PA_Calibration_Dlg::PA_Calibration_Dlg(wxWindow* parent, wxWindowID id, Plater*
|
|||||||
m_rbExtruderType->SetSelection(0);
|
m_rbExtruderType->SetSelection(0);
|
||||||
choice_sizer->Add(m_rbExtruderType, 0, wxALL, 5);
|
choice_sizer->Add(m_rbExtruderType, 0, wxALL, 5);
|
||||||
choice_sizer->Add(FromDIP(5), 0, 0, wxEXPAND, 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);
|
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 = new wxRadioBox(this, wxID_ANY, _L("Method"), wxDefaultPosition, wxDefaultSize, m_rbMethodNChoices, m_rbMethodChoices, 2, wxRA_SPECIFY_COLS);
|
||||||
m_rbMethod->SetSelection(0);
|
m_rbMethod->SetSelection(0);
|
||||||
@@ -141,7 +141,18 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
|
|||||||
msg_dlg.ShowModal();
|
msg_dlg.ShowModal();
|
||||||
return;
|
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_params.print_numbers = m_cbPrintNum->GetValue();
|
||||||
|
|
||||||
m_plater->calib_pa(m_params);
|
m_plater->calib_pa(m_params);
|
||||||
@@ -151,39 +162,50 @@ void PA_Calibration_Dlg::on_start(wxCommandEvent& event) {
|
|||||||
void PA_Calibration_Dlg::on_extruder_type_changed(wxCommandEvent& event) {
|
void PA_Calibration_Dlg::on_extruder_type_changed(wxCommandEvent& event) {
|
||||||
int selection = event.GetSelection();
|
int selection = event.GetSelection();
|
||||||
m_bDDE = selection == 0 ? true : false;
|
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_tiStartPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.0));
|
||||||
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(m_bDDE ? 0.002 : 0.02));
|
|
||||||
|
if (m_rbMethod->GetSelection() == CalibMode::Calib_PA_Pattern) {
|
||||||
|
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(0.08));
|
||||||
|
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(0.015));
|
||||||
|
} else {
|
||||||
|
m_tiEndPA->GetTextCtrl()->SetValue(wxString::FromDouble(m_bDDE ? 0.1 : 1.0));
|
||||||
|
m_tiPAStep->GetTextCtrl()->SetValue(wxString::FromDouble(m_bDDE ? 0.002 : 0.02));
|
||||||
|
}
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
void PA_Calibration_Dlg::on_method_changed(wxCommandEvent& event) {
|
void PA_Calibration_Dlg::on_method_changed(wxCommandEvent& event) {
|
||||||
int selection = event.GetSelection();
|
int selection = event.GetSelection();
|
||||||
m_params.mode = selection == 0 ? CalibMode::Calib_PA_Tower : CalibMode::Calib_PA_Line;
|
switch (selection) {
|
||||||
if (selection == 0) {
|
case 1:
|
||||||
m_cbPrintNum->SetValue(false);
|
m_params.mode = CalibMode::Calib_PA_Line;
|
||||||
m_cbPrintNum->Enable(false);
|
m_cbPrintNum->SetValue(true);
|
||||||
}
|
m_cbPrintNum->Enable(true);
|
||||||
else {
|
break;
|
||||||
m_cbPrintNum->SetValue(true);
|
case 2:
|
||||||
m_cbPrintNum->Enable(true);
|
m_params.mode = CalibMode::Calib_PA_Pattern;
|
||||||
|
m_cbPrintNum->SetValue(true);
|
||||||
|
m_cbPrintNum->Enable(false);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
m_params.mode = CalibMode::Calib_PA_Tower;
|
||||||
|
m_cbPrintNum->SetValue(false);
|
||||||
|
m_cbPrintNum->Enable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
event.Skip();
|
event.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void PA_Calibration_Dlg::on_dpi_changed(const wxRect& suggested_rect) {
|
void PA_Calibration_Dlg::on_dpi_changed(const wxRect& suggested_rect) {
|
||||||
this->Refresh();
|
this->Refresh();
|
||||||
Fit();
|
Fit();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void PA_Calibration_Dlg::on_show(wxShowEvent& event) {
|
void PA_Calibration_Dlg::on_show(wxShowEvent& event) {
|
||||||
|
if (m_rbMethod->GetSelection() == 1)
|
||||||
if (m_rbMethod->GetSelection() == 0)
|
|
||||||
m_cbPrintNum->Enable(false);
|
|
||||||
else
|
|
||||||
m_cbPrintNum->Enable(true);
|
m_cbPrintNum->Enable(true);
|
||||||
|
else
|
||||||
|
m_cbPrintNum->Enable(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Temp Calib dlg
|
// Temp Calib dlg
|
||||||
|
|||||||
Reference in New Issue
Block a user