This commit is contained in:
SoftFever 2022-12-22 22:41:45 +08:00
parent 0bf74c97c3
commit 1df89650e9
10 changed files with 82 additions and 81 deletions

View file

@ -0,0 +1,15 @@
<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_8074_35820)">
<path d="M2.1084 3.09195C2.1084 2.81581 2.33226 2.59195 2.6084 2.59195H11.3915C11.6677 2.59195 11.8915 2.81581 11.8915 3.09195V11.8751C11.8915 12.1512 11.6677 12.3751 11.3915 12.3751H2.6084C2.33226 12.3751 2.1084 12.1512 2.1084 11.8751V3.09195Z" fill="#505050"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.1084 3.59195V11.3751H10.8915V3.59195H3.1084ZM2.6084 2.59195C2.33226 2.59195 2.1084 2.81581 2.1084 3.09195V11.8751C2.1084 12.1512 2.33226 12.3751 2.6084 12.3751H11.3915C11.6677 12.3751 11.8915 12.1512 11.8915 11.8751V3.09195C11.8915 2.81581 11.6677 2.59195 11.3915 2.59195H2.6084Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.6709 5.48537L6.6709 0.48352L7.6709 0.483521L7.6709 5.48537L6.6709 5.48537Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.6709 14.4835L6.6709 9.48166L7.6709 9.48166L7.6709 14.4835L6.6709 14.4835Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.99815 6.93469L14 6.93469L14 7.93469L8.99815 7.93469L8.99815 6.93469Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.000104992 6.93469L5.00195 6.93469L5.00195 7.93469L0.000104904 7.93469L0.000104992 6.93469Z" fill="#F7F7F7"/>
</g>
<defs>
<clipPath id="clip0_8074_35820">
<rect width="14" height="14" fill="white" transform="translate(0 14.4835) rotate(-90)"/>
</clipPath>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -0,0 +1,17 @@
<svg width="14" height="15" viewBox="0 0 14 15" fill="none" xmlns="http://www.w3.org/2000/svg">
<g opacity="0.5">
<g clip-path="url(#clip0_8074_35820)">
<path d="M2.1084 3.09195C2.1084 2.81581 2.33226 2.59195 2.6084 2.59195H11.3915C11.6677 2.59195 11.8915 2.81581 11.8915 3.09195V11.8751C11.8915 12.1512 11.6677 12.3751 11.3915 12.3751H2.6084C2.33226 12.3751 2.1084 12.1512 2.1084 11.8751V3.09195Z" fill="#505050"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.1084 3.59195V11.3751H10.8915V3.59195H3.1084ZM2.6084 2.59195C2.33226 2.59195 2.1084 2.81581 2.1084 3.09195V11.8751C2.1084 12.1512 2.33226 12.3751 2.6084 12.3751H11.3915C11.6677 12.3751 11.8915 12.1512 11.8915 11.8751V3.09195C11.8915 2.81581 11.6677 2.59195 11.3915 2.59195H2.6084Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.6709 5.48537L6.6709 0.48352L7.6709 0.483521L7.6709 5.48537L6.6709 5.48537Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M6.6709 14.4835L6.6709 9.48166L7.6709 9.48166L7.6709 14.4835L6.6709 14.4835Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M8.99815 6.93469L14 6.93469L14 7.93469L8.99815 7.93469L8.99815 6.93469Z" fill="#F7F7F7"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M0.000104992 6.93469L5.00195 6.93469L5.00195 7.93469L0.000104904 7.93469L0.000104992 6.93469Z" fill="#F7F7F7"/>
</g>
<defs>
<clipPath id="clip0_8074_35820">
<rect width="14" height="14" fill="white" transform="translate(0 14.4835) rotate(-90)"/>
</clipPath>
</defs>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View file

