FIX: flush_volume use correct extra_flush_volume
and fix extruder_offset bug jira: none Change-Id: I84644ad5b54994ae65269531311386cacd972bf3
This commit is contained in:
parent
3b988f6b77
commit
71987627ef
|
@ -575,8 +575,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
|
||||||
for (auto el : { "top_surface_line_width", "top_surface_speed" })
|
for (auto el : { "top_surface_line_width", "top_surface_speed" })
|
||||||
toggle_field(el, has_top_solid_infill || (has_spiral_vase && has_bottom_solid_infill));
|
toggle_field(el, has_top_solid_infill || (has_spiral_vase && has_bottom_solid_infill));
|
||||||
|
|
||||||
// todo multi_extruders: the exact filament id
|
bool have_default_acceleration = config->opt_float_nullable("default_acceleration", variant_index) > 0;
|
||||||
bool have_default_acceleration = config->opt_float_nullable("default_acceleration", 0) > 0;
|
|
||||||
//BBS
|
//BBS
|
||||||
for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration" })
|
for (auto el : { "initial_layer_acceleration", "outer_wall_acceleration", "top_surface_acceleration", "inner_wall_acceleration", "sparse_infill_acceleration" })
|
||||||
toggle_field(el, have_default_acceleration);
|
toggle_field(el, have_default_acceleration);
|
||||||
|
@ -675,7 +674,6 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, in
|
||||||
bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall");
|
bool have_avoid_crossing_perimeters = config->opt_bool("reduce_crossing_wall");
|
||||||
toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters);
|
toggle_line("max_travel_detour_distance", have_avoid_crossing_perimeters);
|
||||||
|
|
||||||
// todo multi_extruders:
|
|
||||||
bool has_overhang_speed = config->opt_bool_nullable("enable_overhang_speed", variant_index);
|
bool has_overhang_speed = config->opt_bool_nullable("enable_overhang_speed", variant_index);
|
||||||
for (auto el : { "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
|
for (auto el : { "overhang_1_4_speed", "overhang_2_4_speed", "overhang_3_4_speed", "overhang_4_4_speed"})
|
||||||
toggle_line(el, has_overhang_speed, variant_index);
|
toggle_line(el, has_overhang_speed, variant_index);
|
||||||
|
|
|
@ -489,9 +489,6 @@ void Sidebar::priv::hide_rich_tip(wxButton* btn)
|
||||||
|
|
||||||
std::vector<int> get_min_flush_volumes(const DynamicPrintConfig &full_config, size_t nozzle_id)
|
std::vector<int> get_min_flush_volumes(const DynamicPrintConfig &full_config, size_t nozzle_id)
|
||||||
{
|
{
|
||||||
//todo multi_extruder:
|
|
||||||
nozzle_id = 0;
|
|
||||||
|
|
||||||
std::vector<int>extra_flush_volumes;
|
std::vector<int>extra_flush_volumes;
|
||||||
//const auto& full_config = wxGetApp().preset_bundle->full_config();
|
//const auto& full_config = wxGetApp().preset_bundle->full_config();
|
||||||
//auto& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
//auto& printer_config = wxGetApp().preset_bundle->printers.get_edited_preset().config;
|
||||||
|
@ -1073,10 +1070,15 @@ Sidebar::Sidebar(Plater *parent)
|
||||||
|
|
||||||
const std::vector<std::string> extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config();
|
const std::vector<std::string> extruder_colours = wxGetApp().plater()->get_extruder_colors_from_plater_config();
|
||||||
const auto& full_config = wxGetApp().preset_bundle->full_config();
|
const auto& full_config = wxGetApp().preset_bundle->full_config();
|
||||||
const auto& extra_flush_volumes = get_min_flush_volumes(full_config, 0); // todo multi_extruder: always display nozzle 1
|
|
||||||
|
|
||||||
size_t nozzle_nums = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter")->values.size();
|
size_t nozzle_nums = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter")->values.size();
|
||||||
|
|
||||||
|
std::vector<std::vector<int>> extra_flush_volumes;
|
||||||
|
extra_flush_volumes.resize(nozzle_nums, std::vector<int>());
|
||||||
|
for (size_t nozzle_id = 0; nozzle_id < nozzle_nums; ++nozzle_id) {
|
||||||
|
extra_flush_volumes[nozzle_id] = get_min_flush_volumes(full_config, nozzle_id);
|
||||||
|
}
|
||||||
|
|
||||||
std::vector<float> flush_multiplier;
|
std::vector<float> flush_multiplier;
|
||||||
ConfigOptionFloats *flush_multi_opt = project_config.option<ConfigOptionFloats>("flush_multiplier");
|
ConfigOptionFloats *flush_multi_opt = project_config.option<ConfigOptionFloats>("flush_multiplier");
|
||||||
if (flush_multi_opt)
|
if (flush_multi_opt)
|
||||||
|
|
|
@ -4337,7 +4337,6 @@ void SelectMachineDialog::reset_and_sync_ams_list()
|
||||||
m_filaments.clear();
|
m_filaments.clear();
|
||||||
|
|
||||||
const auto& full_config = wxGetApp().preset_bundle->full_config();
|
const auto& full_config = wxGetApp().preset_bundle->full_config();
|
||||||
const auto& extra_flush_volumes = get_min_flush_volumes(full_config, 0); // todo multi_extruder: always display nozzle 1
|
|
||||||
size_t nozzle_nums = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter")->values.size();
|
size_t nozzle_nums = full_config.option<ConfigOptionFloatsNullable>("nozzle_diameter")->values.size();
|
||||||
|
|
||||||
bool use_double_extruder = nozzle_nums > 1 ? true : false;
|
bool use_double_extruder = nozzle_nums > 1 ? true : false;
|
||||||
|
@ -5270,6 +5269,8 @@ void EditDevNameDialog::on_edit_name(wxCommandEvent &e)
|
||||||
SetMinSize(SELECT_MACHINE_ITEM_SIZE);
|
SetMinSize(SELECT_MACHINE_ITEM_SIZE);
|
||||||
|
|
||||||
m_type = type;
|
m_type = type;
|
||||||
|
m_bitmap = ScalableBitmap(this, "bind_device_ping_code",10);
|
||||||
|
|
||||||
this->Bind(wxEVT_ENTER_WINDOW, &PinCodePanel::on_mouse_enter, this);
|
this->Bind(wxEVT_ENTER_WINDOW, &PinCodePanel::on_mouse_enter, this);
|
||||||
this->Bind(wxEVT_LEAVE_WINDOW, &PinCodePanel::on_mouse_leave, this);
|
this->Bind(wxEVT_LEAVE_WINDOW, &PinCodePanel::on_mouse_leave, this);
|
||||||
this->Bind(wxEVT_LEFT_UP, &PinCodePanel::on_mouse_left_up, this);
|
this->Bind(wxEVT_LEFT_UP, &PinCodePanel::on_mouse_left_up, this);
|
||||||
|
|
|
@ -4077,7 +4077,7 @@ void TabPrinter::build_unregular_pages(bool from_initial_build/* = false*/)
|
||||||
optgroup->append_single_option_line("max_layer_height", "adaptive-layer-height", extruder_idx);
|
optgroup->append_single_option_line("max_layer_height", "adaptive-layer-height", extruder_idx);
|
||||||
|
|
||||||
optgroup = page->new_optgroup(L("Position"), L"param_retraction", -1, true);
|
optgroup = page->new_optgroup(L("Position"), L"param_retraction", -1, true);
|
||||||
optgroup->append_single_option_line("extruder_offset", "", extruder_idx);
|
optgroup->append_single_option_line("extruder_offset");
|
||||||
|
|
||||||
//BBS: don't show retract related config menu in machine page
|
//BBS: don't show retract related config menu in machine page
|
||||||
optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
|
optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
|
||||||
|
|
|
@ -203,7 +203,7 @@ void WipingDialog::on_dpi_changed(const wxRect &suggested_rect)
|
||||||
|
|
||||||
// Parent dialog for purging volume adjustments - it fathers WipingPanel widget (that contains all controls) and a button to toggle simple/advanced mode:
|
// Parent dialog for purging volume adjustments - it fathers WipingPanel widget (that contains all controls) and a button to toggle simple/advanced mode:
|
||||||
WipingDialog::WipingDialog(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours,
|
WipingDialog::WipingDialog(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours,
|
||||||
const std::vector<int>&extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums)
|
const std::vector<std::vector<int>>&extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums)
|
||||||
: DPIDialog(parent ? parent : static_cast<wxWindow *>(wxGetApp().mainframe),
|
: DPIDialog(parent ? parent : static_cast<wxWindow *>(wxGetApp().mainframe),
|
||||||
wxID_ANY,
|
wxID_ANY,
|
||||||
_(L("Flushing volumes for filament change")),
|
_(L("Flushing volumes for filament change")),
|
||||||
|
@ -305,7 +305,7 @@ void WipingPanel::create_panels(wxWindow* parent, const int num) {
|
||||||
WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders,
|
WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders,
|
||||||
size_t cur_extruder_id,
|
size_t cur_extruder_id,
|
||||||
const std::vector<std::string>& extruder_colours, Button* calc_button,
|
const std::vector<std::string>& extruder_colours, Button* calc_button,
|
||||||
const std::vector<int>& extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums)
|
const std::vector<std::vector<int>>& extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums)
|
||||||
: wxPanel(parent,wxID_ANY, wxDefaultPosition, wxDefaultSize/*,wxBORDER_RAISED*/)
|
: wxPanel(parent,wxID_ANY, wxDefaultPosition, wxDefaultSize/*,wxBORDER_RAISED*/)
|
||||||
, m_flush_multiplier(flush_multiplier)
|
, m_flush_multiplier(flush_multiplier)
|
||||||
, m_matrix(matrix)
|
, m_matrix(matrix)
|
||||||
|
@ -441,7 +441,7 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector<float>& matrix, con
|
||||||
multi_desc_label->SetForegroundColour(g_text_color);
|
multi_desc_label->SetForegroundColour(g_text_color);
|
||||||
m_sizer_advanced->Add(multi_desc_label, 0, wxEXPAND | wxLEFT, TEXT_BEG_PADDING);
|
m_sizer_advanced->Add(multi_desc_label, 0, wxEXPAND | wxLEFT, TEXT_BEG_PADDING);
|
||||||
|
|
||||||
wxString min_flush_str = wxString::Format(_L("Suggestion: Flushing Volume in range [%d, %d]"),*std::min_element(m_min_flush_volume.begin(), m_min_flush_volume.end()), m_max_flush_volume);
|
wxString min_flush_str = wxString::Format(_L("Suggestion: Flushing Volume in range [%d, %d]"),*std::min_element(m_min_flush_volume[m_cur_extruder_id].begin(), m_min_flush_volume[m_cur_extruder_id].end()), m_max_flush_volume);
|
||||||
m_min_flush_label = new wxStaticText(m_page_advanced, wxID_ANY, min_flush_str, wxDefaultPosition, wxDefaultSize, 0);
|
m_min_flush_label = new wxStaticText(m_page_advanced, wxID_ANY, min_flush_str, wxDefaultPosition, wxDefaultSize, 0);
|
||||||
m_min_flush_label->SetForegroundColour(g_text_color);
|
m_min_flush_label->SetForegroundColour(g_text_color);
|
||||||
m_sizer_advanced->Add(m_min_flush_label, 0, wxEXPAND | wxLEFT, TEXT_BEG_PADDING);
|
m_sizer_advanced->Add(m_min_flush_label, 0, wxEXPAND | wxLEFT, TEXT_BEG_PADDING);
|
||||||
|
@ -628,7 +628,7 @@ void WipingPanel::update_warning_texts()
|
||||||
auto text_box = box_vec[j];
|
auto text_box = box_vec[j];
|
||||||
wxString str = text_box->GetValue();
|
wxString str = text_box->GetValue();
|
||||||
int actual_volume = wxAtoi(str);
|
int actual_volume = wxAtoi(str);
|
||||||
if (actual_volume < m_min_flush_volume[i] || actual_volume > m_max_flush_volume) {
|
if (actual_volume < m_min_flush_volume[m_cur_extruder_id][i] || actual_volume > m_max_flush_volume) {
|
||||||
if (text_box->GetForegroundColour() != g_warning_color) {
|
if (text_box->GetForegroundColour() != g_warning_color) {
|
||||||
text_box->SetForegroundColour(g_warning_color);
|
text_box->SetForegroundColour(g_warning_color);
|
||||||
text_box->Refresh();
|
text_box->Refresh();
|
||||||
|
@ -693,7 +693,7 @@ void WipingPanel::calc_flushing_volumes()
|
||||||
const wxColour& from = multi_colors[from_idx][i];
|
const wxColour& from = multi_colors[from_idx][i];
|
||||||
for (int j = 0; j < multi_colors[to_idx].size(); ++j) {
|
for (int j = 0; j < multi_colors[to_idx].size(); ++j) {
|
||||||
const wxColour& to = multi_colors[to_idx][j];
|
const wxColour& to = multi_colors[to_idx][j];
|
||||||
int volume = calc_flushing_volume(from, to, m_min_flush_volume[from_idx]);
|
int volume = calc_flushing_volume(from, to, m_min_flush_volume[m_cur_extruder_id][from_idx]);
|
||||||
flushing_volume = std::max(flushing_volume, volume);
|
flushing_volume = std::max(flushing_volume, volume);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,7 @@ public:
|
||||||
// BBS
|
// BBS
|
||||||
WipingPanel(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, size_t cur_extruder_id,
|
WipingPanel(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, size_t cur_extruder_id,
|
||||||
const std::vector<std::string>& extruder_colours, Button* calc_button,
|
const std::vector<std::string>& extruder_colours, Button* calc_button,
|
||||||
const std::vector<int>& extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums);
|
const std::vector<std::vector<int>>& extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums);
|
||||||
std::vector<float> read_matrix_values();
|
std::vector<float> read_matrix_values();
|
||||||
std::vector<float> read_extruders_values();
|
std::vector<float> read_extruders_values();
|
||||||
void toggle_advanced(bool user_action = false);
|
void toggle_advanced(bool user_action = false);
|
||||||
|
@ -65,7 +65,7 @@ private:
|
||||||
std::vector<wxButton *> icon_list1;
|
std::vector<wxButton *> icon_list1;
|
||||||
std::vector<wxButton *> icon_list2;
|
std::vector<wxButton *> icon_list2;
|
||||||
|
|
||||||
const std::vector<int> m_min_flush_volume;
|
const std::vector<std::vector<int>> m_min_flush_volume;
|
||||||
const int m_max_flush_volume;
|
const int m_max_flush_volume;
|
||||||
|
|
||||||
wxTextCtrl* m_flush_multiplier_ebox = nullptr;
|
wxTextCtrl* m_flush_multiplier_ebox = nullptr;
|
||||||
|
@ -86,7 +86,7 @@ class WipingDialog : public Slic3r::GUI::DPIDialog
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
WipingDialog(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours,
|
WipingDialog(wxWindow* parent, const std::vector<float>& matrix, const std::vector<float>& extruders, const std::vector<std::string>& extruder_colours,
|
||||||
const std::vector<int>&extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums);
|
const std::vector<std::vector<int>>&extra_flush_volume, const std::vector<float>& flush_multiplier, size_t nozzle_nums);
|
||||||
std::vector<float> get_matrix() const { return m_output_matrix; }
|
std::vector<float> get_matrix() const { return m_output_matrix; }
|
||||||
std::vector<float> get_extruders() const { return m_output_extruders; }
|
std::vector<float> get_extruders() const { return m_output_extruders; }
|
||||||
wxBoxSizer* create_btn_sizer(long flags);
|
wxBoxSizer* create_btn_sizer(long flags);
|
||||||
|
|
Loading…
Reference in New Issue