milling settings (wip)

also created extruder settings ui file
This commit is contained in:
supermerill 2020-05-23 23:16:17 +02:00
parent dc34149402
commit 3404430ef7
13 changed files with 354 additions and 921 deletions

View File

@ -23,10 +23,11 @@ INT represent an integer
parameters that are inside [] are optionals parameters that are inside [] are optionals
each parameter is separated by ':' each parameter is separated by ':'
* Page: * Page:
page:STR:STR page[:idx]:STR:STR
* first STR is for the label and the second for the icon, with or without the .svg / .png * first STR is for the label and the second for the icon, with or without the .svg / .png
* idx : append the index of the page (for extruder ui) to the name
* Group: * Group:
group[:nolabel][:title_width$INT][:label_width$INT][:sidetext_width$INT][:EVENT]:STR group[:nolabel][:title_width$INT][:label_width$INT][:sidetext_width$INT][:EVENT][:id$INT][:idx]:STR
* EVENT can be extruders_count_event if the group contains extruders_count and is a printer tab ; silent_mode_event if the group contains silent_mode and is a printer tab ; material_density_event if the group contains material_density. * EVENT can be extruders_count_event if the group contains extruders_count and is a printer tab ; silent_mode_event if the group contains silent_mode and is a printer tab ; material_density_event if the group contains material_density.
* title_width$INT is used to set the size of the left column, where labels are draw. * title_width$INT is used to set the size of the left column, where labels are draw.
* label_width$INT is used to set the size of the labels on lines. * label_width$INT is used to set the size of the labels on lines.
@ -48,6 +49,7 @@ each parameter is separated by ':'
* width$INT: change the width of the field. Shouod work on most type of settings. * width$INT: change the width of the field. Shouod work on most type of settings.
* height$INT: change the height of the field. Don't works with every type of setting. * height$INT: change the height of the field. Don't works with every type of setting.
* id $INT : for setting only a single value of a setting array. * id $INT : for setting only a single value of a setting array.
* idx : for setting only a single value of a setting array, with the index of the page (for extruder ui page)
* recommended_thin_wall_thickness_description: create a text widget to explain recommended thin wall thickness (only in a fff print tab). * recommended_thin_wall_thickness_description: create a text widget to explain recommended thin wall thickness (only in a fff print tab).
* parent_preset_description: create a text widget to explain parent preset. * parent_preset_description: create a text widget to explain parent preset.
* cooling_description: create a text widget to explain cooling (only in a filament tab). * cooling_description: create a text widget to explain cooling (only in a filament tab).

View File

@ -0,0 +1,31 @@
page:idx:Extruder:funnel
group:Size
setting:idx:nozzle_diameter
update_nozzle_diameter
group:Layer height limits
setting:idx:min_layer_height
setting:idx:max_layer_height
group:Position (for multi-extruder printers)
setting:idx:extruder_offset
group:Retraction
setting:idx:retract_length
setting:idx:retract_lift
line:"Only lift Z"
setting:idx:retract_lift_above
setting:idx:retract_lift_below
setting:idx:retract_lift_not_last_layer
end_line
setting:idx:retract_speed
setting:idx:deretract_speed
setting:idx:retract_restart_extra
setting:idx:retract_before_travel
setting:idx:retract_layer_change
setting:idx:wipe
setting:idx:retract_before_wipe
setting:idx:wipe_extra_perimeter
group:Retraction when tool is disabled (advanced settings for multi-extruder setups)
setting:idx:retract_length_toolchange
setting:idx:retract_restart_extra_toolchange
group:Preview
reset_to_filament_color

View File

@ -0,0 +1,4 @@
page:idx:Milling:funnel
group:Size
setting:idx:milling_diameter

View File

@ -4,9 +4,10 @@ group:Size and coordinates
bed_shape bed_shape
setting:max_print_height setting:max_print_height
setting:z_offset setting:z_offset
group:extruders_count_event:Capabilities group:extruders_count_event:milling_count_event:Capabilities
extruders_count extruders_count
setting:single_extruder_multi_material setting:single_extruder_multi_material
milling_count
group:Print Host upload group:Print Host upload
printhost printhost
group:silent_mode_event:Firmware group:silent_mode_event:Firmware

