Configuration layer changes (cooling_time, bridging, adhesion moved from dedicated dialog to filament/print settings)

This commit is contained in:
Lukas Matena 2018-03-12 15:41:25 +01:00
parent b5fd4ddb8c
commit 27ab8ff4e1
9 changed files with 91 additions and 110 deletions

View file

@ -199,8 +199,8 @@ const std::vector<std::string>& Preset::print_options()
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
"top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio", "clip_multipart_objects",
"elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower_advanced", "wipe_tower", "wipe_tower_x",
"wipe_tower_y", "wipe_tower_width", "wipe_tower_per_color_wipe", "wipe_tower_rotation_angle", "compatible_printers",
"compatible_printers_condition"
"wipe_tower_y", "wipe_tower_width", "wipe_tower_per_color_wipe", "wipe_tower_rotation_angle", "wipe_tower_adhesion", "wipe_tower_bridging",
"compatible_printers", "compatible_printers_condition"
};
return s_opts;
@ -211,7 +211,7 @@ const std::vector<std::string>& Preset::filament_options()
static std::vector<std::string> s_opts {
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed",
"extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_unloading_speed", "filament_toolchange_delay",
"temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling",
"filament_cooling_time", "temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling",
"min_fan_speed", "max_fan_speed", "bridge_fan_speed", "disable_fan_first_layers", "fan_below_layer_time", "slowdown_below_layer_time",
"min_print_speed", "start_filament_gcode", "end_filament_gcode","compatible_printers", "compatible_printers_condition"
};

View file

@ -458,6 +458,8 @@ void TabPrint::build()
optgroup->append_single_option_line("wipe_tower_width");
optgroup->append_single_option_line("wipe_tower_per_color_wipe");
optgroup->append_single_option_line("wipe_tower_rotation_angle");
optgroup->append_single_option_line("wipe_tower_bridging");
optgroup->append_single_option_line("wipe_tower_adhesion");
line = { _(L("Advanced")), "" };
line.widget = [this](wxWindow* parent){
m_wipe_tower_btn = new wxButton(parent, wxID_ANY, _(L("Advanced settings"))+"\u2026", wxDefaultPosition, wxDefaultSize, wxBU_LEFT | wxBU_EXACTFIT);
@ -880,6 +882,27 @@ void TabFilament::build()
optgroup->append_single_option_line("filament_loading_speed");
optgroup->append_single_option_line("filament_unloading_speed");
optgroup->append_single_option_line("filament_toolchange_delay");
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)
{
std::string init_data = (m_config->option<ConfigOptionString>("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;
}
}));*/
return sizer;
};
optgroup->append_line(line);
page = add_options_page(_(L("Custom G-code")), "cog.png");
optgroup = page->new_optgroup(_(L("Start G-code")), 0);

View file

