diff --git a/xs/src/slic3r/GUI/RammingChart.cpp b/xs/src/slic3r/GUI/RammingChart.cpp index 3b535aacf5..e07b958392 100644 --- a/xs/src/slic3r/GUI/RammingChart.cpp +++ b/xs/src/slic3r/GUI/RammingChart.cpp @@ -10,41 +10,41 @@ void Chart::draw(wxDC& dc) { dc.SetBrush(*wxWHITE_BRUSH); dc.DrawRectangle(m_rect); - if (visible_area->m_width < 0.499) { + if (visible_area.m_width < 0.499) { dc.DrawText("NO RAMMING AT ALL",wxPoint(m_rect.GetLeft()+m_rect.GetWidth()/2-50,m_rect.GetBottom()-m_rect.GetHeight()/2)); return; } - if (!m_line_to_draw->empty()) { - for (unsigned int i=0;isize()-2;++i) { - int color = 510*((m_rect.GetBottom()-(*m_line_to_draw)[i])/double(m_rect.GetHeight())); + if (!m_line_to_draw.empty()) { + for (unsigned int i=0;isize()-2;++i) { + for (unsigned int i=0;im_x*10)/10 ; math_x <= (visible_area->m_x+visible_area->m_width) ; math_x+=0.1) { - int x = math_to_screen(wxPoint2DDouble(math_x,visible_area->m_y)).x; + for (float math_x=int(visible_area.m_x*10)/10 ; math_x <= (visible_area.m_x+visible_area.m_width) ; math_x+=0.1) { + int x = math_to_screen(wxPoint2DDouble(math_x,visible_area.m_y)).x; int y = m_rect.GetBottom(); if (x-last_mark < 50) continue; dc.DrawLine(x,y+3,x,y-3); @@ -54,8 +54,8 @@ void Chart::draw(wxDC& dc) { // draw y-axis: last_mark=10000; - for (int math_y=visible_area->m_y ; math_y <= (visible_area->m_y+visible_area->m_height) ; math_y+=1) { - int y = math_to_screen(wxPoint2DDouble(visible_area->m_x,math_y)).y; + for (int math_y=visible_area.m_y ; math_y <= (visible_area.m_y+visible_area.m_height) ; math_y+=1) { + int y = math_to_screen(wxPoint2DDouble(visible_area.m_x,math_y)).y; int x = m_rect.GetLeft(); if (last_mark-y < 50) continue; dc.DrawLine(x-3,y,x+3,y); @@ -72,8 +72,8 @@ void Chart::mouse_right_button_clicked(wxMouseEvent& event) { return; wxPoint point = event.GetPosition(); int button_index = which_button_is_clicked(point); - if (button_index != -1 && m_buttons[m_current_extruder].size()>2) { - m_buttons[m_current_extruder].erase(m_buttons[m_current_extruder].begin()+button_index); + if (button_index != -1 && m_buttons.size()>2) { + m_buttons.erase(m_buttons.begin()+button_index); recalculate_line(); } } @@ -84,7 +84,7 @@ void Chart::mouse_clicked(wxMouseEvent& event) { wxPoint point = event.GetPosition(); int button_index = which_button_is_clicked(point); if ( button_index != -1) { - m_dragged = &m_buttons[m_current_extruder][button_index]; + m_dragged = &m_buttons[button_index]; m_previous_mouse = point; } } @@ -102,7 +102,7 @@ void Chart::mouse_moved(wxMouseEvent& event) { } int delta_x = pos.x - m_previous_mouse.x; int delta_y = pos.y - m_previous_mouse.y; - m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area->m_width,-double(delta_y)/m_rect.GetHeight() * visible_area->m_height); + m_dragged->move(fixed_x?0:double(delta_x)/m_rect.GetWidth() * visible_area.m_width,-double(delta_y)/m_rect.GetHeight() * visible_area.m_height); m_previous_mouse = pos; recalculate_line(); } @@ -115,8 +115,8 @@ void Chart::mouse_double_clicked(wxMouseEvent& event) { wxPoint point = event.GetPosition(); if (!m_rect.Contains(point)) // the click is outside the chart return; - m_buttons[m_current_extruder].push_back(screen_to_math(point)); - std::sort(m_buttons[m_current_extruder].begin(),m_buttons[m_current_extruder].end()); + m_buttons.push_back(screen_to_math(point)); + std::sort(m_buttons.begin(),m_buttons.end()); recalculate_line(); return; } @@ -126,7 +126,7 @@ void Chart::mouse_double_clicked(wxMouseEvent& event) { void Chart::recalculate_line() { std::vector points; - for (auto& but : m_buttons[m_current_extruder]) { + for (auto& but : m_buttons) { points.push_back(wxPoint(math_to_screen(but.get_pos()))); if (points.size()>1 && points.back().x==points[points.size()-2].x) points.pop_back(); if (points.size()>1 && points.back().x > m_rect.GetRight()) { @@ -136,7 +136,7 @@ void Chart::recalculate_line() { } std::sort(points.begin(),points.end(),[](wxPoint& a,wxPoint& b) { return a.x < b.x; }); - m_line_to_draw->clear(); + m_line_to_draw.clear(); m_total_volume = 0.f; @@ -205,19 +205,19 @@ void Chart::recalculate_line() { y = (rhs[i-1]*pow(points[i].x-x,3)+rhs[i]*pow(x-points[i-1].x,3)) / (6*h[i]) + (points[i-1].y-rhs[i-1]*h[i]*h[i]/6.f) * (points[i].x-x)/h[i] + (points[i].y -rhs[i] *h[i]*h[i]/6.f) * (x-points[i-1].x)/h[i]; - m_line_to_draw->push_back(y); + m_line_to_draw.push_back(y); } else { float x_math = screen_to_math(wxPoint(x,0)).m_x; - if (i+2<=points.size() && m_buttons[m_current_extruder][i+1].get_pos().m_x-0.125 < x_math) + if (i+2<=points.size() && m_buttons[i+1].get_pos().m_x-0.125 < x_math) ++i; - m_line_to_draw->push_back(math_to_screen(wxPoint2DDouble(x_math,m_buttons[m_current_extruder][i].get_pos().m_y)).y); + m_line_to_draw.push_back(math_to_screen(wxPoint2DDouble(x_math,m_buttons[i].get_pos().m_y)).y); } - m_line_to_draw->back() = std::max(m_line_to_draw->back(), m_rect.GetTop()-1); - m_line_to_draw->back() = std::min(m_line_to_draw->back(), m_rect.GetBottom()-1); - m_total_volume += (m_rect.GetBottom() - m_line_to_draw->back()) * (visible_area->m_width / m_rect.GetWidth()) * (visible_area->m_height / m_rect.GetHeight()); + m_line_to_draw.back() = std::max(m_line_to_draw.back(), m_rect.GetTop()-1); + m_line_to_draw.back() = std::min(m_line_to_draw.back(), m_rect.GetBottom()-1); + m_total_volume += (m_rect.GetBottom() - m_line_to_draw.back()) * (visible_area.m_width / m_rect.GetWidth()) * (visible_area.m_height / m_rect.GetHeight()); } wxPostEvent(this->GetParent(), wxCommandEvent(EVT_WIPE_TOWER_CHART_CHANGED)); @@ -226,36 +226,26 @@ void Chart::recalculate_line() { -std::vector> Chart::get_ramming_speeds(float sampling) const { - std::vector> speeds_out; - for (unsigned int extruder_id = 0;extruder_id this_extruder; - const int number_of_samples = std::round( visible_areas[extruder_id].m_width / sampling); - if (number_of_samples>0) { - const int dx = (m_lines_to_draw[extruder_id].size()-1) / number_of_samples; - for (int j=0;j Chart::get_ramming_speed(float sampling) const { + std::vector speeds_out; + const int number_of_samples = std::round( visible_area.m_width / sampling); + if (number_of_samples>0) { + const int dx = (m_line_to_draw.size()-1) / number_of_samples; + for (int j=0;j>> Chart::get_buttons() const { - std::vector>> buttons_out; - for (const auto& ext : m_buttons) { - std::vector> this_extruder; - for (const auto& button : ext) - this_extruder.push_back(std::make_pair(button.get_pos().m_x,button.get_pos().m_y)); - buttons_out.push_back(std::move(this_extruder)); - } +std::vector> Chart::get_buttons() const { + std::vector> buttons_out; + for (const auto& button : m_buttons) + buttons_out.push_back(std::make_pair(button.get_pos().m_x,button.get_pos().m_y)); return buttons_out; } diff --git a/xs/src/slic3r/GUI/RammingChart.hpp b/xs/src/slic3r/GUI/RammingChart.hpp index 8274b96e69..520b5808e0 100644 --- a/xs/src/slic3r/GUI/RammingChart.hpp +++ b/xs/src/slic3r/GUI/RammingChart.hpp @@ -13,39 +13,28 @@ wxDECLARE_EVENT(EVT_WIPE_TOWER_CHART_CHANGED, wxCommandEvent); class Chart : public wxWindow { public: - Chart(wxWindow* parent, wxRect rect,const std::vector>>& initial_buttons,std::vector> ramming_speed, float sampling) : + Chart(wxWindow* parent, wxRect rect,const std::vector>& initial_buttons,std::vector ramming_speed, float sampling) : wxWindow(parent,wxID_ANY,rect.GetTopLeft(),rect.GetSize()) { m_rect=wxRect(wxPoint(30,0),rect.GetSize()-wxSize(30,30)); - for (int i=0;i<4;++i) { - visible_areas.push_back(wxRect2DDouble(0.0, 0.0, sampling*ramming_speed[i].size(), 20.)); - m_buttons.push_back(std::vector()); - m_lines_to_draw.push_back(std::vector()); - if (initial_buttons.size()>0) - for (const auto& pair : initial_buttons[i]) - m_buttons.back().push_back(wxPoint2DDouble(pair.first,pair.second)); - set_extruder(i); // to calculate all interpolating splines - } - set_extruder(0); - } - void set_extruder(unsigned ext) { - if (ext>=4) return; - m_current_extruder = ext; - visible_area = &(visible_areas[ext]); - m_line_to_draw = &(m_lines_to_draw[ext]); + visible_area = wxRect2DDouble(0.0, 0.0, sampling*ramming_speed.size(), 20.); + m_buttons.clear(); + if (initial_buttons.size()>0) + for (const auto& pair : initial_buttons) + m_buttons.push_back(wxPoint2DDouble(pair.first,pair.second)); recalculate_line(); } void set_xy_range(float x,float y) { x = int(x/0.5) * 0.5; - if (x>=0) visible_area->SetRight(x); - if (y>=0) visible_area->SetBottom(y); + if (x>=0) visible_area.SetRight(x); + if (y>=0) visible_area.SetBottom(y); recalculate_line(); } float get_volume() const { return m_total_volume; } - float get_time() const { return visible_area->m_width; } - std::vector> get_ramming_speeds(float sampling) const; //returns sampled ramming speed for all extruders - std::vector>> get_buttons() const; // returns buttons position for all extruders - + float get_time() const { return visible_area.m_width; } + + std::vector get_ramming_speed(float sampling) const; //returns sampled ramming speed + std::vector> get_buttons() const; // returns buttons position void draw(wxDC& dc); @@ -80,8 +69,8 @@ private: wxPoint math_to_screen(const wxPoint2DDouble& math) const { wxPoint screen; - screen.x = (math.m_x-visible_area->m_x) * (m_rect.GetWidth() / visible_area->m_width ); - screen.y = (math.m_y-visible_area->m_y) * (m_rect.GetHeight() / visible_area->m_height ); + screen.x = (math.m_x-visible_area.m_x) * (m_rect.GetWidth() / visible_area.m_width ); + screen.y = (math.m_y-visible_area.m_y) * (m_rect.GetHeight() / visible_area.m_height ); screen.y *= -1; screen += m_rect.GetLeftBottom(); return screen; @@ -90,16 +79,16 @@ private: wxPoint2DDouble math = screen; math -= m_rect.GetLeftBottom(); math.m_y *= -1; - math.m_x *= visible_area->m_width / m_rect.GetWidth(); // scales to [0;1]x[0,1] - math.m_y *= visible_area->m_height / m_rect.GetHeight(); - return (math+visible_area->GetLeftTop()); + math.m_x *= visible_area.m_width / m_rect.GetWidth(); // scales to [0;1]x[0,1] + math.m_y *= visible_area.m_height / m_rect.GetHeight(); + return (math+visible_area.GetLeftTop()); } int which_button_is_clicked(const wxPoint& point) const { if (!m_rect.Contains(point)) return -1; - for (unsigned int i=0;i > m_buttons; - std::vector< std::vector > m_lines_to_draw; - std::vector< wxRect2DDouble > visible_areas; - wxRect2DDouble* visible_area = nullptr; - std::vector* m_line_to_draw = nullptr; + std::vector m_buttons; + std::vector m_line_to_draw; + wxRect2DDouble visible_area; ButtonToDrag* m_dragged = nullptr; - float m_total_volume = 0.f; - + float m_total_volume = 0.f; }; diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index ea80e2ecec..58d714fc77 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -796,7 +796,7 @@ void TabPrint::update() bool have_wipe_tower = m_config->opt_bool("wipe_tower"); vec_enable.resize(0); - vec_enable = { "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_per_color_wipe", "wipe_tower_rotation_angle"}; + vec_enable = { "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_per_color_wipe", "wipe_tower_rotation_angle", "wipe_tower_bridging"}; for (auto el : vec_enable) get_field(el)->toggle(have_wipe_tower); m_wipe_tower_btn->Enable(have_wipe_tower); @@ -885,20 +885,18 @@ void TabFilament::build() optgroup->append_single_option_line("filament_cooling_time"); line = { _(L("Ramming")), "" }; line.widget = [this](wxWindow* parent){ - auto ramming_dialog = new wxButton(parent, wxID_ANY, _(L("Advanced settings"))+"\u2026", wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxBU_EXACTFIT); - auto sizer = new wxBoxSizer(wxHORIZONTAL); - sizer->Add(ramming_dialog); - /*m_wipe_tower_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) + auto ramming_dialog_btn = new wxButton(parent, wxID_ANY, _(L("Ramming settings"))+"\u2026", wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxBU_EXACTFIT); + auto sizer = new wxBoxSizer(wxHORIZONTAL); + sizer->Add(ramming_dialog_btn); + + ramming_dialog_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) { - std::string init_data = (m_config->option("wipe_tower_advanced"))->value; - std::cout << "dialog init: " << init_data << std::endl; - WipeTowerDialog dlg(this,init_data); // dlg lives on stack, no need to call Destroy - - if (dlg.ShowModal() == wxID_OK) { - load_key_value("wipe_tower_advanced", dlg.GetValue()); - std::cout << std::endl << "dialog returned: " << dlg.GetValue() << std::endl; + //std::string init_data = (m_config->option("wipe_tower_advanced"))->value; + RammingDialog dlg(this,std::string()); + if (dlg.ShowModal() == wxID_OK) { + //load_key_value("wipe_tower_advanced", dlg.GetValue()); } - }));*/ + })); return sizer; }; optgroup->append_line(line); diff --git a/xs/src/slic3r/GUI/WipeTowerDialog.cpp b/xs/src/slic3r/GUI/WipeTowerDialog.cpp index 1891a401c4..8bf51e4e50 100644 --- a/xs/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/xs/src/slic3r/GUI/WipeTowerDialog.cpp @@ -40,12 +40,37 @@ std::ostream& operator<<(std::ostream& str,Slic3r::WipeTowerParameters& par) { return str; } + + +RammingDialog::RammingDialog(wxWindow* parent,const std::string& init_data) +: wxDialog(parent, -1, wxT("Ramming customization"), wxPoint(50,50), wxSize(800,550), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +{ + this->Centre(); + m_panel_ramming = new RammingPanel(this,Slic3r::WipeTowerParameters(std::string())); + m_panel_ramming->Show(true); + this->Show(); + + auto main_sizer = new wxBoxSizer(wxVERTICAL); + main_sizer->Add(m_panel_ramming, 1, wxEXPAND); + main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALIGN_CENTER_HORIZONTAL | wxBOTTOM, 10); + SetSizer(main_sizer); + SetMinSize(GetSize()); + main_sizer->SetSizeHints(this); + + this->Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& e) { EndModal(wxCANCEL); }); + this->Bind(wxEVT_BUTTON,[this](wxCommandEvent&) { + // m_output_data=read_dialog_values(); + EndModal(wxID_OK); + },wxID_OK); +} + + RammingPanel::RammingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p) -: wxPanel(parent,wxID_ANY,wxPoint(0,0),wxSize(0,0),wxBORDER_RAISED) +: wxPanel(parent,wxID_ANY,wxPoint(50,50), wxSize(800,350),wxBORDER_RAISED) { new wxStaticText(this,wxID_ANY,wxString("Total ramming time (s):"), wxPoint(500,105), wxSize(200,25),wxALIGN_LEFT); m_widget_time = new wxSpinCtrlDouble(this,wxID_ANY,wxEmptyString, wxPoint(700,100), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0.,5.0,3.,0.5); @@ -55,56 +80,40 @@ RammingPanel::RammingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p m_widget_ramming_line_width_multiplicator = new wxSpinCtrl(this,wxID_ANY,wxEmptyString, wxPoint(700,200), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,10,200,100); new wxStaticText(this,wxID_ANY,wxString("Ramming line spacing (%):"), wxPoint(500,235), wxSize(200,25),wxALIGN_LEFT); m_widget_ramming_step_multiplicator = new wxSpinCtrl(this,wxID_ANY,wxEmptyString, wxPoint(700,230), wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,10,200,100); - new wxStaticText(this,wxID_ANY,wxString("Extruder #:"), wxPoint(500,12), wxSize(200,25),wxALIGN_LEFT); - wxArrayString choices; - for (unsigned int i=0;iset_extruder(0); m_widget_time->SetValue(m_chart->get_time()); m_widget_time->SetDigits(2); m_widget_volume->SetValue(m_chart->get_volume()); m_widget_volume->Disable(); - m_widget_extruder->SetSelection(0); - extruder_selection_changed(); // tell everyone to redraw + m_widget_ramming_line_width_multiplicator->SetValue(m_ramming_line_width_multiplicator); + m_widget_ramming_step_multiplicator->SetValue(m_ramming_step_multiplicator); m_widget_ramming_step_multiplicator->Bind(wxEVT_TEXT,[this](wxCommandEvent&) { line_parameters_changed(); }); m_widget_ramming_line_width_multiplicator->Bind(wxEVT_TEXT,[this](wxCommandEvent&) { line_parameters_changed(); }); - m_widget_extruder->Bind(wxEVT_CHOICE,[this](wxCommandEvent&) { extruder_selection_changed(); }); m_widget_time->Bind(wxEVT_TEXT,[this](wxCommandEvent&) {m_chart->set_xy_range(m_widget_time->GetValue(),-1);}); m_widget_time->Bind(wxEVT_CHAR,[](wxKeyEvent&){}); // do nothing - prevents the user to change the value m_widget_volume->Bind(wxEVT_CHAR,[](wxKeyEvent&){}); // do nothing - prevents the user to change the value - Bind(EVT_WIPE_TOWER_CHART_CHANGED,[this](wxCommandEvent&) {m_widget_volume->SetValue(m_chart->get_volume()); m_widget_time->SetValue(m_chart->get_time());} ); + Bind(EVT_WIPE_TOWER_CHART_CHANGED,[this](wxCommandEvent&) {m_widget_volume->SetValue(m_chart->get_volume()); m_widget_time->SetValue(m_chart->get_time());} ); + Refresh(this); } + void RammingPanel::fill_parameters(Slic3r::WipeTowerParameters& p) { if (!m_chart) return; - p.ramming_buttons = m_chart->get_buttons(); - p.ramming_speed = m_chart->get_ramming_speeds(p.sampling); - for (unsigned int i=0;iGetSelection(); - m_chart->set_extruder(m_current_extruder); // tell our chart to redraw - m_widget_ramming_line_width_multiplicator ->SetValue(m_ramming_line_width_multiplicators[m_current_extruder]); - m_widget_ramming_step_multiplicator->SetValue(m_ramming_step_multiplicators[m_current_extruder]); + p.ramming_buttons[0] = m_chart->get_buttons(); + p.ramming_speed[0] = m_chart->get_ramming_speed(p.sampling); + p.ramming_line_width_multiplicator.push_back(m_ramming_line_width_multiplicator/100.f); + p.ramming_step_multiplicator.push_back(m_ramming_step_multiplicator/100.f); } + void RammingPanel::line_parameters_changed() { - m_ramming_line_width_multiplicators[m_current_extruder]=m_widget_ramming_line_width_multiplicator->GetValue(); - m_ramming_step_multiplicators[m_current_extruder]=m_widget_ramming_step_multiplicator->GetValue(); + m_ramming_line_width_multiplicator = m_widget_ramming_line_width_multiplicator->GetValue(); + m_ramming_step_multiplicator = m_widget_ramming_step_multiplicator->GetValue(); } @@ -112,7 +121,7 @@ void RammingPanel::line_parameters_changed() { WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p) -: wxPanel(parent,wxID_ANY,wxPoint(0,0),wxSize(0,0),wxBORDER_RAISED) +: wxPanel(parent,wxID_ANY,wxPoint(50,50), wxSize(800,350),wxBORDER_RAISED) { const int N = 4; // number of extruders new wxStaticText(this,wxID_ANY,wxString("Volume to wipe when the filament is being"),wxPoint(40,55) ,wxSize(500,25)); @@ -141,6 +150,7 @@ WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p) } m_widget_button->Bind(wxEVT_BUTTON,[this](wxCommandEvent&){fill_in_matrix();}); + Refresh(this); } void WipingPanel::fill_parameters(Slic3r::WipeTowerParameters& p) { @@ -183,7 +193,7 @@ void WipingPanel::fill_in_matrix() { WipeTowerDialog::WipeTowerDialog(wxWindow* parent,const std::string& init_data) -: wxDialog(parent, -1, wxT("Wipe tower advanced settings"), wxPoint(50,50), wxSize(800,550), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) +: wxDialog(parent, -1, wxT("Wiping customization"), wxPoint(50,50), wxSize(800,550), wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { this->Centre(); @@ -192,21 +202,11 @@ WipeTowerDialog::WipeTowerDialog(wxWindow* parent,const std::string& init_data) wxMessageDialog(this,"Wipe tower parameters not parsed correctly!\nRestoring default settings.","Error",wxICON_ERROR); parameters.set_defaults(); } - - wxNotebook* notebook = new wxNotebook(this,wxID_ANY,wxPoint(0,0),wxSize(800,450)); - - //m_panel_general = new GeneralPanel(notebook,parameters); - m_panel_ramming = new RammingPanel(notebook,parameters); - //m_panel_cooling = new CoolingPanel(notebook,parameters); - m_panel_wiping = new WipingPanel(notebook,parameters); - //notebook->AddPage(m_panel_general,"General"); - notebook->AddPage(m_panel_ramming,"Ramming"); - //notebook->AddPage(m_panel_cooling,"Cooling"); - notebook->AddPage(m_panel_wiping,"Wiping"); + m_panel_wiping = new WipingPanel(this,parameters); this->Show(); auto main_sizer = new wxBoxSizer(wxVERTICAL); - main_sizer->Add(notebook, 1, wxEXPAND); + main_sizer->Add(m_panel_wiping, 1, wxEXPAND); main_sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxALIGN_CENTER_HORIZONTAL | wxBOTTOM, 10); SetSizer(main_sizer); SetMinSize(GetSize()); diff --git a/xs/src/slic3r/GUI/WipeTowerDialog.hpp b/xs/src/slic3r/GUI/WipeTowerDialog.hpp index 8a1c88be81..f9a9f95248 100644 --- a/xs/src/slic3r/GUI/WipeTowerDialog.hpp +++ b/xs/src/slic3r/GUI/WipeTowerDialog.hpp @@ -15,10 +15,10 @@ // Human-readable output of Parameters structure std::ostream& operator<<(std::ostream& str,Slic3r::WipeTowerParameters& par); - class RammingPanel : public wxPanel { public: + RammingPanel(wxWindow* parent); RammingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p); void fill_parameters(Slic3r::WipeTowerParameters& p); @@ -28,17 +28,22 @@ private: wxSpinCtrl* m_widget_ramming_line_width_multiplicator = nullptr; wxSpinCtrl* m_widget_ramming_step_multiplicator = nullptr; wxSpinCtrlDouble* m_widget_time = nullptr; - wxChoice* m_widget_extruder = nullptr; - std::vector m_ramming_step_multiplicators; - std::vector m_ramming_line_width_multiplicators; - int m_current_extruder = 0; // zero-based index - - void extruder_selection_changed(); - + int m_ramming_step_multiplicator; + int m_ramming_line_width_multiplicator; + void line_parameters_changed(); }; +class RammingDialog : public wxDialog { +public: + RammingDialog(wxWindow* parent,const std::string& init_data); +private: + RammingPanel* m_panel_ramming = nullptr; +}; + + + class WipingPanel : public wxPanel { public: @@ -67,13 +72,11 @@ public: private: std::string m_file_name="config_wipe_tower"; - RammingPanel* m_panel_ramming = nullptr; WipingPanel* m_panel_wiping = nullptr; std::string m_output_data = ""; std::string read_dialog_values() { Slic3r::WipeTowerParameters p; - m_panel_ramming->fill_parameters(p); m_panel_wiping ->fill_parameters(p); return p.to_string(); }