View File

@ -290,11 +290,13 @@ class ConfigOptionVector : public ConfigOptionVectorBase
{ {
public: public:
ConfigOptionVector() {} ConfigOptionVector() {}
explicit ConfigOptionVector(size_t n, const T &value) : values(n, value) {} explicit ConfigOptionVector(const T& default_val) : default_value(default_val) {}
explicit ConfigOptionVector(size_t n, const T& value) : values(n, value) {}
explicit ConfigOptionVector(std::initializer_list<T> il) : values(std::move(il)) {} explicit ConfigOptionVector(std::initializer_list<T> il) : values(std::move(il)) {}
explicit ConfigOptionVector(const std::vector<T> &values) : values(values) {} explicit ConfigOptionVector(const std::vector<T> &values) : values(values) {}
explicit ConfigOptionVector(std::vector<T> &&values) : values(std::move(values)) {} explicit ConfigOptionVector(std::vector<T> &&values) : values(std::move(values)) {}
std::vector<T> values; std::vector<T> values;
T default_value;
void set(const ConfigOption *rhs) override void set(const ConfigOption *rhs) override
{ {
@ -350,8 +352,8 @@ public:
const T& get_at(size_t i) const const T& get_at(size_t i) const
{ {
assert(! this->values.empty()); //assert(! this->values.empty());
return (i < this->values.size()) ? this->values[i] : this->values.front(); return (i < this->values.size()) ? this->values[i] : (this->values.empty()? default_value : this->values.front());
} }
T& get_at(size_t i) { return const_cast<T&>(std::as_const(*this).get_at(i)); } T& get_at(size_t i) { return const_cast<T&>(std::as_const(*this).get_at(i)); }
@ -370,10 +372,13 @@ public:
else if (n > this->values.size()) { else if (n > this->values.size()) {
if (this->values.empty()) { if (this->values.empty()) {
if (opt_default == nullptr) if (opt_default == nullptr)
throw std::runtime_error("ConfigOptionVector::resize(): No default value provided."); this->values.resize(n, this->default_value);
if (opt_default->type() != this->type()) if (opt_default->type() != this->type())
throw std::runtime_error("ConfigOptionVector::resize(): Extending with an incompatible type."); throw std::runtime_error("ConfigOptionVector::resize(): Extending with an incompatible type.");
this->values.resize(n, static_cast<const ConfigOptionVector<T>*>(opt_default)->values.front()); if(static_cast<const ConfigOptionVector<T>*>(opt_default)->values.empty())
this->values.resize(n, this->default_value);
else
this->values.resize(n, static_cast<const ConfigOptionVector<T>*>(opt_default)->values.front());
} else { } else {
// Resize by duplicating the last value. // Resize by duplicating the last value.
this->values.resize(n, this->values./*back*/front()); this->values.resize(n, this->values./*back*/front());
@ -501,6 +506,7 @@ class ConfigOptionFloatsTempl : public ConfigOptionVector<double>
{ {
public: public:
ConfigOptionFloatsTempl() : ConfigOptionVector<double>() {} ConfigOptionFloatsTempl() : ConfigOptionVector<double>() {}
explicit ConfigOptionFloatsTempl(double default_value) : ConfigOptionVector<double>(default_value) {}
explicit ConfigOptionFloatsTempl(size_t n, double value) : ConfigOptionVector<double>(n, value) {} explicit ConfigOptionFloatsTempl(size_t n, double value) : ConfigOptionVector<double>(n, value) {}
explicit ConfigOptionFloatsTempl(std::initializer_list<double> il) : ConfigOptionVector<double>(std::move(il)) {} explicit ConfigOptionFloatsTempl(std::initializer_list<double> il) : ConfigOptionVector<double>(std::move(il)) {}
explicit ConfigOptionFloatsTempl(const std::vector<double> &vec) : ConfigOptionVector<double>(vec) {} explicit ConfigOptionFloatsTempl(const std::vector<double> &vec) : ConfigOptionVector<double>(vec) {}

View File

@ -295,10 +295,10 @@ void PrintConfigDef::init_fff_params()
def->full_label = L("Bridge overlap"); def->full_label = L("Bridge overlap");
def->sidetext = L("%"); def->sidetext = L("%");
def->category = OptionCategory::width; def->category = OptionCategory::width;
def->tooltip = L("Amount of overlap between lines of the bridge. If your bridge flow ratio is low, it may be useful to increaase this setting to let lines touch each other. Default to 100%. A value of 200% will create two times more lines."); def->tooltip = L("Amount of overlap between lines of the bridge. If want more space between line (or less), you can modify it. Default to 100%. A value of 50% will create two times less lines.");
def->min = 50; def->min = 50;
def->max = 200; def->max = 200;
def->mode = comAdvanced; def->mode = comExpert;
def->set_default_value(new ConfigOptionPercent(100)); def->set_default_value(new ConfigOptionPercent(100));
def = this->add("bridge_speed", coFloat); def = this->add("bridge_speed", coFloat);
@ -830,7 +830,7 @@ void PrintConfigDef::init_fff_params()
def->label = L("Extruder"); def->label = L("Extruder");
def->category = OptionCategory::extruders; def->category = OptionCategory::extruders;
def->tooltip = L("The extruder to use (unless more specific extruder settings are specified). " def->tooltip = L("The extruder to use (unless more specific extruder settings are specified). "
"This value overrides perimeter and infill extruders, but not the support extruders."); "This value overrides perimeter and infill extruders, but not the support extruders.");
def->min = 0; // 0 = inherit defaults def->min = 0; // 0 = inherit defaults
def->enum_labels.push_back("default"); // override label for item 0 def->enum_labels.push_back("default"); // override label for item 0
def->enum_labels.push_back("1"); def->enum_labels.push_back("1");
@ -1943,6 +1943,31 @@ void PrintConfigDef::init_fff_params()
def->set_default_value(new ConfigOptionFloat(0)); def->set_default_value(new ConfigOptionFloat(0));
#endif /* HAS_PRESSURE_EQUALIZER */ #endif /* HAS_PRESSURE_EQUALIZER */
def = this->add("milling_cutter", coInt);
def->gui_type = "i_enum_open";
def->label = L("Milling cutter");
def->category = OptionCategory::extruders;
def->tooltip = L("The milling cutter to use (unless more specific extruder settings are specified). ");
def->min = 0; // 0 = inherit defaults
def->enum_labels.push_back("default"); // override label for item 0
def->enum_labels.push_back("1");
def->enum_labels.push_back("2");
def->enum_labels.push_back("3");
def->enum_labels.push_back("4");
def->enum_labels.push_back("5");
def->enum_labels.push_back("6");
def->enum_labels.push_back("7");
def->enum_labels.push_back("8");
def->enum_labels.push_back("9");
def = this->add("milling_diameter", coFloats);
def->label = L("Milling diameter");
def->category = OptionCategory::extruders;
def->tooltip = L("This is the diameter of your cutting tool.");
def->sidetext = L("mm");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionFloats(2.14));
def = this->add("min_fan_speed", coInts); def = this->add("min_fan_speed", coInts);
def->label = L("Min"); def->label = L("Min");
def->full_label = ("Min fan speed"); def->full_label = ("Min fan speed");
@ -3460,6 +3485,9 @@ void PrintConfigDef::init_extruder_option_keys()
"wipe_extra_perimeter" "wipe_extra_perimeter"
}; };
assert(std::is_sorted(m_extruder_retract_keys.begin(), m_extruder_retract_keys.end())); assert(std::is_sorted(m_extruder_retract_keys.begin(), m_extruder_retract_keys.end()));
m_milling_option_keys = {
"milling_diameter",
};
} }
void PrintConfigDef::init_sla_params() void PrintConfigDef::init_sla_params()
@ -4219,11 +4247,11 @@ void DynamicPrintConfig::normalize()
void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders) void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders)
{ {
const auto &defaults = FullPrintConfig::defaults(); const auto& defaults = FullPrintConfig::defaults();
for (const std::string &key : print_config_def.extruder_option_keys()) { for (const std::string& key : print_config_def.extruder_option_keys()) {
if (key == "default_filament_profile") if (key == "default_filament_profile")
continue; continue;
auto *opt = this->option(key, false); auto* opt = this->option(key, false);
assert(opt != nullptr); assert(opt != nullptr);
assert(opt->is_vector()); assert(opt->is_vector());
if (opt != nullptr && opt->is_vector()) if (opt != nullptr && opt->is_vector())
@ -4231,6 +4259,18 @@ void DynamicPrintConfig::set_num_extruders(unsigned int num_extruders)
} }
} }
void DynamicPrintConfig::set_num_milling(unsigned int num_milling)
{
const auto& defaults = FullPrintConfig::defaults();
for (const std::string& key : print_config_def.milling_option_keys()) {
auto* opt = this->option(key, false);
assert(opt != nullptr);
assert(opt->is_vector());
if (opt != nullptr && opt->is_vector())
static_cast<ConfigOptionVectorBase*>(opt)->resize(num_milling, defaults.option(key));
}
}
std::string DynamicPrintConfig::validate() std::string DynamicPrintConfig::validate()
{ {
// Full print config is initialized from the defaults. // Full print config is initialized from the defaults.

View File

@ -274,6 +274,8 @@ public:
// The extruder retract keys could be overidden by the same values defined at the Filament level // The extruder retract keys could be overidden by the same values defined at the Filament level
// (then the key is further prefixed with the "filament_" prefix). // (then the key is further prefixed with the "filament_" prefix).
const std::vector<std::string>& extruder_retract_keys() const { return m_extruder_retract_keys; } const std::vector<std::string>& extruder_retract_keys() const { return m_extruder_retract_keys; }
// Array options growing with the number of milling cutters
const std::vector<std::string>& milling_option_keys() const { return m_milling_option_keys; }
private: private:
void init_common_params(); void init_common_params();
@ -283,6 +285,7 @@ private:
std::vector<std::string> m_extruder_option_keys; std::vector<std::string> m_extruder_option_keys;
std::vector<std::string> m_extruder_retract_keys; std::vector<std::string> m_extruder_retract_keys;
std::vector<std::string> m_milling_option_keys;
}; };
// The one and only global definition of SLic3r configuration options. // The one and only global definition of SLic3r configuration options.
@ -315,6 +318,8 @@ public:
void set_num_extruders(unsigned int num_extruders); void set_num_extruders(unsigned int num_extruders);
void set_num_milling(unsigned int num_milling);
// Validate the PrintConfig. Returns an empty string on success, otherwise an error message is returned. // Validate the PrintConfig. Returns an empty string on success, otherwise an error message is returned.
std::string validate(); std::string validate();
@ -1029,9 +1034,10 @@ public:
ConfigOptionFloat infill_acceleration; ConfigOptionFloat infill_acceleration;
ConfigOptionInts max_fan_speed; ConfigOptionInts max_fan_speed;
ConfigOptionFloats max_layer_height; ConfigOptionFloats max_layer_height;
ConfigOptionFloat max_print_height;
ConfigOptionFloats milling_diameter;
ConfigOptionInts min_fan_speed; ConfigOptionInts min_fan_speed;
ConfigOptionFloats min_layer_height; ConfigOptionFloats min_layer_height;
ConfigOptionFloat max_print_height;
ConfigOptionFloats min_print_speed; ConfigOptionFloats min_print_speed;
ConfigOptionFloat min_skirt_length; ConfigOptionFloat min_skirt_length;
ConfigOptionString notes; ConfigOptionString notes;
@ -1110,9 +1116,10 @@ protected:
OPT_PTR(infill_acceleration); OPT_PTR(infill_acceleration);
OPT_PTR(max_fan_speed); OPT_PTR(max_fan_speed);
OPT_PTR(max_layer_height); OPT_PTR(max_layer_height);
OPT_PTR(max_print_height);
OPT_PTR(milling_diameter);
OPT_PTR(min_fan_speed); OPT_PTR(min_fan_speed);
OPT_PTR(min_layer_height); OPT_PTR(min_layer_height);
OPT_PTR(max_print_height);
OPT_PTR(min_print_speed); OPT_PTR(min_print_speed);
OPT_PTR(min_skirt_length); OPT_PTR(min_skirt_length);
OPT_PTR(notes); OPT_PTR(notes);

View File

@ -767,13 +767,13 @@ void MainFrame::init_menubar()
{ {
append_menu_item(objectsMenu, wxID_ANY, _(L("Bed/Extruder levelling")), _(L("Create a test print to help you to level your printer bed.")), append_menu_item(objectsMenu, wxID_ANY, _(L("Bed/Extruder levelling")), _(L("Create a test print to help you to level your printer bed.")),
[this](wxCommandEvent&) { wxGetApp().bed_leveling_dialog(); }); [this](wxCommandEvent&) { wxGetApp().bed_leveling_dialog(); });
append_menu_item(objectsMenu, wxID_ANY, _(L("Flow tuning")), _(L("Create a test print to help you to set your filament extrusion multiplier.")), append_menu_item(objectsMenu, wxID_ANY, _(L("Flow calibration")), _(L("Create a test print to help you to set your filament extrusion multiplier.")),
[this](wxCommandEvent&) { wxGetApp().flow_ratio_dialog(); }); [this](wxCommandEvent&) { wxGetApp().flow_ratio_dialog(); });
append_menu_item(objectsMenu, wxID_ANY, _(L("Filament temperature tuning")), _(L("Create a test print to help you to set your filament temperature.")), append_menu_item(objectsMenu, wxID_ANY, _(L("Filament temperature calibration")), _(L("Create a test print to help you to set your filament temperature.")),
[this](wxCommandEvent&) { wxGetApp().filament_temperature_dialog(); }); [this](wxCommandEvent&) { wxGetApp().filament_temperature_dialog(); });
append_menu_item(objectsMenu, wxID_ANY, _(L("Bridge pattern tuning")), _(L("Create a test print to help you to set your bridge flow ratio.")), append_menu_item(objectsMenu, wxID_ANY, _(L("Bridge flow calibration")), _(L("Create a test print to help you to set your bridge flow ratio.")),
[this](wxCommandEvent&) { wxGetApp().bridge_tuning_dialog(); }); [this](wxCommandEvent&) { wxGetApp().bridge_tuning_dialog(); });
append_menu_item(objectsMenu, wxID_ANY, _(L("Ironing pattern tuning")), _(L("Create a test print to help you to set your over-bridge flow ratio and ironing pattern.")), append_menu_item(objectsMenu, wxID_ANY, _(L("Ironing pattern calibration")), _(L("Create a test print to help you to set your over-bridge flow ratio and ironing pattern.")),
[this](wxCommandEvent&) { wxGetApp().over_bridge_dialog(); }); [this](wxCommandEvent&) { wxGetApp().over_bridge_dialog(); });
} }
@ -1221,6 +1221,7 @@ void MainFrame::on_value_changed(wxCommandEvent& event)
m_plater->on_config_change(*tab->get_config()); // propagate config change events to the plater m_plater->on_config_change(*tab->get_config()); // propagate config change events to the plater
if (opt_key == "extruders_count") { if (opt_key == "extruders_count") {
auto value = event.GetInt(); auto value = event.GetInt();
//to update filaments gui
m_plater->on_extruders_change(value); m_plater->on_extruders_change(value);
} }
} }

View File

@ -462,6 +462,9 @@ void ConfigOptionsGroup::back_to_config_value(const DynamicPrintConfig& config,
if (opt_key == "extruders_count") { if (opt_key == "extruders_count") {
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter")); auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("nozzle_diameter"));
value = int(nozzle_diameter->values.size()); value = int(nozzle_diameter->values.size());
} else if (opt_key == "milling_count") {
auto *milling_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("milling_diameter"));
value = int(milling_diameter->values.size());
} }
else if (m_opt_map.find(opt_key) == m_opt_map.end() || else if (m_opt_map.find(opt_key) == m_opt_map.end() ||
// This option don't have corresponded field // This option don't have corresponded field

View File

@ -305,6 +305,10 @@ void Preset::normalize(DynamicPrintConfig &config)
static_cast<ConfigOptionStrings*>(opt)->values.resize(n, std::string()); static_cast<ConfigOptionStrings*>(opt)->values.resize(n, std::string());
} }
} }
auto *milling_diameter = dynamic_cast<const ConfigOptionFloats*>(config.option("milling_diameter"));
if (milling_diameter != nullptr)
// Loaded the FFF Printer settings. Verify, that all extruder dependent values have enough values.
config.set_num_milling((unsigned int)milling_diameter->values.size());
} }
std::string Preset::remove_invalid_keys(DynamicPrintConfig &config, const DynamicPrintConfig &default_config) std::string Preset::remove_invalid_keys(DynamicPrintConfig &config, const DynamicPrintConfig &default_config)
@ -385,6 +389,9 @@ bool is_compatible_with_printer(const PresetWithVendorProfile &preset, const Pre
const ConfigOption *opt = active_printer.preset.config.option("nozzle_diameter"); const ConfigOption *opt = active_printer.preset.config.option("nozzle_diameter");
if (opt) if (opt)
config.set_key_value("num_extruders", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size())); config.set_key_value("num_extruders", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size()));
opt = active_printer.preset.config.option("milling_diameter");
if (opt)
config.set_key_value("num_milling", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size()));
return is_compatible_with_printer(preset, active_printer, &config); return is_compatible_with_printer(preset, active_printer, &config);
} }
@ -591,6 +598,7 @@ const std::vector<std::string>& Preset::printer_options()
"fan_speedup_time" "fan_speedup_time"
}; };
s_opts.insert(s_opts.end(), Preset::nozzle_options().begin(), Preset::nozzle_options().end()); s_opts.insert(s_opts.end(), Preset::nozzle_options().begin(), Preset::nozzle_options().end());
s_opts.insert(s_opts.end(), Preset::milling_options().begin(), Preset::milling_options().end());
} }
return s_opts; return s_opts;
} }
@ -599,7 +607,12 @@ const std::vector<std::string>& Preset::printer_options()
// of the nozzle_diameter vector. // of the nozzle_diameter vector.
const std::vector<std::string>& Preset::nozzle_options() const std::vector<std::string>& Preset::nozzle_options()
{ {
return print_config_def.extruder_option_keys(); return print_config_def.extruder_option_keys();
}
const std::vector<std::string>& Preset::milling_options()
{
return print_config_def.milling_option_keys();
} }
const std::vector<std::string>& Preset::sla_print_options() const std::vector<std::string>& Preset::sla_print_options()
@ -1204,6 +1217,9 @@ size_t PresetCollection::update_compatible_internal(const PresetWithVendorProfil
const ConfigOption *opt = active_printer.preset.config.option("nozzle_diameter"); const ConfigOption *opt = active_printer.preset.config.option("nozzle_diameter");
if (opt) if (opt)
config.set_key_value("num_extruders", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size())); config.set_key_value("num_extruders", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size()));
opt = active_printer.preset.config.option("milling_diameter");
if (opt)
config.set_key_value("num_milling", new ConfigOptionInt((int)static_cast<const ConfigOptionFloats*>(opt)->values.size()));
bool some_compatible = false; bool some_compatible = false;
for (size_t idx_preset = m_num_default_presets; idx_preset < m_presets.size(); ++ idx_preset) { for (size_t idx_preset = m_num_default_presets; idx_preset < m_presets.size(); ++ idx_preset) {
bool selected = idx_preset == m_idx_selected; bool selected = idx_preset == m_idx_selected;
@ -1521,7 +1537,7 @@ void add_correct_opts_to_diff(const std::string &opt_key, t_config_option_keys&
for (int i = 0; i < opt_cur->values.size(); i++) for (int i = 0; i < opt_cur->values.size(); i++)
{ {
int init_id = i <= opt_init_max_id ? i : 0; int init_id = i <= opt_init_max_id ? i : 0;
if (opt_cur->values[i] != opt_init->values[init_id]) if (opt_init_max_id < 0 || opt_cur->values[i] != opt_init->values[init_id])
vec.emplace_back(opt_key + "#" + std::to_string(i)); vec.emplace_back(opt_key + "#" + std::to_string(i));
} }
} }

View File

@ -224,6 +224,9 @@ public:
// Resize the extruder specific fields, initialize them with the content of the 1st extruder. // Resize the extruder specific fields, initialize them with the content of the 1st extruder.
void set_num_extruders(unsigned int n) { this->config.set_num_extruders(n); } void set_num_extruders(unsigned int n) { this->config.set_num_extruders(n); }
// Resize the milling specific fields, initialize them with the content of the 1st extruder.
void set_num_milling(unsigned int n) { this->config.set_num_milling(n); }
// Sort lexicographically by a preset name. The preset name shall be unique across a single PresetCollection. // Sort lexicographically by a preset name. The preset name shall be unique across a single PresetCollection.
bool operator<(const Preset &other) const { return this->name < other.name; } bool operator<(const Preset &other) const { return this->name < other.name; }
@ -233,6 +236,7 @@ public:
static const std::vector<std::string>& printer_options(); static const std::vector<std::string>& printer_options();
// Nozzle options of the printer options. // Nozzle options of the printer options.
static const std::vector<std::string>& nozzle_options(); static const std::vector<std::string>& nozzle_options();
static const std::vector<std::string>& milling_options();
static const std::vector<std::string>& sla_printer_options(); static const std::vector<std::string>& sla_printer_options();
static const std::vector<std::string>& sla_material_options(); static const std::vector<std::string>& sla_material_options();

File diff suppressed because it is too large Load Diff

View File

@ -107,7 +107,6 @@ protected:
wxDECLARE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent); wxDECLARE_EVENT(EVT_TAB_VALUE_CHANGED, wxCommandEvent);
wxDECLARE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent); wxDECLARE_EVENT(EVT_TAB_PRESETS_CHANGED, SimpleEvent);
using PageShp = std::shared_ptr<Page>; using PageShp = std::shared_ptr<Page>;
class Tab: public wxPanel class Tab: public wxPanel
{ {
@ -324,7 +323,7 @@ protected:
void fill_icon_descriptions(); void fill_icon_descriptions();
void set_tooltips_text(); void set_tooltips_text();
bool create_pages(std::string setting_type_name); bool create_pages(std::string setting_type_name, int idx = -1);
ConfigManipulation m_config_manipulation; ConfigManipulation m_config_manipulation;
ConfigManipulation get_config_manipulation(); ConfigManipulation get_config_manipulation();
@ -397,6 +396,10 @@ public:
size_t m_extruders_count_old = 0; size_t m_extruders_count_old = 0;
size_t m_initial_extruders_count; size_t m_initial_extruders_count;
size_t m_sys_extruders_count; size_t m_sys_extruders_count;
size_t m_milling_count;
size_t m_milling_count_old = 0;
size_t m_initial_milling_count;
size_t m_sys_milling_count;
PrinterTechnology m_printer_technology = ptFFF; PrinterTechnology m_printer_technology = ptFFF;
@ -414,6 +417,7 @@ public:
void update_pages(); // update m_pages according to printer technology void update_pages(); // update m_pages according to printer technology
void update_serial_ports(); void update_serial_ports();
void extruders_count_changed(size_t extruders_count); void extruders_count_changed(size_t extruders_count);
void milling_count_changed(size_t extruders_count);
PageShp build_kinematics_page(); PageShp build_kinematics_page();
void build_unregular_pages(); void build_unregular_pages();
void on_preset_loaded() override; void on_preset_loaded() override;