Got rid of wipe_tower_advanced option

This commit is contained in:
Lukas Matena 2018-03-16 13:58:58 +01:00
parent e864238609
commit b556cec42d
8 changed files with 40 additions and 37 deletions

View File

@ -110,7 +110,7 @@ public:
// width -- width of wipe tower in mm ( default 60 mm - leave as it is )
// 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,
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) :
m_wipe_tower_pos(x, y),
m_wipe_tower_width(width),

View File

@ -195,7 +195,6 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|| opt_key == "spiral_vase"
|| opt_key == "temperature"
|| opt_key == "wipe_tower"
|| opt_key == "wipe_tower_advanced"
|| opt_key == "wipe_tower_x"
|| opt_key == "wipe_tower_y"
|| 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.cooling_tube_length.value), float(this->config.parking_pos_retraction.value),
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_zhop();

View File

@ -1773,12 +1773,24 @@ PrintConfigDef::PrintConfigDef()
def->cli = "wipe-tower!";
def->default_value = new ConfigOptionBool(false);
def = this->add("wipe_tower_advanced", coString);
def->label = L("Advanced string");
def->tooltip = L("Advanced tooltip ");
def->sidetext = L("advanced sidetext");
def->cli = "wipe-tower-advanced=s";
def->default_value = new ConfigOptionString("");
def = this->add("wiping_volumes_extruders", coFloats);
def->label = L("Extrusion multiplier");
def->tooltip = L("This vector saves required volumes to change from/to each tool used on the "
"wipe tower. These values are used to simplify creation of the full purging "
"volumes below. ");
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->label = L("Position X");

View File

@ -501,6 +501,7 @@ public:
ConfigOptionFloat cooling_tube_length;
ConfigOptionFloat parking_pos_retraction;
std::string get_extrusion_axis() const
{
return
@ -622,7 +623,6 @@ public:
ConfigOptionInt threads;
ConfigOptionBools wipe;
ConfigOptionBool wipe_tower;
ConfigOptionString wipe_tower_advanced;
ConfigOptionFloat wipe_tower_x;
ConfigOptionFloat wipe_tower_y;
ConfigOptionFloat wipe_tower_width;
@ -690,7 +690,6 @@ protected:
OPT_PTR(threads);
OPT_PTR(wipe);
OPT_PTR(wipe_tower);
OPT_PTR(wipe_tower_advanced);
OPT_PTR(wipe_tower_x);
OPT_PTR(wipe_tower_y);
OPT_PTR(wipe_tower_width);
@ -736,6 +735,7 @@ class FullPrintConfig :
public:
// Validate the FullPrintConfig. Returns an empty string on success, otherwise an error message is returned.
std::string validate();
protected:
// Protected constructor to be called to initialize ConfigCache::m_default.
FullPrintConfig(int) : PrintObjectConfig(0), PrintRegionConfig(0), PrintConfig(0), HostConfig(0) {}

View File

@ -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",
"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",
"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",
"compatible_printers", "compatible_printers_condition"

View File

@ -467,13 +467,12 @@ void TabPrint::build()
sizer->Add(m_wipe_tower_btn);
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;
WipingDialog dlg(this,init_data); // dlg lives on stack, no need to call Destroy
//auto init_data = (m_config->option<ConfigOptionFloats>("wiping_volumes_matrix"))->values;
//WipingDialog dlg(this,std::vector<float>(init_data.begin(), init_data.end())); // 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;
//load_key_value("wipe_tower_advanced", dlg.GetValue());
//std::cout << std::endl << "dialog returned: " << dlg.GetValue() << std::endl;
}
}));
return sizer;

View File

@ -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)
{
this->Centre();
Slic3r::WipeTowerParameters parameters(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);
m_panel_wiping = new WipingPanel(this,init_data);
this->Show();
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_BUTTON,[this](wxCommandEvent&) {
m_output_data=read_dialog_values();
//m_output_data=read_dialog_values();
EndModal(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)
{
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));
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);
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_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_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,data[2*i+1]));
}
wxPoint origin(515,55);
@ -176,7 +171,7 @@ WipingPanel::WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p)
if (i==j)
edit_boxes[i][j]->Disable();
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));
}

View File

@ -48,7 +48,7 @@ private:
class WipingPanel : public wxPanel {
public:
WipingPanel(wxWindow* parent,const Slic3r::WipeTowerParameters& p);
WipingPanel(wxWindow* parent,const std::vector<float>& data);
void fill_parameters(Slic3r::WipeTowerParameters& p);
private:
@ -66,15 +66,13 @@ private:
class WipingDialog : public wxDialog {
public:
WipingDialog(wxWindow* parent,const std::string& init_data);
std::string GetValue() const { return m_output_data; }
WipingDialog(wxWindow* parent,const std::vector<float>& init_data);
std::vector<float> get_value() const { return m_output_data; }
private:
std::string m_file_name="config_wipe_tower";
WipingPanel* m_panel_wiping = nullptr;
std::string m_output_data = "";
std::vector<float> m_output_data;
std::string read_dialog_values() {
Slic3r::WipeTowerParameters p;