@ -244,8 +244,10 @@ void BBLTopbar::Init(wxFrame* parent)
this->AddSpacer(FromDIP(10)); this->AddSpacer(FromDIP(10));
wxBitmap calib_bitmap = create_scaled_bitmap("ams_readonly", nullptr, TOPBAR_ICON_SIZE); wxBitmap calib_bitmap = create_scaled_bitmap("calib_sf", nullptr, TOPBAR_ICON_SIZE);
m_redo_item = this->AddTool(ID_CALIB, "", calib_bitmap); wxBitmap calib_bitmap_inactive = create_scaled_bitmap("calib_sf_inactive", nullptr, TOPBAR_ICON_SIZE);
m_calib_item = this->AddTool(ID_CALIB, "Calibration", calib_bitmap);
m_calib_item->SetDisabledBitmap(calib_bitmap_inactive);
this->AddSpacer(FromDIP(10)); this->AddSpacer(FromDIP(10));
this->AddStretchSpacer(1); this->AddStretchSpacer(1);
@ -304,7 +306,7 @@ void BBLTopbar::Init(wxFrame* parent)
this->Bind(wxEVT_MENU_CLOSE, &BBLTopbar::OnMenuClose, this); this->Bind(wxEVT_MENU_CLOSE, &BBLTopbar::OnMenuClose, this);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnFileToolItem, this, ID_TOP_FILE_MENU); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnFileToolItem, this, ID_TOP_FILE_MENU);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnDropdownToolItem, this, ID_TOP_DROPDOWN_MENU); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnDropdownToolItem, this, ID_TOP_DROPDOWN_MENU);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnDropdownToolItem, this, ID_CALIB); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnCalibToolItem, this, ID_CALIB);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnIconize, this, wxID_ICONIZE_FRAME); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnIconize, this, wxID_ICONIZE_FRAME);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnFullScreen, this, wxID_MAXIMIZE_FRAME); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnFullScreen, this, wxID_MAXIMIZE_FRAME);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnCloseFrame, this, wxID_CLOSE_FRAME); this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnCloseFrame, this, wxID_CLOSE_FRAME);
@ -360,17 +362,19 @@ void BBLTopbar::OnRedo(wxAuiToolBarEvent& event)
plater->redo(); plater->redo();
} }
void BBLTopbar::EnableUndoRedoItems() void BBLTopbar::Enable3DEditorItems()
{ {
this->EnableTool(m_undo_item->GetId(), true); this->EnableTool(m_undo_item->GetId(), true);
this->EnableTool(m_redo_item->GetId(), true); this->EnableTool(m_redo_item->GetId(), true);
this->EnableTool(m_calib_item->GetId(), true);
Refresh(); Refresh();
} }
void BBLTopbar::DisableUndoRedoItems() void BBLTopbar::Disable3DEditorItems()
{ {
this->EnableTool(m_undo_item->GetId(), false); this->EnableTool(m_undo_item->GetId(), false);
this->EnableTool(m_redo_item->GetId(), false); this->EnableTool(m_redo_item->GetId(), false);
this->EnableTool(m_calib_item->GetId(), false);
Refresh(); Refresh();
} }
@ -423,6 +427,11 @@ wxMenu* BBLTopbar::GetTopMenu()
return &m_top_menu; return &m_top_menu;
} }
wxMenu* BBLTopbar::GetCalibMenu()
{
return &m_calib_menu;
}
void BBLTopbar::SetTitle(wxString title) void BBLTopbar::SetTitle(wxString title)
{ {
wxGCDC dc(this); wxGCDC dc(this);
@ -598,7 +607,8 @@ void BBLTopbar::OnCalibToolItem(wxAuiToolBarEvent& evt)
tb->SetToolSticky(evt.GetId(), true); tb->SetToolSticky(evt.GetId(), true);
if (!m_skip_popup_calib_menu) { if (!m_skip_popup_calib_menu) {
PopupMenu(&m_calib_menu, wxPoint(FromDIP(1), this->GetSize().GetHeight() - 2)); auto rec = this->GetToolRect(ID_CALIB);
PopupMenu(&m_calib_menu, wxPoint(rec.GetLeft(), this->GetSize().GetHeight() - 2));
} }
else { else {
m_skip_popup_calib_menu = false; m_skip_popup_calib_menu = false;

View file

@ -43,13 +43,14 @@ public:
void SetFileMenu(wxMenu* file_menu); void SetFileMenu(wxMenu* file_menu);
void AddDropDownSubMenu(wxMenu* sub_menu, const wxString& title); void AddDropDownSubMenu(wxMenu* sub_menu, const wxString& title);
void AddDropDownMenuItem(wxMenuItem* menu_item); void AddDropDownMenuItem(wxMenuItem* menu_item);
wxMenu *GetTopMenu(); wxMenu* GetTopMenu();
wxMenu *GetCalibMenu();
void SetTitle(wxString title); void SetTitle(wxString title);
void SetMaximizedSize(); void SetMaximizedSize();
void SetWindowSize(); void SetWindowSize();
void EnableUndoRedoItems(); void Enable3DEditorItems();
void DisableUndoRedoItems(); void Disable3DEditorItems();
void SaveNormalRect(); void SaveNormalRect();
@ -61,7 +62,7 @@ private:
wxPoint m_delta; wxPoint m_delta;
wxMenu m_top_menu; wxMenu m_top_menu;
wxMenu* m_file_menu; wxMenu* m_file_menu;
wxMenu* m_calib_menu; wxMenu m_calib_menu;
wxAuiToolBarItem* m_title_item; wxAuiToolBarItem* m_title_item;
wxAuiToolBarItem* m_account_item; wxAuiToolBarItem* m_account_item;
wxAuiToolBarItem* m_model_store_item; wxAuiToolBarItem* m_model_store_item;
@ -69,6 +70,7 @@ private:
wxAuiToolBarItem *m_publish_item; wxAuiToolBarItem *m_publish_item;
wxAuiToolBarItem* m_undo_item; wxAuiToolBarItem* m_undo_item;
wxAuiToolBarItem* m_redo_item; wxAuiToolBarItem* m_redo_item;
wxAuiToolBarItem* m_calib_item;
wxAuiToolBarItem* maximize_btn; wxAuiToolBarItem* maximize_btn;
wxBitmap m_publish_bitmap; wxBitmap m_publish_bitmap;

View file

@ -32,8 +32,6 @@ wxDEFINE_EVENT(EVT_GLTOOLBAR_PRINT_SELECT, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent); wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent); wxDEFINE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent);
//SoftFever: goodie bag
wxDEFINE_EVENT(EVT_GLTOOLBAR_PA_CALIB, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent); wxDEFINE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent);
wxDEFINE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent); wxDEFINE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent);

