Merge remote-tracking branch 'upstream/main' into feature/pressure-advance-pattern-method

This commit is contained in:
thewildmage
2023-07-14 10:39:02 -06:00
180 changed files with 17620 additions and 6753 deletions
+57 -12
View File
@@ -669,17 +669,6 @@ void AMSMaterialsSetting::on_clr_picker(wxMouseEvent &event)
m_color_picker_popup.set_ams_colours(ams_colors);
m_color_picker_popup.set_def_colour(m_clr_picker->m_colour);
m_color_picker_popup.Popup();
/*auto clr_dialog = new wxColourDialog(this, m_clrData);
if (clr_dialog->ShowModal() == wxID_OK) {
m_clrData = &(clr_dialog->GetColourData());
m_clr_picker->SetBackgroundColor(wxColour(
m_clrData->GetColour().Red(),
m_clrData->GetColour().Green(),
m_clrData->GetColour().Blue(),
254
));
}*/
}
bool AMSMaterialsSetting::is_virtual_tray()
@@ -1114,7 +1103,7 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
}
wxBoxSizer* m_sizer_other = new wxBoxSizer(wxHORIZONTAL);
auto m_title_other = new wxStaticText(m_def_color_box, wxID_ANY, _L("Other color"), wxDefaultPosition, wxDefaultSize, 0);
auto m_title_other = new wxStaticText(m_def_color_box, wxID_ANY, _L("Other Color"), wxDefaultPosition, wxDefaultSize, 0);
m_title_other->SetFont(::Label::Body_14);
m_title_other->SetBackgroundColour(wxColour(238, 238, 238));
m_sizer_other->Add(m_title_other, 0, wxALL, 5);
@@ -1124,11 +1113,43 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
other_line->SetBackgroundColour(wxColour(0xCECECE));
m_sizer_other->Add(other_line, 1, wxALIGN_CENTER, 0);
//custom color
wxBoxSizer* m_sizer_custom = new wxBoxSizer(wxHORIZONTAL);
auto m_title_custom = new wxStaticText(m_def_color_box, wxID_ANY, _L("Custom Color"), wxDefaultPosition, wxDefaultSize, 0);
m_title_custom->SetFont(::Label::Body_14);
m_title_custom->SetBackgroundColour(wxColour(238, 238, 238));
auto custom_line = new wxPanel(m_def_color_box, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
custom_line->SetBackgroundColour(wxColour(0xCECECE));
custom_line->SetMinSize(wxSize(-1, 1));
custom_line->SetMaxSize(wxSize(-1, 1));
m_sizer_custom->Add(m_title_custom, 0, wxALL, 5);
m_sizer_custom->Add(custom_line, 1, wxALIGN_CENTER, 0);
m_custom_cp = new StaticBox(m_def_color_box);
m_custom_cp->SetSize(FromDIP(60), FromDIP(25));
m_custom_cp->SetMinSize(wxSize(FromDIP(60), FromDIP(25)));
m_custom_cp->SetMaxSize(wxSize(FromDIP(60), FromDIP(25)));
m_custom_cp->SetBorderColor(StateColor(std::pair<wxColour, int>(wxColour(238, 238, 238), StateColor::Normal)));
m_custom_cp->Bind(wxEVT_LEFT_DOWN, &ColorPickerPopup::on_custom_clr_picker, this);
m_custom_cp->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {
SetCursor(wxCURSOR_HAND);
});
m_custom_cp->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {
SetCursor(wxCURSOR_ARROW);
});
m_clrData = new wxColourData();
m_clrData->SetChooseFull(true);
m_clrData->SetChooseAlpha(false);
m_sizer_box->Add(0, 0, 0, wxTOP, FromDIP(10));
m_sizer_box->Add(m_sizer_ams, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(10));
m_sizer_box->Add(m_ams_fg_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(10));
m_sizer_box->Add(m_sizer_other, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(10));
m_sizer_box->Add(fg_sizer, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(10));
m_sizer_box->Add(m_sizer_custom, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(10));
m_sizer_box->Add(m_custom_cp, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(16));
m_sizer_box->Add(0, 0, 0, wxTOP, FromDIP(10));
@@ -1145,6 +1166,28 @@ ColorPickerPopup::ColorPickerPopup(wxWindow* parent)
wxGetApp().UpdateDarkUIWin(this);
}
void ColorPickerPopup::on_custom_clr_picker(wxMouseEvent& event)
{
auto clr_dialog = new wxColourDialog(nullptr, m_clrData);
wxColour picker_color;
if (clr_dialog->ShowModal() == wxID_OK) {
m_clrData = &(clr_dialog->GetColourData());
picker_color = wxColour(
m_clrData->GetColour().Red(),
m_clrData->GetColour().Green(),
m_clrData->GetColour().Blue(),
254
);
m_custom_cp->SetBackgroundColor(picker_color);
set_def_colour(picker_color);
wxCommandEvent evt(EVT_SELECTED_COLOR);
unsigned long g_col = ((picker_color.Red() & 0xff) << 16) + ((picker_color.Green() & 0xff) << 8) + (picker_color.Blue() & 0xff);
evt.SetInt(g_col);
wxPostEvent(GetParent(), evt);
}
}
void ColorPickerPopup::set_ams_colours(std::vector<wxColour> ams)
{
@@ -1202,6 +1245,8 @@ void ColorPickerPopup::set_def_colour(wxColour col)
}
}
m_custom_cp->SetBackgroundColor(m_def_col);
Dismiss();
}
+3
View File
@@ -54,6 +54,8 @@ public:
class ColorPickerPopup : public PopupWindow
{
public:
StaticBox* m_custom_cp;
wxColourData* m_clrData;
StaticBox* m_def_color_box;
wxFlexGridSizer* m_ams_fg_sizer;
wxColour m_def_col;
@@ -65,6 +67,7 @@ public:
public:
ColorPickerPopup(wxWindow* parent);
~ColorPickerPopup() {};
void on_custom_clr_picker(wxMouseEvent& event);
void set_ams_colours(std::vector<wxColour> ams);
void set_def_colour(wxColour col);
void paintEvent(wxPaintEvent& evt);
+6 -2
View File
@@ -540,15 +540,19 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co
bool have_perimeters = config->opt_int("wall_loops") > 0;
for (auto el : { "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall",
"seam_position", "wall_infill_order", "outer_wall_line_width",
"seam_position", "staggered_inner_seams", "wall_infill_order", "outer_wall_line_width",
"inner_wall_speed", "outer_wall_speed", "small_perimeter_speed", "small_perimeter_threshold" })
toggle_field(el, have_perimeters);
bool have_infill = config->option<ConfigOptionPercent>("sparse_infill_density")->value > 0;
// sparse_infill_filament uses the same logic as in Print::extruders()
for (auto el : { "sparse_infill_pattern", "infill_combination",
"minimum_sparse_infill_area", "sparse_infill_filament"})
"minimum_sparse_infill_area", "sparse_infill_filament", "infill_anchor_max"})
toggle_line(el, have_infill);
// Only allow configuration of open anchors if the anchoring is enabled.
bool has_infill_anchors = have_infill && config->option<ConfigOptionFloatOrPercent>("infill_anchor_max")->value > 0;
toggle_field("infill_anchor", has_infill_anchors);
bool has_spiral_vase = config->opt_bool("spiral_mode");
bool has_top_solid_infill = config->opt_int("top_shell_layers") > 0;
+2 -2
View File
@@ -3085,7 +3085,7 @@ void GUI_App::init_fonts()
// wxSYS_OEM_FIXED_FONT and wxSYS_ANSI_FIXED_FONT use the same as
// DEFAULT in wxGtk. Use the TELETYPE family as a work-around
m_code_font = wxFont(wxFontInfo().Family(wxFONTFAMILY_TELETYPE));
m_code_font.SetPointSize(m_normal_font.GetPointSize());
m_code_font.SetPointSize(m_small_font.GetPointSize());
}
void GUI_App::update_fonts(const MainFrame *main_frame)
@@ -3102,7 +3102,7 @@ void GUI_App::update_fonts(const MainFrame *main_frame)
m_bold_font = m_normal_font.Bold();
m_link_font = m_bold_font.Underlined();
m_em_unit = main_frame->em_unit();
m_code_font.SetPointSize(m_normal_font.GetPointSize());
m_code_font.SetPointSize(m_small_font.GetPointSize());
}
void GUI_App::set_label_clr_modified(const wxColour& clr)
+1 -1
View File
@@ -95,7 +95,7 @@ std::map<std::string, std::vector<SimpleSettingData>> SettingsFactory::PART_CAT
}},
{ L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", L("Top Solid Layers"),1},{"top_shell_thickness", L("Top Minimum Shell Thickness"),1},
{"bottom_shell_layers", L("Bottom Solid Layers"),1}, {"bottom_shell_thickness", L("Bottom Minimum Shell Thickness"),1},
{"sparse_infill_density", "",1},{"sparse_infill_pattern", "",1},{"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1},
{"sparse_infill_density", "",1},{"sparse_infill_pattern", "",1},{"infill_anchor", "",1},{"infill_anchor_max", "",1},{"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1},
{"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1}, {"minimum_sparse_infill_area", "",1}
}},
{ L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5},
+5 -2
View File
@@ -2900,7 +2900,10 @@ DynamicPrintConfig ObjectList::get_default_layer_config(const int obj_idx)
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("layer_height");
config.set_key_value("layer_height",new ConfigOptionFloat(layer_height));
// BBS
config.set_key_value("extruder", new ConfigOptionInt(1));
int extruder = object(obj_idx)->config.has("extruder") ?
object(obj_idx)->config.opt_int("extruder") :
wxGetApp().preset_bundle->prints.get_edited_preset().config.opt_float("extruder");
config.set_key_value("extruder", new ConfigOptionInt(extruder));
return config;
}
@@ -3314,7 +3317,7 @@ void ObjectList::part_selection_changed()
Sidebar& panel = wxGetApp().sidebar();
panel.Freeze();
wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event("", false);
//wxGetApp().plater()->canvas3D()->handle_sidebar_focus_event("", false);
// BBS
//wxGetApp().obj_manipul() ->UpdateAndShow(update_and_show_manipulations);
wxGetApp().obj_settings()->UpdateAndShow(update_and_show_settings);
+13 -4
View File
@@ -771,10 +771,12 @@ void GLGizmoText::on_render_input_window(float x, float y, float bottom_limit)
m_imgui->text(_L("Thickness"));
ImGui::SameLine(caption_size);
ImGui::PushItemWidth(list_width);
if(ImGui::InputFloat("###text_thickness", &m_thickness,0.0f, 0.0f, "%.2f"))
m_need_update_text = true;
float old_value = m_thickness;
ImGui::InputFloat("###text_thickness", &m_thickness, 0.0f, 0.0f, "%.2f");
if (m_thickness < 0.1f)
m_thickness = 0.1f;
if (old_value != m_thickness)
m_need_update_text = true;
const float slider_icon_width = m_imgui->get_slider_icon_size().x;
const float slider_width = list_width - 1.5 * slider_icon_width - space_size;
@@ -806,10 +808,12 @@ void GLGizmoText::on_render_input_window(float x, float y, float bottom_limit)
m_imgui->text(_L("Embeded\ndepth"));
ImGui::SameLine(caption_size);
ImGui::PushItemWidth(list_width);
if (ImGui::InputFloat("###text_embeded_depth", &m_embeded_depth, 0.0f, 0.0f, "%.2f"))
m_need_update_text = true;
old_value = m_embeded_depth;
ImGui::InputFloat("###text_embeded_depth", &m_embeded_depth, 0.0f, 0.0f, "%.2f");
if (m_embeded_depth < 0.f)
m_embeded_depth = 0.f;
if (old_value != m_embeded_depth)
m_need_update_text = true;
ImGui::AlignTextToFramePadding();
m_imgui->text(_L("Input text"));
@@ -1468,6 +1472,11 @@ void GLGizmoText::generate_text_volume(bool is_temp)
TextInfo text_info = get_text_info();
if (m_is_modify && m_need_update_text) {
if (m_object_idx == -1 || m_volume_idx == -1) {
BOOST_LOG_TRIVIAL(error) << boost::format("Text: selected object_idx = %1%, volume_idx = %2%") % m_object_idx % m_volume_idx;
return;
}
plater->take_snapshot("Modify Text");
const Selection &selection = m_parent.get_selection();
ModelObject * model_object = selection.get_model()->objects[m_object_idx];
+6 -3
View File
@@ -160,6 +160,12 @@ static wxIcon main_frame_icon(GUI_App::EAppMode app_mode)
wxDEFINE_EVENT(EVT_SYNC_CLOUD_PRESET, SimpleEvent);
#ifdef __APPLE__
static const wxString ctrl = ("Ctrl+");
#else
static const wxString ctrl = _L("Ctrl+");
#endif
MainFrame::MainFrame() :
DPIFrame(NULL, wxID_ANY, "", wxDefaultPosition, wxDefaultSize, BORDERLESS_FRAME_STYLE, "mainframe")
, m_printhost_queue_dlg(new PrintHostQueueDialog(this))
@@ -2026,7 +2032,6 @@ static void add_common_publish_menu_items(wxMenu* publish_menu, MainFrame* mainF
static void add_common_view_menu_items(wxMenu* view_menu, MainFrame* mainFrame, std::function<bool(void)> can_change_view)
{
const wxString ctrl = _L("Ctrl+");
// The camera control accelerators are captured by GLCanvas3D::on_char().
append_menu_item(view_menu, wxID_ANY, _L("Default View") + "\t" + ctrl + "0", _L("Default View"), [mainFrame](wxCommandEvent&) {
mainFrame->select_view("plate");
@@ -2056,8 +2061,6 @@ void MainFrame::init_menubar_as_editor()
wxMenuBar::SetAutoWindowMenu(false);
m_menubar = new wxMenuBar();
#endif
const wxString ctrl = _L("Ctrl+");
// File menu
wxMenu* fileMenu = new wxMenu;
+1 -1
View File
@@ -2233,7 +2233,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
//BBS: add bed_exclude_area
, config(Slic3r::DynamicPrintConfig::new_from_defaults_keys({
"printable_area", "bed_exclude_area", "bed_custom_texture", "bed_custom_model", "print_sequence",
"extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "skirt_loops", "skirt_distance",
"extruder_clearance_radius", "extruder_clearance_height_to_lid", "extruder_clearance_height_to_rod", "skirt_loops", "skirt_speed", "skirt_distance",
"brim_width", "brim_object_gap", "brim_type", "nozzle_diameter", "single_extruder_multi_material",
"enable_prime_tower", "wipe_tower_x", "wipe_tower_y", "prime_tower_width", "prime_tower_brim_width", "prime_volume",
"extruder_colour", "filament_colour", "material_colour", "printable_height", "printer_model", "printer_technology",
+34
View File
@@ -30,6 +30,8 @@ PrinterWebView::PrinterWebView(wxWindow *parent)
return;
}
Bind(wxEVT_WEBVIEW_ERROR, &PrinterWebView::OnError, this);
SetSizer(topsizer);
topsizer->Add(m_browser, wxSizerFlags().Expand().Proportion(1));
@@ -83,6 +85,38 @@ void PrinterWebView::OnClose(wxCloseEvent& evt)
this->Hide();
}
void PrinterWebView::OnError(wxWebViewEvent &evt)
{
auto e = "unknown error";
switch (evt.GetInt()) {
case wxWEBVIEW_NAV_ERR_CONNECTION:
e = "wxWEBVIEW_NAV_ERR_CONNECTION";
break;
case wxWEBVIEW_NAV_ERR_CERTIFICATE:
e = "wxWEBVIEW_NAV_ERR_CERTIFICATE";
break;
case wxWEBVIEW_NAV_ERR_AUTH:
e = "wxWEBVIEW_NAV_ERR_AUTH";
break;
case wxWEBVIEW_NAV_ERR_SECURITY:
e = "wxWEBVIEW_NAV_ERR_SECURITY";
break;
case wxWEBVIEW_NAV_ERR_NOT_FOUND:
e = "wxWEBVIEW_NAV_ERR_NOT_FOUND";
break;
case wxWEBVIEW_NAV_ERR_REQUEST:
e = "wxWEBVIEW_NAV_ERR_REQUEST";
break;
case wxWEBVIEW_NAV_ERR_USER_CANCELLED:
e = "wxWEBVIEW_NAV_ERR_USER_CANCELLED";
break;
case wxWEBVIEW_NAV_ERR_OTHER:
e = "wxWEBVIEW_NAV_ERR_OTHER";
break;
}
BOOST_LOG_TRIVIAL(info) << __FUNCTION__<< boost::format(": error loading page %1% %2% %3% %4%") %evt.GetURL() %evt.GetTarget() %e %evt.GetString();
}
} // GUI
+1
View File
@@ -38,6 +38,7 @@ public:
void load_url(wxString& url);
void UpdateState();
void OnClose(wxCloseEvent& evt);
void OnError(wxWebViewEvent& evt);
private:
+5
View File
@@ -1845,6 +1845,7 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Seam"), L"param_seam");
optgroup->append_single_option_line("seam_position", "Seam");
optgroup->append_single_option_line("staggered_inner_seams", "Seam");
optgroup->append_single_option_line("seam_gap","Seam");
optgroup->append_single_option_line("role_based_wipe_speed","Seam");
optgroup->append_single_option_line("wipe_speed", "Seam");
@@ -1905,6 +1906,9 @@ void TabPrint::build()
optgroup = page->new_optgroup(L("Infill"), L"param_infill");
optgroup->append_single_option_line("sparse_infill_density");
optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse");
optgroup->append_single_option_line("infill_anchor");
optgroup->append_single_option_line("infill_anchor_max");
optgroup->append_single_option_line("filter_out_gap_fill");
optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
@@ -2030,6 +2034,7 @@ void TabPrint::build()
optgroup->append_single_option_line("skirt_loops");
optgroup->append_single_option_line("skirt_distance");
optgroup->append_single_option_line("skirt_height");
optgroup->append_single_option_line("skirt_speed");
//optgroup->append_single_option_line("draft_shield");
optgroup->append_single_option_line("brim_type", "auto-brim");
optgroup->append_single_option_line("brim_width", "auto-brim#manual");
+1 -1
View File
@@ -218,7 +218,7 @@ wxWebView* WebView::CreateWebView(wxWindow * parent, wxString const & url)
#ifndef __WIN32__
});
#endif
webView->EnableContextMenu(false);
webView->EnableContextMenu(true);
} else {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": failed. Use fake web view.";
webView = new FakeWebView;
+1 -1
View File
@@ -376,7 +376,7 @@ void Temp_Calibration_Dlg::on_filament_type_changed(wxCommandEvent& event) {
end = 230;
break;
case tPETG:
start = 260;
start = 250;
end = 230;
break;
case tTPU:
+1 -1
View File
@@ -156,7 +156,7 @@ bool Repetier::upload(PrintHostUpload upload_data, ProgressFn prorgess_fn, Error
bool Repetier::validate_version_text(const boost::optional<std::string> &version_text) const
{
return version_text ? boost::starts_with(*version_text, "Repetier") : true;
return version_text ? (!version_text->empty()) : true;
}
void Repetier::set_auth(Http &http) const
+1 -2
View File
@@ -41,8 +41,7 @@ namespace BBL {
#define BAMBU_NETWORK_LIBRARY "bambu_networking"
#define BAMBU_NETWORK_AGENT_NAME "bambu_network_agent"
#define BAMBU_NETWORK_AGENT_VERSION "01.06.00.01"
#define BAMBU_NETWORK_AGENT_VERSION "01.06.02.01"
//iot preset type strings
#define IOT_PRINTER_TYPE_STRING "printer"