mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-19 08:57:36 +08:00
Got rid of wipe_tower_advanced option
This commit is contained in:
parent
e864238609
commit
b556cec42d
@ -110,7 +110,7 @@ public:
|
|||||||
// width -- width of wipe tower in mm ( default 60 mm - leave as it is )
|
// width -- width of wipe tower in mm ( default 60 mm - leave as it is )
|
||||||
// wipe_area -- space available for one toolchange in mm
|
// wipe_area -- space available for one toolchange in mm
|
||||||
WipeTowerPrusaMM(float x, float y, float width, float wipe_area, float rotation_angle, float cooling_tube_retraction,
|
WipeTowerPrusaMM(float x, float y, float width, float wipe_area, float rotation_angle, float cooling_tube_retraction,
|
||||||
float cooling_tube_length, float parking_pos_retraction, float bridging, bool adhesion, std::string& parameters,
|
float cooling_tube_length, float parking_pos_retraction, float bridging, bool adhesion, const std::string& parameters,
|
||||||
unsigned int initial_tool) :
|
unsigned int initial_tool) :
|
||||||
m_wipe_tower_pos(x, y),
|
m_wipe_tower_pos(x, y),
|
||||||
m_wipe_tower_width(width),
|
m_wipe_tower_width(width),
|
||||||
|
@ -195,7 +195,6 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
|||||||
|| opt_key == "spiral_vase"
|
|| opt_key == "spiral_vase"
|
||||||
|| opt_key == "temperature"
|
|| opt_key == "temperature"
|
||||||
|| opt_key == "wipe_tower"
|
|| opt_key == "wipe_tower"
|
||||||
|| opt_key == "wipe_tower_advanced"
|
|
||||||
|| opt_key == "wipe_tower_x"
|
|| opt_key == "wipe_tower_x"
|
||||||
|| opt_key == "wipe_tower_y"
|
|| opt_key == "wipe_tower_y"
|
||||||
|| opt_key == "wipe_tower_width"
|
|| opt_key == "wipe_tower_width"
|
||||||
@ -1035,7 +1034,7 @@ void Print::_make_wipe_tower()
|
|||||||
float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
|
float(this->config.wipe_tower_rotation_angle.value), float(this->config.cooling_tube_retraction.value),
|
||||||
float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
|
float(this->config.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
|
||||||
float(this->config.wipe_tower_bridging), bool(this->config.wipe_tower_adhesion),
|
float(this->config.wipe_tower_bridging), bool(this->config.wipe_tower_adhesion),
|
||||||
this->config.wipe_tower_advanced.value,m_tool_ordering.first_extruder());
|
/*this->config.wipe_tower_advanced.value*/std::string(""),m_tool_ordering.first_extruder());
|
||||||
|
|
||||||
//wipe_tower.set_retract();
|
//wipe_tower.set_retract();
|
||||||
//wipe_tower.set_zhop();
|
//wipe_tower.set_zhop();
|
||||||
|
@ -1773,12 +1773,24 @@ PrintConfigDef::PrintConfigDef()
|
|||||||
def->cli = "wipe-tower!";
|
def->cli = "wipe-tower!";
|
||||||
def->default_value = new ConfigOptionBool(false);
|
def->default_value = new ConfigOptionBool(false);
|
||||||
|
|
||||||
def = this->add("wipe_tower_advanced", coString);
|
def = this->add("wiping_volumes_extruders", coFloats);
|
||||||
def->label = L("Advanced string");
|
def->label = L("Extrusion multiplier");
|
||||||
def->tooltip = L("Advanced tooltip ");
|
def->tooltip = L("This vector saves required volumes to change from/to each tool used on the "
|
||||||
def->sidetext = L("advanced sidetext");
|
"wipe tower. These values are used to simplify creation of the full purging "
|
||||||
def->cli = "wipe-tower-advanced=s";
|
"volumes below. ");
|
||||||
def->default_value = new ConfigOptionString("");
|
def->cli = "wiping-volumes-extruders=f@";
|
||||||
|
def->default_value = new ConfigOptionFloats { 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f, 50.f };
|
||||||
|
|
||||||
|
def = this->add("wiping_volumes_matrix", coFloats);
|
||||||
|
def->label = L("Extrusion multiplier");
|
||||||
|
def->tooltip = L("This matrix describes volumes (in cubic milimetres) required to purge the"
|
||||||
|
" new filament on the wipe tower for any given pair of tools. ");
|
||||||
|
def->cli = "wiping-volumes-matrix=f@";
|
||||||
|
def->default_value = new ConfigOptionFloats { 0.f, 100.f, 100.f, 100.f, 100.f,
|
||||||
|
100.f, 0.f, 100.f, 100.f, 100.f,
|
||||||
|
100.f, 100.f, 0.f, 100.f, 100.f,
|
||||||
|
100.f, 100.f, 100.f, 0.f, 100.f,
|
||||||
|
100.f, 100.f, 100.f, 100.f, 0.f };
|
||||||
|
|
||||||
def = this->add("wipe_tower_x", coFloat);
|
def = this->add("wipe_tower_x", coFloat);
|
||||||
def->label = L("Position X");
|
def->label = L("Position X");
|
||||||
|
@ -500,7 +500,8 @@ public:
|
|||||||
ConfigOptionFloat cooling_tube_retraction;
|
ConfigOptionFloat cooling_tube_retraction;
|
||||||
ConfigOptionFloat cooling_tube_length;
|
ConfigOptionFloat cooling_tube_length;
|
||||||
ConfigOptionFloat parking_pos_retraction;
|
ConfigOptionFloat parking_pos_retraction;
|
||||||
|
|
||||||
|
|
||||||
std::string get_extrusion_axis() const
|
std::string get_extrusion_axis() const
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
@ -622,7 +623,6 @@ public:
|
|||||||
ConfigOptionInt threads;
|
ConfigOptionInt threads;
|
||||||
ConfigOptionBools wipe;
|
ConfigOptionBools wipe;
|
||||||
ConfigOptionBool wipe_tower;
|
ConfigOptionBool wipe_tower;
|
||||||
ConfigOptionString wipe_tower_advanced;
|
|
||||||
ConfigOptionFloat wipe_tower_x;
|
ConfigOptionFloat wipe_tower_x;
|
||||||
ConfigOptionFloat wipe_tower_y;
|
ConfigOptionFloat wipe_tower_y;
|
||||||
ConfigOptionFloat wipe_tower_width;
|
ConfigOptionFloat wipe_tower_width;
|
||||||
@ -690,7 +690,6 @@ protected:
|
|||||||
OPT_PTR(threads);
|
OPT_PTR(threads);
|
||||||
OPT_PTR(wipe);
|
OPT_PTR(wipe);
|
||||||
OPT_PTR(wipe_tower);
|
OPT_PTR(wipe_tower);
|
||||||
OPT_PTR(wipe_tower_advanced);
|
|
||||||
OPT_PTR(wipe_tower_x);
|
OPT_PTR(wipe_tower_x);
|
||||||
OPT_PTR(wipe_tower_y);
|
OPT_PTR(wipe_tower_y);
|
||||||
OPT_PTR(wipe_tower_width);
|
OPT_PTR(wipe_tower_width);
|
||||||
@ -736,6 +735,7 @@ class FullPrintConfig :
|
|||||||
public:
|
public:
|
||||||
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
|
||||||
std::string validate();
|
std::string validate();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected constructor to be called to initialize ConfigCache::m_default.
|
// Protected constructor to be called to initialize ConfigCache::m_default.
|
||||||
FullPrintConfig(int) : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) {}
|
FullPrintConfig(int) : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) {}
|
||||||
|
@ -198,7 +198,7 @@ const std::vector<std::string>& Preset::print_options()
|
|||||||
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
|
"ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width",
|
||||||
"perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width",
|
"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",
|
"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",
|
"elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x",
|
||||||
"wipe_tower_y", "wipe_tower_width", "wipe_tower_per_color_wipe", "wipe_tower_rotation_angle", "wipe_tower_adhesion", "wipe_tower_bridging",
|
"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"
|
"compatible_printers", "compatible_printers_condition"
|
||||||
|
|
||||||
|
@ -467,13 +467,12 @@ void TabPrint::build()
|
|||||||
sizer->Add(m_wipe_tower_btn);
|
sizer->Add(m_wipe_tower_btn);
|
||||||
m_wipe_tower_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e)
|
m_wipe_tower_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e)
|
||||||
{
|
{
|
||||||
std::string init_data = (m_config->option<ConfigOptionString>("wipe_tower_advanced"))->value;
|
//auto init_data = (m_config->option<ConfigOptionFloats>("wiping_volumes_matrix"))->values;
|
||||||
std::cout << "dialog init: " << init_data << std::endl;
|
//WipingDialog dlg(this,std::vector<float>(init_data.begin(), init_data.end())); // dlg lives on stack, no need to call Destroy
|
||||||
WipingDialog dlg(this,init_data); // dlg lives on stack, no need to call Destroy
|
|
||||||
|
|
||||||
if (dlg.ShowModal() == wxID_OK) {
|
if (dlg.ShowModal() == wxID_OK) {
|
||||||
load_key_value("wipe_tower_advanced", dlg.GetValue());
|
//load_key_value("wipe_tower_advanced", dlg.GetValue());
|
||||||
std::cout << std::endl << "dialog returned: " << dlg.GetValue() << std::endl;
|
//std::cout << std::endl << "dialog returned: " << dlg.GetValue() << std::endl;
|
||||||
}
|
}
|
||||||
}));
|
}));
|
||||||
return sizer;
|
return sizer;
|
||||||
|
@ -122,17 +122,12 @@ void WipingPanel::fill_parameters(Slic3r::WipeTowerParameters& p) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
WipingDialog::WipingDialog(wxWindow* parent,const std::string& init_data)
|
WipingDialog::WipingDialog(wxWindow* parent,const std::vector<float>& init_data)
|
||||||
: wxDialog(parent, -1, wxT("Wiping customization"), 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();
|
this->Centre();
|
||||||
|
|
||||||
Slic3r::WipeTowerParameters parameters(init_data);
|
m_panel_wiping = new WipingPanel(this,init_data);
|
||||||
/*if (!parameters.validate()) {
|
|
||||||
wxMessageDialog(this,"Wipe tower parameters not parsed correctly!\nRestoring default settings.","Error",wxICON_ERROR);
|
|
||||||
parameters.set_defaults();
|
|
||||||
}*/
|
|
||||||
m_panel_wiping = new WipingPanel(this,parameters);
|
|
||||||
this->Show();
|
this->Show();
|
||||||
|
|
||||||
auto main_sizer = new wxBoxSizer(wxVERTICAL);
|
auto main_sizer = new wxBoxSizer(wxVERTICAL);
|
||||||
@ -145,14 +140,14 @@ WipingDialog::WipingDialog(wxWindow* parent,const std::string& init_data)
|
|||||||
this->Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& e) { EndModal(wxCANCEL); });
|
this->Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent& e) { EndModal(wxCANCEL); });
|
||||||
|
|
||||||
this->Bind(wxEVT_BUTTON,[this](wxCommandEvent&) {
|
this->Bind(wxEVT_BUTTON,[this](wxCommandEvent&) {
|
||||||
m_output_data=read_dialog_values();
|
//m_output_data=read_dialog_values();
|
||||||
EndModal(wxID_OK);
|
EndModal(wxID_OK);
|
||||||
},wxID_OK);
|
},wxID_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
|
WipingPanel::WipingPanel(wxWindow* parent,const std::vector<float>& data)
|
||||||
: wxPanel(parent,wxID_ANY,wxPoint(50,50), wxSize(800,350),wxBORDER_RAISED)
|
: wxPanel(parent,wxID_ANY,wxPoint(50,50), wxSize(800,350),wxBORDER_RAISED)
|
||||||
{
|
{
|
||||||
const int N = 4; // number of extruders
|
const int N = 4; // number of extruders
|
||||||
@ -162,8 +157,8 @@ WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
|
|||||||
m_widget_button = new wxButton(this,wxID_ANY,"-> Fill in the matrix ->",wxPoint(300,130),wxSize(175,50));
|
m_widget_button = new wxButton(this,wxID_ANY,"-> Fill in the matrix ->",wxPoint(300,130),wxSize(175,50));
|
||||||
for (int i=0;i<N;++i) {
|
for (int i=0;i<N;++i) {
|
||||||
new wxStaticText(this,wxID_ANY,wxString("Filament #")<<i+1<<": ",wxPoint(20,105+30*i) ,wxSize(150,25),wxALIGN_LEFT);
|
new wxStaticText(this,wxID_ANY,wxString("Filament #")<<i+1<<": ",wxPoint(20,105+30*i) ,wxSize(150,25),wxALIGN_LEFT);
|
||||||
m_old.push_back(new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(120,100+30*i),wxSize(50,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,100,p.filament_wipe_volumes[i].first));
|
m_old.push_back(new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(120,100+30*i),wxSize(50,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,100,data[2*i]));
|
||||||
m_new.push_back(new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(195,100+30*i),wxSize(50,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,100,p.filament_wipe_volumes[i].second));
|
m_new.push_back(new wxSpinCtrl(this,wxID_ANY,wxEmptyString,wxPoint(195,100+30*i),wxSize(50,25),wxSP_ARROW_KEYS|wxALIGN_RIGHT,0,100,data[2*i+1]));
|
||||||
}
|
}
|
||||||
|
|
||||||
wxPoint origin(515,55);
|
wxPoint origin(515,55);
|
||||||
@ -176,7 +171,7 @@ WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
|
|||||||
if (i==j)
|
if (i==j)
|
||||||
edit_boxes[i][j]->Disable();
|
edit_boxes[i][j]->Disable();
|
||||||
else
|
else
|
||||||
edit_boxes[i][j]->SetValue(wxString("")<<int(p.wipe_volumes[j][i]));
|
edit_boxes[i][j]->SetValue(wxString("")<<int(0));//p.wipe_volumes[j][i]));
|
||||||
}
|
}
|
||||||
new wxStaticText(this,wxID_ANY,wxString("Filament changed to"),origin+wxPoint(75,0) ,wxSize(500,25));
|
new wxStaticText(this,wxID_ANY,wxString("Filament changed to"),origin+wxPoint(75,0) ,wxSize(500,25));
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ private:
|
|||||||
|
|
||||||
class WipingPanel : public wxPanel {
|
class WipingPanel : public wxPanel {
|
||||||
public:
|
public:
|
||||||
WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p);
|
WipingPanel(wxWindow* parent,const std::vector<float>& data);
|
||||||
void fill_parameters(Slic3r::WipeTowerParameters& p);
|
void fill_parameters(Slic3r::WipeTowerParameters& p);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@ -66,15 +66,13 @@ private:
|
|||||||
|
|
||||||
class WipingDialog : public wxDialog {
|
class WipingDialog : public wxDialog {
|
||||||
public:
|
public:
|
||||||
WipingDialog(wxWindow* parent,const std::string& init_data);
|
WipingDialog(wxWindow* parent,const std::vector<float>& init_data);
|
||||||
|
std::vector<float> get_value() const { return m_output_data; }
|
||||||
std::string GetValue() const { return m_output_data; }
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string m_file_name="config_wipe_tower";
|
|
||||||
WipingPanel* m_panel_wiping = nullptr;
|
WipingPanel* m_panel_wiping = nullptr;
|
||||||
std::string m_output_data = "";
|
std::vector<float> m_output_data;
|
||||||
|
|
||||||
std::string read_dialog_values() {
|
std::string read_dialog_values() {
|
||||||
Slic3r::WipeTowerParameters p;
|
Slic3r::WipeTowerParameters p;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user