@ -3,13 +3,8 @@
// Human-readable output of Parameters structure
std::ostream& operator<<(std::ostream& str,Slic3r::WipeTowerParameters& par) {
str << "bridging: " << par.bridging << "\n";
str << "adhesion: " << par.adhesion << "\n";
str << "sampling: " << par.sampling << "\n";
str << "cooling times: ";
for (const auto& a : par.cooling_time) str << a << " ";
str << "line widths: ";
for (const auto& a : par.ramming_line_width_multiplicator) str << a << " ";
@ -116,30 +111,6 @@ void RammingPanel::line_parameters_changed() {
CoolingPanel::CoolingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
: wxPanel(parent,wxID_ANY,wxPoint(0,0),wxSize(0,0),wxBORDER_RAISED)
{
new wxStaticText(this,wxID_ANY,wxString("Time (in seconds) reserved for cooling after unload:"),wxPoint(220,50) ,wxSize(400,25),wxALIGN_LEFT);
for (int i=0;i<4;++i) {
new wxStaticText(this,wxID_ANY,wxString("Filament #")<<i+1<<": ",wxPoint(300,105+30*i) ,wxSize(150,25),wxALIGN_LEFT);
m_widget_edits.push_back(new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(400,100+30*i),wxSize(75,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,30,15));
}
for (unsigned int i=0;i<p.cooling_time.size();++i) {
if (i>=m_widget_edits.size())
break; // so we don't initialize non-existent widget
m_widget_edits[i]->SetValue(p.cooling_time[i]);
}
}
void CoolingPanel::fill_parameters(Slic3r::WipeTowerParameters& p) {
p.cooling_time.clear();
for (int i=0;i<4;++i)
p.cooling_time.push_back(m_widget_edits[i]->GetValue());
}
WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
: wxPanel(parent,wxID_ANY,wxPoint(0,0),wxSize(0,0),wxBORDER_RAISED)
{
@ -208,20 +179,6 @@ void WipingPanel::fill_in_matrix() {
GeneralPanel::GeneralPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p) : wxPanel(parent,wxID_ANY,wxPoint(0,0),wxSize(0,0),wxBORDER_RAISED) {
new wxStaticText(this,wxID_ANY,wxString("Maximum bridging over sparse infill (mm):"),wxPoint(100,105) ,wxSize(280,25),wxALIGN_LEFT);
m_widget_bridge = new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(380,100),wxSize(50,25),wxALIGN_RIGHT|wxSP_ARROW_KEYS,1,50,10);
m_widget_adhesion = new wxCheckBox(this,wxID_ANY,"Increased adhesion of first layer",wxPoint(100,150),wxSize(330,25),wxALIGN_RIGHT);
m_widget_bridge->SetValue(p.bridging);
m_widget_adhesion->SetValue(p.adhesion);
}
void GeneralPanel::fill_parameters(Slic3r::WipeTowerParameters& p) {
p.bridging = m_widget_bridge->GetValue();
p.adhesion = m_widget_adhesion->GetValue();
}
@ -238,13 +195,13 @@ WipeTowerDialog::WipeTowerDialog(wxWindow* parent,const std::string& init_data)
wxNotebook* notebook = new wxNotebook(this,wxID_ANY,wxPoint(0,0),wxSize(800,450));
m_panel_general = new GeneralPanel(notebook,parameters);
//m_panel_general = new GeneralPanel(notebook,parameters);
m_panel_ramming = new RammingPanel(notebook,parameters);
m_panel_cooling = new CoolingPanel(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_general,"General");
notebook->AddPage(m_panel_ramming,"Ramming");
notebook->AddPage(m_panel_cooling,"Cooling");
//notebook->AddPage(m_panel_cooling,"Cooling");
notebook->AddPage(m_panel_wiping,"Wiping");
this->Show();

View file

@ -40,23 +40,6 @@ private:
class CoolingPanel : public wxPanel {
public:
CoolingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p);
void fill_parameters(Slic3r::WipeTowerParameters& p);
private:
std::vector<wxSpinCtrl*> m_widget_edits;
};
class WipingPanel : public wxPanel {
public:
WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p);
@ -74,18 +57,6 @@ private:
class GeneralPanel : public wxPanel {
public:
GeneralPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p);
void fill_parameters(Slic3r::WipeTowerParameters& p);
private:
wxSpinCtrl* m_widget_bridge;
wxCheckBox* m_widget_adhesion;
};
class WipeTowerDialog : public wxDialog {
public:
@ -96,17 +67,13 @@ public:
private:
std::string m_file_name="config_wipe_tower";
GeneralPanel* m_panel_general = nullptr;
RammingPanel* m_panel_ramming = nullptr;
CoolingPanel* m_panel_cooling = nullptr;
WipingPanel* m_panel_wiping = nullptr;
std::string m_output_data = "";
std::string read_dialog_values() {
Slic3r::WipeTowerParameters p;
m_panel_general->fill_parameters(p);
m_panel_ramming->fill_parameters(p);
m_panel_cooling->fill_parameters(p);
m_panel_wiping ->fill_parameters(p);
return p.to_string();
}