draft version

This commit is contained in:
SoftFever 2022-12-23 11:12:44 +08:00
parent 1df89650e9
commit a3bae2f9a5
7 changed files with 47 additions and 34 deletions

View file

@ -2459,8 +2459,13 @@ void MainFrame::init_menubar_as_editor()
//m_topbar->AddDropDownMenuItem(language_item);
//m_topbar->AddDropDownMenuItem(config_item);
m_topbar->AddDropDownSubMenu(helpMenu, _L("Help"));
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("Pressure advance"), _L("Calibrate PA"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_pa(); }, "", nullptr,
// SoftFever calibrations
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("PA - DDE"), _L("Calibrate PA - DDE"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_pa(false); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
append_menu_item(m_topbar->GetCalibMenu(), wxID_ANY, _L("PA - Bowden"), _L("Calibrate PA - Bowden"),
[this](wxCommandEvent&) { if (m_plater) m_plater->calib_pa(true); }, "", nullptr,
[this]() {return m_plater->is_view3D_shown();; }, this);
#else
m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File")));

View file

@ -7865,24 +7865,20 @@ void Plater::add_model(bool imperial_units/* = false*/, std::string fname/* = "
}
}
void Plater::calib_pa() {
const auto calib_pa_name = "PressureAdvanceTest-SF";
if (get_project_name() != calib_pa_name) {
new_project(false, false, calib_pa_name);
add_model(false, Slic3r::resources_dir() + "/calib/sf_placeholder.stl");
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
void Plater::calib_pa(bool bowden) {
const auto calib_pa_name = "PressureAdvanceTest";
new_project(false, false, calib_pa_name);
add_model(false, Slic3r::resources_dir() + "/calib/sf_placeholder.stl");
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
//select_view_3D("3D");
}
p->background_process.fff_print()->is_calib_mode() = true;
p->background_process.fff_print()->is_calib_mode() = bowden ? Calib_PA_Bowden : Calib_PA_DDE;
//BBS update extruder params and speed table before slicing
Plater::setExtruderParams(Slic3r::Model::extruderParamsMap);
Plater::setPrintSpeedTable(Slic3r::Model::printSpeedMap);
p->m_slice_all = false;
reslice();
wxGetApp().mainframe->select_tab(size_t(MainFrame::tp3DEditor));
select_view_3D("Preview");
wxGetApp().mainframe->select_tab(size_t(MainFrame::tpPreview));
//select_view_3D("Preview");
}
void Plater::import_sl1_archive()

View file

@ -226,7 +226,7 @@ public:
void refresh_print();
// SoftFever
void calib_pa();
void calib_pa(bool bowden = false);
//BBS: add only gcode mode
bool only_gcode_mode() { return m_only_gcode; }