View file

@ -32,8 +32,6 @@ wxDECLARE_EVENT(EVT_GLTOOLBAR_PRINT_SELECT, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent); wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent); wxDECLARE_EVENT(EVT_GLTOOLBAR_SEND_TO_PRINTER_ALL, SimpleEvent);
//SoftFever: goodie bag event
wxDECLARE_EVENT(EVT_GLTOOLBAR_PA_CALIB, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent); wxDECLARE_EVENT(EVT_GLTOOLBAR_ADD, SimpleEvent);
wxDECLARE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent); wxDECLARE_EVENT(EVT_GLTOOLBAR_DELETE, SimpleEvent);

View file

@ -831,7 +831,6 @@ void MainFrame::show_option(bool show)
m_print_btn->Hide(); m_print_btn->Hide();
m_slice_option_btn->Hide(); m_slice_option_btn->Hide();
m_print_option_btn->Hide(); m_print_option_btn->Hide();
m_goodie_bag_btn->Hide();
Layout(); Layout();
} }
} else { } else {
@ -840,7 +839,6 @@ void MainFrame::show_option(bool show)
m_print_btn->Show(); m_print_btn->Show();
m_slice_option_btn->Show(); m_slice_option_btn->Show();
m_print_option_btn->Show(); m_print_option_btn->Show();
m_goodie_bag_btn->Show();
Layout(); Layout();
} }
} }
@ -906,10 +904,10 @@ void MainFrame::init_tabpanel()
#ifndef __APPLE__ #ifndef __APPLE__
if (sel == tp3DEditor) { if (sel == tp3DEditor) {
m_topbar->EnableUndoRedoItems(); m_topbar->Enable3DEditorItems();
} }
else { else {
m_topbar->DisableUndoRedoItems(); m_topbar->Disable3DEditorItems();
} }
#endif #endif
@ -1356,16 +1354,13 @@ wxBoxSizer* MainFrame::create_side_tools()
m_slice_select = eSlicePlate; m_slice_select = eSlicePlate;
m_print_select = ePrintPlate; m_print_select = ePrintPlate;
m_goodie_bag_btn = new SideButton(this, _L("Goodiebag"), "");
m_slice_btn = new SideButton(this, _L("Slice"), ""); m_slice_btn = new SideButton(this, _L("Slice"), "");
m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14)); m_slice_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
m_print_btn = new SideButton(this, _L("Print"), ""); m_print_btn = new SideButton(this, _L("Print"), "");
m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14)); m_print_option_btn = new SideButton(this, "", "sidebutton_dropdown", 0, FromDIP(14));
update_side_button_style(); update_side_button_style();
m_goodie_bag_btn->Enable();
m_print_option_btn->Enable(); m_print_option_btn->Enable();
sizer->Add(m_goodie_bag_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(1));
sizer->Add(FromDIP(15), 0, 0, 0, 0); sizer->Add(FromDIP(15), 0, 0, 0, 0);
m_slice_option_btn->Enable(); m_slice_option_btn->Enable();
@ -1379,33 +1374,6 @@ wxBoxSizer* MainFrame::create_side_tools()
sizer->Layout(); sizer->Layout();
m_goodie_bag_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{
SidePopup* p = new SidePopup(this);
SideButton* calib_pa_btn = new SideButton(p, _L("Calibrate PA"), "");
calib_pa_btn->SetCornerRadius(0);
//SideButton* send_file_btn = new SideButton(p, _L("send file"), "");
//send_file_btn->SetCornerRadius(0);
calib_pa_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
//this->m_plater->select_view_3D("Preview");
m_plater->update();
wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_PA_CALIB));
this->m_tabpanel->SetSelection(tpPreview);
});
//send_file_btn->Bind(wxEVT_BUTTON, [this, p](wxCommandEvent&) {
// //this->m_plater->select_view_3D("Preview");
// wxPostEvent(m_plater, SimpleEvent(EVT_GLTOOLBAR_SEND_GCODE_FILE));
// });
p->append_button(calib_pa_btn);
//p->append_button(send_file_btn);
p->Popup(m_goodie_bag_btn);
}
);
m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event) m_slice_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent& event)
{ {
//this->m_plater->select_view_3D("Preview"); //this->m_plater->select_view_3D("Preview");
@ -1738,13 +1706,6 @@ void MainFrame::update_side_button_style()
{ {
// BBS // BBS
int em = em_unit(); int em = em_unit();
m_goodie_bag_btn->SetLayoutStyle(1);
m_goodie_bag_btn->SetTextLayout(SideButton::EHorizontalOrientation::HO_Center, FromDIP(15));
m_goodie_bag_btn->SetMinSize(wxSize(-1, FromDIP(24)));
m_goodie_bag_btn->SetCornerRadius(FromDIP(12));
m_goodie_bag_btn->SetExtraSize(wxSize(FromDIP(38), FromDIP(10)));
m_goodie_bag_btn->SetBottomColour(wxColour(0x3B4446));
m_slice_btn->SetLayoutStyle(1); m_slice_btn->SetLayoutStyle(1);
/*m_slice_btn->SetLayoutStyle(1); /*m_slice_btn->SetLayoutStyle(1);
@ -1830,7 +1791,6 @@ void MainFrame::on_dpi_changed(const wxRect& suggested_rect)
update_side_button_style(); update_side_button_style();
m_goodie_bag_btn->Rescale();
m_slice_btn->Rescale(); m_slice_btn->Rescale();
m_print_btn->Rescale(); m_print_btn->Rescale();
m_slice_option_btn->Rescale(); m_slice_option_btn->Rescale();
@ -2499,6 +2459,9 @@ void MainFrame::init_menubar_as_editor()
//m_topbar->AddDropDownMenuItem(language_item); //m_topbar->AddDropDownMenuItem(language_item);
//m_topbar->AddDropDownMenuItem(config_item); //m_topbar->AddDropDownMenuItem(config_item);
m_topbar->AddDropDownSubMenu(helpMenu, _L("Help")); 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,
[this]() {return m_plater->is_view3D_shown();; }, this);
#else #else
m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File"))); m_menubar->Append(fileMenu, wxString::Format("&%s", _L("File")));
if (editMenu) if (editMenu)

View file

@ -355,7 +355,6 @@ public:
// BBS // BBS
mutable int m_print_select{ ePrintAll }; mutable int m_print_select{ ePrintAll };
mutable int m_slice_select{ eSliceAll }; mutable int m_slice_select{ eSliceAll };
SideButton* m_goodie_bag_btn{ nullptr };
SideButton* m_slice_btn{ nullptr }; SideButton* m_slice_btn{ nullptr };
SideButton* m_slice_option_btn{ nullptr }; SideButton* m_slice_option_btn{ nullptr };
SideButton* m_print_btn{ nullptr }; SideButton* m_print_btn{ nullptr };

View file

@ -2032,7 +2032,6 @@ struct Plater::priv
//BBS: GUI refactor: GLToolbar //BBS: GUI refactor: GLToolbar
void on_action_open_project(SimpleEvent&); void on_action_open_project(SimpleEvent&);
void on_action_slice_plate(SimpleEvent&); void on_action_slice_plate(SimpleEvent&);
void on_action_calib_pa(SimpleEvent&);
void on_action_slice_all(SimpleEvent&); void on_action_slice_all(SimpleEvent&);
void on_action_publish(wxCommandEvent &evt); void on_action_publish(wxCommandEvent &evt);
void on_action_print_plate(SimpleEvent&); void on_action_print_plate(SimpleEvent&);
@ -2442,7 +2441,6 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
q->Bind(EVT_GLVIEWTOOLBAR_PREVIEW, [q](SimpleEvent&) { q->select_view_3D("Preview", false); }); q->Bind(EVT_GLVIEWTOOLBAR_PREVIEW, [q](SimpleEvent&) { q->select_view_3D("Preview", false); });
q->Bind(EVT_GLTOOLBAR_SLICE_PLATE, &priv::on_action_slice_plate, this); q->Bind(EVT_GLTOOLBAR_SLICE_PLATE, &priv::on_action_slice_plate, this);
q->Bind(EVT_GLTOOLBAR_SLICE_ALL, &priv::on_action_slice_all, this); q->Bind(EVT_GLTOOLBAR_SLICE_ALL, &priv::on_action_slice_all, this);
q->Bind(EVT_GLTOOLBAR_PA_CALIB, &priv::on_action_calib_pa, this);
q->Bind(EVT_GLTOOLBAR_PRINT_PLATE, &priv::on_action_print_plate, this); q->Bind(EVT_GLTOOLBAR_PRINT_PLATE, &priv::on_action_print_plate, this);
q->Bind(EVT_GLTOOLBAR_SELECT_SLICED_PLATE, &priv::on_action_select_sliced_plate, this); q->Bind(EVT_GLTOOLBAR_SELECT_SLICED_PLATE, &priv::on_action_select_sliced_plate, this);
q->Bind(EVT_GLTOOLBAR_PRINT_ALL, &priv::on_action_print_all, this); q->Bind(EVT_GLTOOLBAR_PRINT_ALL, &priv::on_action_print_all, this);
@ -5996,28 +5994,6 @@ void Plater::priv::on_action_slice_plate(SimpleEvent&)
} }
} }
//BBS: GUI refactor: slice plate
void Plater::priv::on_action_calib_pa(SimpleEvent&)
{
if (q != nullptr) {
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received calib pa event\n" ;
const auto calib_pa_name = "PressureAdvanceTest-SF";
if (get_project_name() != calib_pa_name) {
q->new_project(false,false,calib_pa_name);
q->add_model(false, Slic3r::resources_dir() + "/calib/sf_placeholder.stl");
q->select_view_3D("3D");
}
background_process.fff_print()->is_calib_mode() = true;
//BBS update extruder params and speed table before slicing
Plater::setExtruderParams(Slic3r::Model::extruderParamsMap);
Plater::setPrintSpeedTable(Slic3r::Model::printSpeedMap);
m_slice_all = false;
q->reslice();
q->select_view_3D("Preview");
}
}
//BBS: GUI refactor: slice all //BBS: GUI refactor: slice all
void Plater::priv::on_action_slice_all(SimpleEvent&) void Plater::priv::on_action_slice_all(SimpleEvent&)
{ {
@ -7889,6 +7865,26 @@ 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));
//select_view_3D("3D");
}
p->background_process.fff_print()->is_calib_mode() = true;
//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");
}
void Plater::import_sl1_archive() void Plater::import_sl1_archive()
{ {
if (!p->m_ui_jobs.is_any_running()) if (!p->m_ui_jobs.is_any_running())

View file

@ -225,6 +225,9 @@ public:
void reload_gcode_from_disk(); void reload_gcode_from_disk();
void refresh_print(); void refresh_print();
// SoftFever
void calib_pa();
//BBS: add only gcode mode //BBS: add only gcode mode
bool only_gcode_mode() { return m_only_gcode; } bool only_gcode_mode() { return m_only_gcode; }
void set_only_gcode(bool only_gcode) { m_only_gcode = only_gcode; } void set_only_gcode(bool only_gcode) { m_only_gcode = only_gcode; }