This commit is contained in:
SoftFever 2022-12-22 16:09:03 +08:00
parent f5b28201fe
commit 8c46a57036
9 changed files with 53 additions and 18 deletions

View file

@ -10,5 +10,5 @@ cd %WP%
mkdir build
cd build
cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./BambuStudio-SoftFever" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
cmake --build . --config Release --target ALL_BUILD -- -m
cmake --build . --target install --config Release
@REM cmake --build . --config Release --target ALL_BUILD -- -m
@REM cmake --build . --target install --config Release

Binary file not shown.

View file

@ -1636,13 +1636,10 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
if (print.is_calib_mode()) {
std::string gcode;
auto s = m_config.inner_wall_speed.value;
if (m_config.default_acceleration.value > 0) {
double acceleration = std::max(m_config.inner_wall_acceleration.value, m_config.outer_wall_acceleration.value);
gcode += m_writer.set_acceleration((unsigned int)floor(acceleration + 0.5));
}
gcode += m_writer.set_acceleration((unsigned int)floor(m_config.outer_wall_acceleration.value + 0.5));
if (m_config.default_jerk.value > 0) {
double jerk = m_config.default_jerk.value;
double jerk = m_config.outer_wall_jerk.value;
gcode += m_writer.set_jerk_xy((unsigned int)floor(jerk + 0.5));
}
m_config.outer_wall_speed = print.default_region_config().outer_wall_speed;
@ -1650,6 +1647,7 @@ void GCode::_do_export(Print& print, GCodeOutputStream &file, ThumbnailsGenerato
calib_pressure_advance pa_test(this);
gcode = pa_test.generate_test();
file.write(gcode);
print.is_calib_mode() = false;
}
else {
//BBS: open spaghetti detector

View file

@ -32,7 +32,7 @@ namespace Slic3r {
const double e = 0.04; // filament_mm/extrusion_mm
const double y_offset = 5;
const double fast = std::max(mp_gcodegen->config().get_abs_value("inner_wall_speed"), mp_gcodegen->config().get_abs_value("outer_wall_speed")) * 60.0;
const double fast = mp_gcodegen->config().get_abs_value("outer_wall_speed") * 60.0;
const double slow = std::max(1200.0, fast * 0.1);
std::stringstream gcode;
gcode << mp_gcodegen->writer().travel_to_z(0.2);

View file

@ -24,6 +24,7 @@ enum CUSTOM_ID
ID_TITLE,
ID_MODEL_STORE,
ID_PUBLISH,
ID_CALIB,
ID_TOOL_BAR = 3200,
ID_AMS_NOTEBOOK,
};
@ -194,7 +195,7 @@ void BBLTopbar::Init(wxFrame* parent)
m_frame = parent;
m_skip_popup_file_menu = false;
m_skip_popup_dropdown_menu = false;
m_skip_popup_calib_menu = false;
wxInitAllImageHandlers();
this->AddSpacer(5);
@ -241,6 +242,11 @@ void BBLTopbar::Init(wxFrame* parent)
wxBitmap redo_inactive_bitmap = create_scaled_bitmap("topbar_redo_inactive", nullptr, TOPBAR_ICON_SIZE);
m_redo_item->SetDisabledBitmap(redo_inactive_bitmap);
this->AddSpacer(FromDIP(10));
wxBitmap calib_bitmap = create_scaled_bitmap("ams_readonly", nullptr, TOPBAR_ICON_SIZE);
m_redo_item = this->AddTool(ID_CALIB, "", calib_bitmap);
this->AddSpacer(FromDIP(10));
this->AddStretchSpacer(1);
@ -298,6 +304,7 @@ void BBLTopbar::Init(wxFrame* parent)
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::OnDropdownToolItem, this, ID_TOP_DROPDOWN_MENU);
this->Bind(wxEVT_AUITOOLBAR_TOOL_DROPDOWN, &BBLTopbar::OnDropdownToolItem, this, ID_CALIB);
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::OnCloseFrame, this, wxID_CLOSE_FRAME);
@ -468,6 +475,9 @@ void BBLTopbar::Rescale() {
item->SetBitmap(create_scaled_bitmap("topbar_redo", this, TOPBAR_ICON_SIZE));
item->SetDisabledBitmap(create_scaled_bitmap("topbar_redo_inactive", nullptr, TOPBAR_ICON_SIZE));
item = this->FindTool(ID_CALIB);
item->SetBitmap(create_scaled_bitmap("ams_readonly", this, TOPBAR_ICON_SIZE));
item = this->FindTool(ID_TITLE);
/*item = this->FindTool(ID_PUBLISH);
@ -581,6 +591,23 @@ void BBLTopbar::OnDropdownToolItem(wxAuiToolBarEvent& evt)
tb->SetToolSticky(evt.GetId(), false);
}
void BBLTopbar::OnCalibToolItem(wxAuiToolBarEvent& evt)
{
wxAuiToolBar* tb = static_cast<wxAuiToolBar*>(evt.GetEventObject());
tb->SetToolSticky(evt.GetId(), true);
if (!m_skip_popup_calib_menu) {
PopupMenu(&m_calib_menu, wxPoint(FromDIP(1), this->GetSize().GetHeight() - 2));
}
else {
m_skip_popup_calib_menu = false;
}
// make sure the button is "un-stuck"
tb->SetToolSticky(evt.GetId(), false);
}
void BBLTopbar::OnMouseLeftDown(wxMouseEvent& event)
{
wxPoint mouse_pos = ::wxGetMousePosition();

View file

@ -24,6 +24,7 @@ public:
void OnCloseFrame(wxAuiToolBarEvent& event);
void OnFileToolItem(wxAuiToolBarEvent& evt);
void OnDropdownToolItem(wxAuiToolBarEvent& evt);
void OnCalibToolItem(wxAuiToolBarEvent& evt);
void OnMouseLeftDClock(wxMouseEvent& mouse);
void OnMouseLeftDown(wxMouseEvent& event);
void OnMouseLeftUp(wxMouseEvent& event);
@ -60,6 +61,7 @@ private:
wxPoint m_delta;
wxMenu m_top_menu;
wxMenu* m_file_menu;
wxMenu* m_calib_menu;
wxAuiToolBarItem* m_title_item;
wxAuiToolBarItem* m_account_item;
wxAuiToolBarItem* m_model_store_item;
@ -78,4 +80,5 @@ private:
int m_toolbar_h;
bool m_skip_popup_file_menu;
bool m_skip_popup_dropdown_menu;
bool m_skip_popup_calib_menu;
};

View file

@ -120,6 +120,7 @@ public:
// Get the current print. It is either m_fff_print or m_sla_print.
const PrintBase* current_print() const { return m_print; }
const Print* fff_print() const { return m_fff_print; }
Print* fff_print() { return m_fff_print; }
const SLAPrint* sla_print() const { return m_sla_print; }
// Take the project path (if provided), extract the name of the project, run it through the macro processor and save it next to the project file.
// If the project_path is empty, just run output_filepath().

View file

@ -2442,7 +2442,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
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_ALL, &priv::on_action_slice_all, this);
q->Bind(EVT_GLTOOLBAR_SLICE_ALL, &priv::on_action_calib_pa, 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_SELECT_SLICED_PLATE, &priv::on_action_select_sliced_plate, this);
q->Bind(EVT_GLTOOLBAR_PRINT_ALL, &priv::on_action_print_all, this);
@ -6001,11 +6001,14 @@ void Plater::priv::on_action_calib_pa(SimpleEvent&)
{
if (q != nullptr) {
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << ":received calib pa event\n" ;
if(fff_print.model().objects.empty())
//add model
q->add_model(false,Slic3r::resources_dir()+"/calib/sf_placeholder.stl");
fff_print.is_calib_mode() = true;
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);
@ -7419,7 +7422,7 @@ Print& Plater::fff_print() { return p->fff_print; }
const SLAPrint& Plater::sla_print() const { return p->sla_print; }
SLAPrint& Plater::sla_print() { return p->sla_print; }
int Plater::new_project(bool skip_confirm, bool silent)
int Plater::new_project(bool skip_confirm, bool silent, const wxString& project_name)
{
bool transfer_preset_changes = false;
// BBS: save confirm
@ -7459,7 +7462,10 @@ int Plater::new_project(bool skip_confirm, bool silent)
//reset project
p->project.reset();
//set project name
p->set_project_name(_L("Untitled"));
if (project_name.empty())
p->set_project_name(_L("Untitled"));
else
p->set_project_name(project_name);
Plater::TakeSnapshot snapshot(this, "New Project", UndoRedo::SnapshotType::ProjectSeparator);

View file

@ -202,7 +202,7 @@ public:
const SLAPrint& sla_print() const;
SLAPrint& sla_print();
int new_project(bool skip_confirm = false, bool silent = false);
int new_project(bool skip_confirm = false, bool silent = false, const wxString& project_name = wxString());
// BBS: save & backup
void load_project(wxString const & filename = "", wxString const & originfile = "-");
int save_project(bool saveAs = false);