Merge remote-tracking branch 'origin/ys_add_new_options' into ys_improvements
This commit is contained in:
commit
56c6193ff4
7 changed files with 71 additions and 5 deletions
|
@ -96,6 +96,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
||||||
"filament_density",
|
"filament_density",
|
||||||
"filament_notes",
|
"filament_notes",
|
||||||
"filament_cost",
|
"filament_cost",
|
||||||
|
"filament_spool_weight",
|
||||||
"first_layer_acceleration",
|
"first_layer_acceleration",
|
||||||
"first_layer_bed_temperature",
|
"first_layer_bed_temperature",
|
||||||
"first_layer_speed",
|
"first_layer_speed",
|
||||||
|
@ -161,6 +162,7 @@ bool Print::invalidate_state_by_config_options(const std::vector<t_config_option
|
||||||
} else if (
|
} else if (
|
||||||
opt_key == "skirts"
|
opt_key == "skirts"
|
||||||
|| opt_key == "skirt_height"
|
|| opt_key == "skirt_height"
|
||||||
|
|| opt_key == "infinit_skirt"
|
||||||
|| opt_key == "skirt_distance"
|
|| opt_key == "skirt_distance"
|
||||||
|| opt_key == "min_skirt_length"
|
|| opt_key == "min_skirt_length"
|
||||||
|| opt_key == "ooze_prevention"
|
|| opt_key == "ooze_prevention"
|
||||||
|
@ -1146,7 +1148,8 @@ Print::ApplyStatus Print::apply(const Model &model, DynamicPrintConfig new_full_
|
||||||
|
|
||||||
bool Print::has_infinite_skirt() const
|
bool Print::has_infinite_skirt() const
|
||||||
{
|
{
|
||||||
return (m_config.skirt_height == -1 && m_config.skirts > 0)
|
// return (m_config.skirt_height == -1 && m_config.skirts > 0)
|
||||||
|
return (m_config.infinit_skirt && m_config.skirts > 0)
|
||||||
|| (m_config.ooze_prevention && this->extruders().size() > 1);
|
|| (m_config.ooze_prevention && this->extruders().size() > 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -763,6 +763,13 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->min = 0;
|
def->min = 0;
|
||||||
def->set_default_value(new ConfigOptionFloats { 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 = this->add("filament_settings_id", coStrings);
|
||||||
def->set_default_value(new ConfigOptionStrings { "" });
|
def->set_default_value(new ConfigOptionStrings { "" });
|
||||||
def->cli = ConfigOptionDef::nocli;
|
def->cli = ConfigOptionDef::nocli;
|
||||||
|
@ -1691,6 +1698,12 @@ void PrintConfigDef::init_fff_params()
|
||||||
def->mode = comAdvanced;
|
def->mode = comAdvanced;
|
||||||
def->set_default_value(new ConfigOptionInt(1));
|
def->set_default_value(new ConfigOptionInt(1));
|
||||||
|
|
||||||
|
def = this->add("infinit_skirt", coBool);
|
||||||
|
def->label = L("Use unlimit skirt");
|
||||||
|
def->tooltip = L("If enabled, the skirt will be as tall as a highest printed object.");
|
||||||
|
def->mode = comAdvanced;
|
||||||
|
def->set_default_value(new ConfigOptionBool(false));
|
||||||
|
|
||||||
def = this->add("skirts", coInt);
|
def = this->add("skirts", coInt);
|
||||||
def->label = L("Loops (minimum)");
|
def->label = L("Loops (minimum)");
|
||||||
def->full_label = L("Skirt Loops");
|
def->full_label = L("Skirt Loops");
|
||||||
|
|
|
@ -617,6 +617,7 @@ public:
|
||||||
ConfigOptionStrings filament_type;
|
ConfigOptionStrings filament_type;
|
||||||
ConfigOptionBools filament_soluble;
|
ConfigOptionBools filament_soluble;
|
||||||
ConfigOptionFloats filament_cost;
|
ConfigOptionFloats filament_cost;
|
||||||
|
ConfigOptionFloats filament_spool_weight;
|
||||||
ConfigOptionFloats filament_max_volumetric_speed;
|
ConfigOptionFloats filament_max_volumetric_speed;
|
||||||
ConfigOptionFloats filament_loading_speed;
|
ConfigOptionFloats filament_loading_speed;
|
||||||
ConfigOptionFloats filament_loading_speed_start;
|
ConfigOptionFloats filament_loading_speed_start;
|
||||||
|
@ -690,6 +691,7 @@ protected:
|
||||||
OPT_PTR(filament_type);
|
OPT_PTR(filament_type);
|
||||||
OPT_PTR(filament_soluble);
|
OPT_PTR(filament_soluble);
|
||||||
OPT_PTR(filament_cost);
|
OPT_PTR(filament_cost);
|
||||||
|
OPT_PTR(filament_spool_weight);
|
||||||
OPT_PTR(filament_max_volumetric_speed);
|
OPT_PTR(filament_max_volumetric_speed);
|
||||||
OPT_PTR(filament_loading_speed);
|
OPT_PTR(filament_loading_speed);
|
||||||
OPT_PTR(filament_loading_speed_start);
|
OPT_PTR(filament_loading_speed_start);
|
||||||
|
@ -800,6 +802,7 @@ public:
|
||||||
ConfigOptionBools retract_layer_change;
|
ConfigOptionBools retract_layer_change;
|
||||||
ConfigOptionFloat skirt_distance;
|
ConfigOptionFloat skirt_distance;
|
||||||
ConfigOptionInt skirt_height;
|
ConfigOptionInt skirt_height;
|
||||||
|
ConfigOptionBool infinit_skirt;
|
||||||
ConfigOptionInt skirts;
|
ConfigOptionInt skirts;
|
||||||
ConfigOptionInts slowdown_below_layer_time;
|
ConfigOptionInts slowdown_below_layer_time;
|
||||||
ConfigOptionBool spiral_vase;
|
ConfigOptionBool spiral_vase;
|
||||||
|
@ -872,6 +875,7 @@ protected:
|
||||||
OPT_PTR(retract_layer_change);
|
OPT_PTR(retract_layer_change);
|
||||||
OPT_PTR(skirt_distance);
|
OPT_PTR(skirt_distance);
|
||||||
OPT_PTR(skirt_height);
|
OPT_PTR(skirt_height);
|
||||||
|
OPT_PTR(infinit_skirt);
|
||||||
OPT_PTR(skirts);
|
OPT_PTR(skirts);
|
||||||
OPT_PTR(slowdown_below_layer_time);
|
OPT_PTR(slowdown_below_layer_time);
|
||||||
OPT_PTR(spiral_vase);
|
OPT_PTR(spiral_vase);
|
||||||
|
|
|
@ -207,9 +207,11 @@ class SlicedInfo : public wxStaticBoxSizer
|
||||||
public:
|
public:
|
||||||
SlicedInfo(wxWindow *parent);
|
SlicedInfo(wxWindow *parent);
|
||||||
void SetTextAndShow(SlicedInfoIdx idx, const wxString& text, const wxString& new_label="");
|
void SetTextAndShow(SlicedInfoIdx idx, const wxString& text, const wxString& new_label="");
|
||||||
|
void SetNoteAndShow(const wxString& text);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::vector<std::pair<wxStaticText*, wxStaticText*>> info_vec;
|
std::vector<std::pair<wxStaticText*, wxStaticText*>> info_vec;
|
||||||
|
wxStaticText* m_notes {nullptr};
|
||||||
};
|
};
|
||||||
|
|
||||||
SlicedInfo::SlicedInfo(wxWindow *parent) :
|
SlicedInfo::SlicedInfo(wxWindow *parent) :
|
||||||
|
@ -241,6 +243,10 @@ SlicedInfo::SlicedInfo(wxWindow *parent) :
|
||||||
init_info_label(_(L("Number of tool changes")));
|
init_info_label(_(L("Number of tool changes")));
|
||||||
|
|
||||||
Add(grid_sizer, 0, wxEXPAND);
|
Add(grid_sizer, 0, wxEXPAND);
|
||||||
|
|
||||||
|
m_notes = new wxStaticText(parent, wxID_ANY, "N/A");
|
||||||
|
Add(m_notes, 0, wxEXPAND);
|
||||||
|
|
||||||
this->Show(false);
|
this->Show(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -255,6 +261,14 @@ void SlicedInfo::SetTextAndShow(SlicedInfoIdx idx, const wxString& text, const w
|
||||||
info_vec[idx].second->Show(show);
|
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) :
|
PresetComboBox::PresetComboBox(wxWindow *parent, Preset::Type preset_type) :
|
||||||
PresetBitmapComboBox(parent, wxSize(15 * wxGetApp().em_unit(), -1)),
|
PresetBitmapComboBox(parent, wxSize(15 * wxGetApp().em_unit(), -1)),
|
||||||
preset_type(preset_type),
|
preset_type(preset_type),
|
||||||
|
@ -1245,6 +1259,18 @@ void Sidebar::update_sliced_info_sizer()
|
||||||
p->sliced_info->SetTextAndShow(siFilament_mm3, wxString::Format("%.2f", ps.total_extruded_volume));
|
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));
|
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<const ConfigOptionFloats*>(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"));
|
new_label = _(L("Cost"));
|
||||||
if (is_wipe_tower)
|
if (is_wipe_tower)
|
||||||
new_label += from_u8((boost::format(":\n - %1%\n - %2%") % _utf8(L("objects")) % _utf8(L("wipe tower"))).str());
|
new_label += from_u8((boost::format(":\n - %1%\n - %2%") % _utf8(L("objects")) % _utf8(L("wipe tower"))).str());
|
||||||
|
|
|
@ -413,7 +413,7 @@ const std::vector<std::string>& Preset::print_options()
|
||||||
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed",
|
"perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed",
|
||||||
"top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed",
|
"top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed",
|
||||||
"bridge_speed", "gap_fill_speed", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
|
"bridge_speed", "gap_fill_speed", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration",
|
||||||
"bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height",
|
"bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "infinit_skirt",
|
||||||
"min_skirt_length", "brim_width", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers",
|
"min_skirt_length", "brim_width", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers",
|
||||||
"raft_layers", "support_material_pattern", "support_material_with_sheath", "support_material_spacing",
|
"raft_layers", "support_material_pattern", "support_material_with_sheath", "support_material_spacing",
|
||||||
"support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers",
|
"support_material_synchronize_layers", "support_material_angle", "support_material_interface_layers",
|
||||||
|
@ -435,7 +435,7 @@ const std::vector<std::string>& Preset::filament_options()
|
||||||
{
|
{
|
||||||
static std::vector<std::string> s_opts {
|
static std::vector<std::string> s_opts {
|
||||||
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed",
|
"filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed",
|
||||||
"extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time",
|
"extrusion_multiplier", "filament_density", "filament_cost", "filament_spool_weight", "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_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",
|
"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",
|
"temperature", "first_layer_temperature", "bed_temperature", "first_layer_bed_temperature", "fan_always_on", "cooling", "min_fan_speed",
|
||||||
|
|
|
@ -1100,6 +1100,12 @@ 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()
|
void TabPrint::build()
|
||||||
{
|
{
|
||||||
m_presets = &m_preset_bundle->prints;
|
m_presets = &m_preset_bundle->prints;
|
||||||
|
@ -1172,6 +1178,7 @@ void TabPrint::build()
|
||||||
optgroup->append_single_option_line("skirts");
|
optgroup->append_single_option_line("skirts");
|
||||||
optgroup->append_single_option_line("skirt_distance");
|
optgroup->append_single_option_line("skirt_distance");
|
||||||
optgroup->append_single_option_line("skirt_height");
|
optgroup->append_single_option_line("skirt_height");
|
||||||
|
optgroup->append_single_option_line("infinit_skirt");
|
||||||
optgroup->append_single_option_line("min_skirt_length");
|
optgroup->append_single_option_line("min_skirt_length");
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Brim")));
|
optgroup = page->new_optgroup(_(L("Brim")));
|
||||||
|
@ -1484,6 +1491,19 @@ void TabFilament::build()
|
||||||
optgroup->append_single_option_line("extrusion_multiplier");
|
optgroup->append_single_option_line("extrusion_multiplier");
|
||||||
optgroup->append_single_option_line("filament_density");
|
optgroup->append_single_option_line("filament_density");
|
||||||
optgroup->append_single_option_line("filament_cost");
|
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));
|
optgroup = page->new_optgroup(_(L("Temperature")) + wxString(" °C", wxConvUTF8));
|
||||||
Line line = { _(L("Extruder")), "" };
|
Line line = { _(L("Extruder")), "" };
|
||||||
|
@ -3567,8 +3587,7 @@ void TabSLAMaterial::build()
|
||||||
update_dirty();
|
update_dirty();
|
||||||
|
|
||||||
// Change of any from those options influences for an update of "Sliced Info"
|
// Change of any from those options influences for an update of "Sliced Info"
|
||||||
wxGetApp().sidebar().update_sliced_info_sizer();
|
update_sliced_info_on_plater();
|
||||||
wxGetApp().sidebar().Layout();
|
|
||||||
};
|
};
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Layers")));
|
optgroup = page->new_optgroup(_(L("Layers")));
|
||||||
|
|
|
@ -321,6 +321,7 @@ protected:
|
||||||
void build_preset_description_line(ConfigOptionsGroup* optgroup);
|
void build_preset_description_line(ConfigOptionsGroup* optgroup);
|
||||||
void update_preset_description_line();
|
void update_preset_description_line();
|
||||||
void update_frequently_changed_parameters();
|
void update_frequently_changed_parameters();
|
||||||
|
void update_sliced_info_on_plater();
|
||||||
void fill_icon_descriptions();
|
void fill_icon_descriptions();
|
||||||
void set_tooltips_text();
|
void set_tooltips_text();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue