From dc1ffe15a83a308234e1fb1e7de163e4ab43fb40 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sat, 14 Mar 2020 09:46:29 +0100 Subject: [PATCH] Revert "Added "Filament spool weight" option to filament options" This reverts commit 3d3e36ba8d22d3654fb6adb451dae9f0eb6cf818. The change is too risky just before the PrusaSlicer 2.2.0 final release and the feature may need a bit of polishing before release. --- src/libslic3r/Print.cpp | 1 - src/libslic3r/PrintConfig.cpp | 7 ------- src/libslic3r/PrintConfig.hpp | 2 -- src/slic3r/GUI/Plater.cpp | 26 -------------------------- src/slic3r/GUI/Preset.cpp | 2 +- src/slic3r/GUI/Tab.cpp | 22 ++-------------------- src/slic3r/GUI/Tab.hpp | 1 - 7 files changed, 3 insertions(+), 58 deletions(-) diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index effe6085e..b967e8aa2 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -96,7 +96,6 @@ bool Print::invalidate_state_by_config_options(const std::vectormin = 0; def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_spool_weight", coFloats); - def->label = L("Spool weight"); - def->tooltip = L("Enter your filament spool weight. This is only for statistical information."); - def->sidetext = L("g"); - def->min = 0; - def->set_default_value(new ConfigOptionFloats { 1000. }); - def = this->add("filament_settings_id", coStrings); def->set_default_value(new ConfigOptionStrings { "" }); def->cli = ConfigOptionDef::nocli; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 505db6b6e..ca509e37a 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -617,7 +617,6 @@ public: ConfigOptionStrings filament_type; ConfigOptionBools filament_soluble; ConfigOptionFloats filament_cost; - ConfigOptionFloats filament_spool_weight; ConfigOptionFloats filament_max_volumetric_speed; ConfigOptionFloats filament_loading_speed; ConfigOptionFloats filament_loading_speed_start; @@ -691,7 +690,6 @@ protected: OPT_PTR(filament_type); OPT_PTR(filament_soluble); OPT_PTR(filament_cost); - OPT_PTR(filament_spool_weight); OPT_PTR(filament_max_volumetric_speed); OPT_PTR(filament_loading_speed); OPT_PTR(filament_loading_speed_start); diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 36e9615ba..035aabf6e 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -207,11 +207,9 @@ class SlicedInfo : public wxStaticBoxSizer public: SlicedInfo(wxWindow *parent); void SetTextAndShow(SlicedInfoIdx idx, const wxString& text, const wxString& new_label=""); - void SetNoteAndShow(const wxString& text); private: std::vector> info_vec; - wxStaticText* m_notes {nullptr}; }; SlicedInfo::SlicedInfo(wxWindow *parent) : @@ -243,10 +241,6 @@ SlicedInfo::SlicedInfo(wxWindow *parent) : init_info_label(_(L("Number of tool changes"))); Add(grid_sizer, 0, wxEXPAND); - - m_notes = new wxStaticText(parent, wxID_ANY, "N/A"); - Add(m_notes, 0, wxEXPAND); - this->Show(false); } @@ -261,14 +255,6 @@ void SlicedInfo::SetTextAndShow(SlicedInfoIdx idx, const wxString& text, const w info_vec[idx].second->Show(show); } -void SlicedInfo::SetNoteAndShow(const wxString& text) -{ - const bool show = text != "N/A"; - if (show) - m_notes->SetLabelText(text); - m_notes->Show(show); -} - PresetComboBox::PresetComboBox(wxWindow *parent, Preset::Type preset_type) : PresetBitmapComboBox(parent, wxSize(15 * wxGetApp().em_unit(), -1)), preset_type(preset_type), @@ -1259,18 +1245,6 @@ void Sidebar::update_sliced_info_sizer() p->sliced_info->SetTextAndShow(siFilament_mm3, wxString::Format("%.2f", ps.total_extruded_volume)); p->sliced_info->SetTextAndShow(siFilament_g, ps.total_weight == 0.0 ? "N/A" : wxString::Format("%.2f", ps.total_weight)); - // Show a note information, if there is not enough filaments to complete a print - wxString note = "N/A"; - DynamicPrintConfig* cfg = wxGetApp().get_tab(Preset::TYPE_FILAMENT)->get_config(); - auto filament_spool_weights = dynamic_cast(cfg->option("filament_spool_weight"))->values; - if (ps.total_weight > 0.0 && !filament_spool_weights.empty() && filament_spool_weights[0] > 0.0 && - ps.total_weight > filament_spool_weights[0]) - note = "\n" + _(L("WARNING")) + ":\n " + - _(L("There is not enough filaments to complete a print")) + ".\n " + - from_u8((boost::format(_utf8(L("You only have %.2f g of the required %.2f g."))) % - filament_spool_weights[0] % ps.total_weight).str()); - p->sliced_info->SetNoteAndShow(note); - new_label = _(L("Cost")); if (is_wipe_tower) new_label += from_u8((boost::format(":\n - %1%\n - %2%") % _utf8(L("objects")) % _utf8(L("wipe tower"))).str()); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index aa6ac24fd..84bd9bd74 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -435,7 +435,7 @@ const std::vector& Preset::filament_options() { static std::vector s_opts { "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed", - "extrusion_multiplier", "filament_density", "filament_cost", "filament_spool_weight", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time", + "extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time", "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_minimal_purge_on_wipe_tower", "temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling", "min_fan_speed", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5e87c74a3..01b9b22ac 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1100,12 +1100,6 @@ void Tab::update_frequently_changed_parameters() } } -void Tab::update_sliced_info_on_plater() -{ - wxGetApp().sidebar().update_sliced_info_sizer(); - wxGetApp().sidebar().Layout(); -} - void TabPrint::build() { m_presets = &m_preset_bundle->prints; @@ -1491,19 +1485,6 @@ void TabFilament::build() optgroup->append_single_option_line("extrusion_multiplier"); optgroup->append_single_option_line("filament_density"); optgroup->append_single_option_line("filament_cost"); - optgroup->append_single_option_line("filament_spool_weight"); - - optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) - { - update_dirty(); - - if (opt_key== "filament_spool_weight") - // Change of this option only has an influence to an update of "Sliced Info" - update_sliced_info_on_plater(); - else - // update configuration for its check and to schedule a background process, if needed - update(); - }; optgroup = page->new_optgroup(_(L("Temperature")) + wxString(" °C", wxConvUTF8)); Line line = { _(L("Extruder")), "" }; @@ -3587,7 +3568,8 @@ void TabSLAMaterial::build() update_dirty(); // Change of any from those options influences for an update of "Sliced Info" - update_sliced_info_on_plater(); + wxGetApp().sidebar().update_sliced_info_sizer(); + wxGetApp().sidebar().Layout(); }; optgroup = page->new_optgroup(_(L("Layers"))); diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 8cb1f549c..e2b00dc40 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -321,7 +321,6 @@ protected: void build_preset_description_line(ConfigOptionsGroup* optgroup); void update_preset_description_line(); void update_frequently_changed_parameters(); - void update_sliced_info_on_plater(); void fill_icon_descriptions(); void set_tooltips_text();