Allow nozzle variants to specify different cooling parameters (#16007)

# Description

Include variant-aware validation, temperature and pressure controls,
named nozzle selection, and filament sidebar refresh.

## Support nozzle-specific filament cooling and tuning

Filament presets can require different cooling and tuning for Standard
and High Flow nozzle variants. This change makes part and auxiliary
cooling, pressure advance, temperature limits, and multitool ramming
settings follow the selected variant, with matching UI controls and
profile validation.

The Snapmaker U1 profiles in #15755 / Snorca illustrate why this
matters:

| Profile | Standard cooling | High Flow cooling |
|---|---|---|
| Snapmaker ABS | Part fan: 15–15% | Part fan: 10–60% |
| Snapmaker PETG HF, 0.4 mm | Part fan: 20–40% | Part fan: 30–60% |
| Snapmaker PETG-CF | Part fan: 0–20%; auxiliary: 0% | Part fan: 5–40%;
auxiliary: 20% |
| Snapmaker PLA Matte | Auxiliary: 80% | Auxiliary: 100% |

These differences need to survive variant selection, editing, and
slicing. Shared single values continue to apply across variants, and
short filament arrays fall back to element zero, matching the loader.

### Additional changes

- Preserve named nozzle selections when refreshing the diameter
selector.
- Enable or disable the pressure-advance input for the selected variant.
- Initialize profile-validation slicing with the printer’s declared
nozzle volume type.
- Refresh filament controls after preset loading.

Profile changes remain separate in `u1-hf`.

### Validation

- All 13 focused variant-tool tests passed.
- Broader checks encountered an existing Windows path-separator
assertion failure, reproduced with upstream code.
- C++ build and GUI validation have not been run.

[How to Download Pull Requests Artifacts for
Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)
This commit is contained in:
SoftFever
2026-10-01 13:53:22 +08:00
committed by GitHub
796 changed files with 2389 additions and 110 deletions
@@ -308,12 +308,18 @@ DynamicPrintConfig slice_config(PresetBundle &bundle)
// type (Direct Drive + Bowden) the mismatched lookup spams [error] lines. Single-nozzle and non-BBL
// printers keep the default map (their toolchange rides the AMS/tool-changer path unchanged).
const bool pin_filament_map = bundle.is_bbl_vendor() && nozzles > 1;
auto &fmap = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
if (pin_filament_map) {
auto &fmap = bundle.project_config.option<ConfigOptionInts>("filament_map", true)->values;
for (size_t i = 0; i < fmap.size(); ++i)
fmap[i] = int(i % nozzles) + 1;
}
// A fresh printer selection uses its declared nozzle volumes, just like the
// app. Otherwise a high-flow preset is silently sliced with Standard tuning.
bundle.reset_default_nozzle_volume_type();
bundle.project_config.option<ConfigOptionInts>("filament_volume_map", true)->values =
bundle.get_default_nozzle_volume_types_for_filaments(fmap);
DynamicPrintConfig cfg = bundle.full_config();
cfg.set_key_value("enable_prime_tower", new ConfigOptionBool(true)); // force a purge tower so the change is detectable
// The map above drives full_config()'s per-filament variant collapse; fmmManual on the sliced config
+27 -8
View File
@@ -1258,7 +1258,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
config.set_key_value("old_filament_temp", new ConfigOptionInt(old_filament_temp));
int interface_temp = full_config.filament_tower_interface_print_temp.get_at(new_filament_id);
if (interface_temp == -1)
interface_temp = full_config.nozzle_temperature_range_high.get_at(new_filament_id);
interface_temp = full_config.nozzle_temperature_range_high.get_at(new_fi);
if (full_config.enable_tower_interface_features && tcr.is_contact)
new_filament_temp = interface_temp;
config.set_key_value("new_filament_temp", new ConfigOptionInt(new_filament_temp));
@@ -1309,7 +1309,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
flush_temps[idx] = use_fast_flush ? m_print_config->filament_flush_temp_fast.get_at(fi)
: m_print_config->filament_flush_temp.get_at(fi);
if (flush_temps[idx] == 0)
flush_temps[idx] = m_print_config->nozzle_temperature_range_high.get_at(idx);
flush_temps[idx] = m_print_config->nozzle_temperature_range_high.get_at(fi);
filament_cooling_before_tower[idx] = m_print_config->filament_cooling_before_tower.get_at(fi);
}
if (tcr.is_contact || gcodegen.m_layer_index == 0)
@@ -1563,7 +1563,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
const bool will_go_down = !is_approx(z, current_z);
const bool is_ramming = (gcodegen.config().single_extruder_multi_material) ||
(!gcodegen.config().single_extruder_multi_material &&
gcodegen.config().filament_multitool_ramming.get_at(tcr.initial_tool));
gcodegen.config().filament_multitool_ramming.get_at(gcodegen.get_filament_config_index(tcr.initial_tool)));
// Orca: user-facing override (Printer Settings > Wipe tower > "Tool change on wipe tower").
// Forces the toolhead to travel over the wipe tower before issuing Tx even on multi-toolhead
// printers without ramming, where Orca would otherwise emit Tx in place (potentially over the part).
@@ -1620,7 +1620,7 @@ static std::vector<Vec2d> get_path_of_change_filament(const Print& print)
if (gcodegen.config().enable_tower_interface_features && tcr.is_contact) {
interface_temp = gcodegen.config().filament_tower_interface_print_temp.get_at(new_extruder_id);
if (interface_temp == -1)
interface_temp = gcodegen.config().nozzle_temperature_range_high.get_at(new_extruder_id);
interface_temp = gcodegen.config().nozzle_temperature_range_high.get_at(gcodegen.get_filament_config_index(new_extruder_id));
toolchange_temp_override = interface_temp;
}
toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z, false, toolchange_temp_override,
@@ -4342,6 +4342,12 @@ size_t GCode::get_filament_config_index(int filament_id) const
return filament_id;
}
size_t GCode::get_filament_config_index(int filament_id, size_t layer_id) const
{
// Orca: uncached, as the stages after the generator run concurrently with it.
return m_print ? m_print->get_filament_config_indx(filament_id, (int) layer_id, false) : filament_id;
}
size_t GCode::get_nozzle_config_index(int filament_id) const
{
if (m_print) {
@@ -9409,10 +9415,13 @@ void GCode::update_placeholder_parser_with_variant_params()
// Helper: remap config arrays from variant index space to filament_id index space.
// After remapping, gcode templates can use param[filament_id] directly.
std::vector<size_t> config_index(num_filaments);
for (size_t i = 0; i < num_filaments; ++i)
config_index[i] = get_filament_config_index(i);
auto remap_by_filament = [&](const auto &src) {
std::decay_t<decltype(src.values)> dst(num_filaments);
for (size_t i = 0; i < num_filaments; ++i)
dst[i] = src.get_at(get_filament_config_index(i));
dst[i] = src.get_at(config_index[i]);
return dst;
};
@@ -9427,6 +9436,16 @@ void GCode::update_placeholder_parser_with_variant_params()
this->placeholder_parser().set("first_layer_temperature", new ConfigOptionInts(remap_by_filament(m_config.nozzle_temperature_initial_layer)));
this->placeholder_parser().set("pressure_advance", new ConfigOptionFloats(remap_by_filament(m_config.pressure_advance)));
this->placeholder_parser().set("enable_pressure_advance", new ConfigOptionBools(remap_by_filament(m_config.enable_pressure_advance)));
this->placeholder_parser().set("fan_min_speed", new ConfigOptionFloats(remap_by_filament(m_config.fan_min_speed)));
this->placeholder_parser().set("fan_max_speed", new ConfigOptionFloats(remap_by_filament(m_config.fan_max_speed)));
this->placeholder_parser().set("additional_cooling_fan_speed", new ConfigOptionInts(remap_by_filament(m_config.additional_cooling_fan_speed)));
this->placeholder_parser().set("filament_minimal_purge_on_wipe_tower", new ConfigOptionFloats(remap_by_filament(m_config.filament_minimal_purge_on_wipe_tower)));
this->placeholder_parser().set("filament_multitool_ramming", new ConfigOptionBools(remap_by_filament(m_config.filament_multitool_ramming)));
this->placeholder_parser().set("filament_multitool_ramming_volume", new ConfigOptionFloats(remap_by_filament(m_config.filament_multitool_ramming_volume)));
this->placeholder_parser().set("filament_multitool_ramming_flow", new ConfigOptionFloats(remap_by_filament(m_config.filament_multitool_ramming_flow)));
this->placeholder_parser().set("nozzle_temperature_range_low", new ConfigOptionInts(remap_by_filament(m_config.nozzle_temperature_range_low)));
const auto nozzle_temperature_range_high = remap_by_filament(m_config.nozzle_temperature_range_high);
this->placeholder_parser().set("nozzle_temperature_range_high", new ConfigOptionInts(nozzle_temperature_range_high));
// --- printer_options_with_variant_1: in m_config these are already merged as filament-indexed ---
this->placeholder_parser().set("retraction_distances_when_cut", new ConfigOptionFloats(remap_by_filament(m_config.retraction_distances_when_cut)));
@@ -9447,7 +9466,7 @@ void GCode::update_placeholder_parser_with_variant_params()
if (flush_v_speed[i] == 0)
flush_v_speed[i] = filament_max_v[i];
if (flush_temps[i] == 0)
flush_temps[i] = m_config.nozzle_temperature_range_high.get_at(i);
flush_temps[i] = nozzle_temperature_range_high[i];
}
this->placeholder_parser().set("flush_volumetric_speeds", new ConfigOptionFloats(flush_v_speed));
this->placeholder_parser().set("flush_temperatures", new ConfigOptionInts(flush_temps));
@@ -9706,7 +9725,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo
{
int interface_temp = m_config.filament_tower_interface_print_temp.get_at(new_filament_id);
if (interface_temp == -1)
interface_temp = m_config.nozzle_temperature_range_high.get_at(new_filament_id);
interface_temp = m_config.nozzle_temperature_range_high.get_at(new_fi);
dyn_config.set_key_value("filament_tower_interface_print_temp", new ConfigOptionInt(interface_temp));
}
if (toolchange_temp_override > 0) {
@@ -9745,7 +9764,7 @@ std::string GCode::set_extruder(unsigned int new_filament_id, double print_z, bo
flush_temps[idx] = use_fast_flush ? m_print->config().filament_flush_temp_fast.get_at(fi)
: m_print->config().filament_flush_temp.get_at(fi);
if (flush_temps[idx] == 0)
flush_temps[idx] = m_print->config().nozzle_temperature_range_high.get_at(idx);
flush_temps[idx] = m_print->config().nozzle_temperature_range_high.get_at(fi);
filament_cooling_before_tower[idx] = m_print->config().filament_cooling_before_tower.get_at(fi);
}
std::fill(filament_cooling_before_tower.begin(), filament_cooling_before_tower.end(), 0);
+3
View File
@@ -296,6 +296,9 @@ public:
// resolver keys filament-indexed arrays, the nozzle resolver keys (extruder x volume-type)
// slot arrays. Both degenerate to filament_id / extruder index on single-volume printers.
size_t get_filament_config_index(int filament_id) const;
// The filament resolver for a given layer, for the export pipeline stages after the generator,
// which run behind the current layer and concurrently with the generator.
size_t get_filament_config_index(int filament_id, size_t layer_id) const;
size_t get_nozzle_config_index(int filament_id) const;
// Object and support extrusions of the same PrintObject at the same print_z.
+6 -4
View File
@@ -18,7 +18,7 @@
namespace Slic3r {
CoolingBuffer::CoolingBuffer(GCode &gcodegen) : m_config(gcodegen.config()), m_toolchange_prefix(gcodegen.writer().toolchange_prefix()), m_current_extruder(0), m_current_nozzle(0)
CoolingBuffer::CoolingBuffer(GCode &gcodegen) : m_config(gcodegen.config()), m_gcodegen(gcodegen), m_toolchange_prefix(gcodegen.writer().toolchange_prefix()), m_current_extruder(0), m_current_nozzle(0)
{
this->reset(gcodegen.writer().get_position());
@@ -737,10 +737,12 @@ std::string CoolingBuffer::apply_layer_cooldown(
&ironing_fan_control, &ironing_fan_speed
](bool immediately_apply) {
#define EXTRUDER_CONFIG(OPT) m_config.OPT.get_at(m_current_extruder)
float fan_min_speed = EXTRUDER_CONFIG(fan_min_speed);
// The per-variant options take the extruder variant the filament prints with on this layer
const size_t config_index = m_gcodegen.get_filament_config_index(m_current_extruder, layer_id);
float fan_min_speed = m_config.fan_min_speed.get_at(config_index);
float fan_speed_new = EXTRUDER_CONFIG(reduce_fan_stop_start_freq) ? fan_min_speed : 0;
//BBS
int additional_fan_speed_new = EXTRUDER_CONFIG(additional_cooling_fan_speed);
int additional_fan_speed_new = m_config.additional_cooling_fan_speed.get_at(config_index);
int close_fan_the_first_x_layers = EXTRUDER_CONFIG(close_fan_the_first_x_layers);
// Is the fan speed ramp enabled?
int full_fan_speed_layer = EXTRUDER_CONFIG(full_fan_speed_layer);
@@ -776,7 +778,7 @@ std::string CoolingBuffer::apply_layer_cooldown(
// additional_fan_speed_new is left at its configured value (auxiliary fan is independent of the
// part-cooling override).
} else if (int(layer_id) >= close_fan_the_first_x_layers) {
float fan_max_speed = EXTRUDER_CONFIG(fan_max_speed);
float fan_max_speed = m_config.fan_max_speed.get_at(config_index);
float slow_down_layer_time = float(EXTRUDER_CONFIG(slow_down_layer_time));
float fan_cooling_layer_time = float(EXTRUDER_CONFIG(fan_cooling_layer_time));
//BBS: always enable the fan speed interpolation according to layer time
+2
View File
@@ -54,6 +54,8 @@ private:
// Referencs GCode::m_config, which is FullPrintConfig. While the PrintObjectConfig slice of FullPrintConfig is being modified,
// the PrintConfig slice of FullPrintConfig is constant, thus no thread synchronization is required.
const PrintConfig &m_config;
// Resolves the filament config index of the per-variant options.
const GCode &m_gcodegen;
unsigned int m_current_extruder;
unsigned int m_current_nozzle;
//BBS: current fan speed
+14 -8
View File
@@ -1230,15 +1230,21 @@ void ToolOrdering::cal_most_used_extruder(const PrintConfig &config)
float ToolOrdering::cal_max_additional_fan(const PrintConfig &config)
{
// record
std::set<unsigned int> used_filaments;
for (const LayerTools &layer_tools : m_layer_tools)
used_filaments.insert(layer_tools.extruders.begin(), layer_tools.extruders.end());
if (used_filaments.empty())
return 0;
// Orca: additional_cooling_fan_speed can hold one value per extruder variant a filament prints with;
// filament_self_index maps such a column to its filament.
const std::vector<int> &self_index = config.filament_self_index.values;
const size_t columns = std::max(config.additional_cooling_fan_speed.size(), size_t(*used_filaments.rbegin()) + 1);
float max_fan = 0;
for (LayerTools &layer_tools : m_layer_tools) {
std::vector<unsigned int> filaments = layer_tools.extruders;
std::set<int> layer_extruder_count;
// count once only
for (unsigned int &filament : filaments)
if (max_fan < config.additional_cooling_fan_speed.get_at(filament))
max_fan = config.additional_cooling_fan_speed.get_at(filament);
for (size_t column = 0; column < columns; ++column) {
const unsigned int filament_id = self_index.size() == columns ? self_index[column] - 1 : column;
if (used_filaments.count(filament_id) && max_fan < config.additional_cooling_fan_speed.get_at(column))
max_fan = config.additional_cooling_fan_speed.get_at(column);
}
return max_fan;
}
+14 -3
View File
@@ -4452,8 +4452,17 @@ std::vector<Preset *> PresetBundle::get_filament_presets_for_machine(const std::
return compatible;
}
int PresetBundle::get_filament_variant_index(const DynamicPrintConfig &filament_config, const DynamicPrintConfig &printer_config,
int extruder_id, NozzleVolumeType nozzle_volume_type)
{
const auto *extruder_types = printer_config.option<ConfigOptionEnumsGeneric>("extruder_type");
const ExtruderType extruder_type = extruder_types && !extruder_types->empty() ? ExtruderType(extruder_types->get_at(extruder_id)) : etDirectDrive;
return std::max(0, filament_config.get_index_for_extruder(1, "", extruder_type, nozzle_volume_type, "filament_extruder_variant"));
}
bool PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(
const std::string &printer_type, std::string& nozzle_diameter_str, std::string &setting_id, std::string &tag_uid, std::string &nozzle_temp_min, std::string &nozzle_temp_max, std::string& preset_setting_id)
const std::string &printer_type, std::string& nozzle_diameter_str, std::string &setting_id, std::string &tag_uid, std::string &nozzle_temp_min, std::string &nozzle_temp_max, std::string& preset_setting_id,
int extruder_id, NozzleVolumeType nozzle_volume_type)
{
bool is_equation = true;
@@ -4476,13 +4485,15 @@ bool PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_m
// Compare only once
if (!compared) {
compared = true;
const Preset *printer = printers.find_preset(printer_str);
const int variant_index = printer ? get_filament_variant_index(preset->config, printer->config, extruder_id, nozzle_volume_type) : 0;
bool min_temp_equation = false, max_temp_equation = false;
int min_nozzle_temp = std::stoi(nozzle_temp_min);
int max_nozzle_temp = std::stoi(nozzle_temp_max);
ConfigOption *opt_min = const_cast<Preset *>(preset)->config.option("nozzle_temperature_range_low");
if (opt_min) {
ConfigOptionInts *opt_min_ints = dynamic_cast<ConfigOptionInts *>(opt_min);
min_nozzle_temp = opt_min_ints->get_at(0);
min_nozzle_temp = opt_min_ints->get_at(variant_index);
if (std::to_string(min_nozzle_temp) == nozzle_temp_min)
min_temp_equation = true;
else {
@@ -4493,7 +4504,7 @@ bool PresetBundle::check_filament_temp_equation_by_printer_type_and_nozzle_for_m
ConfigOption *opt_max = const_cast<Preset *>(preset)->config.option("nozzle_temperature_range_high");
if (opt_max) {
ConfigOptionInts *opt_max_ints = dynamic_cast<ConfigOptionInts *>(opt_max);
max_nozzle_temp = opt_max_ints->get_at(0);
max_nozzle_temp = opt_max_ints->get_at(variant_index);
if (std::to_string(max_nozzle_temp) == nozzle_temp_max)
max_temp_equation = true;
else {
+10 -1
View File
@@ -407,13 +407,22 @@ public:
std::vector<Preset *> get_filament_presets_for_machine(const std::string &printer_type,
const std::string &nozzle_diameter_str,
bool include_user_presets);
// Orca: the variant index of a filament preset's per-variant options on extruder extruder_id of a printer
// preset, with the nozzle volume type the machine reports; 0 when the filament has no such variant.
static int get_filament_variant_index(const DynamicPrintConfig &filament_config,
const DynamicPrintConfig &printer_config,
int extruder_id,
NozzleVolumeType nozzle_volume_type);
// extruder_id and nozzle_volume_type identify the tray's nozzle, whose variant the temperature range is compared for.
bool check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(const std::string &printer_type,
std::string & nozzle_diameter_str,
std::string & setting_id,
std::string & tag_uid,
std::string & nozzle_temp_min,
std::string & nozzle_temp_max,
std::string & preset_setting_id);
std::string & preset_setting_id,
int extruder_id,
NozzleVolumeType nozzle_volume_type);
Preset * get_similar_printer_preset(std::string printer_model, std::string printer_variant);
PresetCollection prints;
+11 -8
View File
@@ -4329,9 +4329,9 @@ bool Print::is_dynamic_group_reorder() const
return true;
}
int Print::get_filament_config_indx(int filament_id, int layer_id)
int Print::get_filament_config_indx(int filament_id, int layer_id, bool use_cache)
{
return get_config_index(filament_id, layer_id, m_config.filament_extruder_variant.values, m_filament_self_index, m_filament_index_map);
return get_config_index(filament_id, layer_id, m_config.filament_extruder_variant.values, m_filament_self_index, use_cache ? &m_filament_index_map : nullptr);
}
void Print::update_filament_self_index_cache()
@@ -4374,7 +4374,7 @@ int Print::get_nozzle_config_index(int filament_id, int layer_id)
return get_config_index(filament_id, layer_id, m_default_region_config.print_extruder_variant.values, m_default_region_config.print_extruder_id.values, m_nozzle_index_map);
}
int Print::get_config_index(int filament_id, int layer_id, const std::vector<std::string> &variant_list, const std::vector<int>& self_index_list, FilamentIndexMap &index_map)
int Print::get_config_index(int filament_id, int layer_id, const std::vector<std::string> &variant_list, const std::vector<int>& self_index_list, FilamentIndexMap *index_map)
{
auto group_result = get_layered_nozzle_group_result();
// Orca: defensive — when no grouping producer has published a result yet, fall back to the
@@ -4385,7 +4385,8 @@ int Print::get_config_index(int filament_id, int layer_id, const std::vector<std
if (!nozzle_info.has_value()) {
// Orca: this fallback runs per-filament/per-layer in the g-code hot path — log once per filament
// (reset each slice) instead of flooding thousands of identical lines that bury the real error.
if (m_missing_nozzle_group_logged.insert(filament_id).second)
// Without the cache, the log set is left alone too; the cached caller reports the same filament.
if (index_map && m_missing_nozzle_group_logged.insert(filament_id).second)
BOOST_LOG_TRIVIAL(error) << __FUNCTION__
<< boost::format(", Line %1%: could not found group_nozzle_info corresponding to filament_id %2%, layer_id %3% (further occurrences for this filament suppressed)") % __LINE__ % filament_id %
layer_id;
@@ -4394,15 +4395,17 @@ int Print::get_config_index(int filament_id, int layer_id, const std::vector<std
ExtruderType extruder_type = ExtruderType(m_config.extruder_type.get_at(nozzle_info->extruder_id));
NozzleVolumeType nozzle_volume_type = nozzle_info->volume_type;
if (!index_map)
return get_config_index_base(nozzle_volume_type, extruder_type, filament_id + 1, variant_list, self_index_list);
FilamentIndexKey key{filament_id, extruder_type, nozzle_volume_type};
auto iter = index_map.find(key);
if (iter == index_map.end()) {
auto iter = index_map->find(key);
if (iter == index_map->end()) {
int index = get_config_index_base(nozzle_volume_type, extruder_type, filament_id + 1, variant_list, self_index_list);
index_map[key] = index;
(*index_map)[key] = index;
return index;
} else {
return index_map[key];
return iter->second;
}
}
+4 -2
View File
@@ -1222,7 +1222,9 @@ public:
// Post-slicing config-slot resolvers: map a (filament, layer) pair to the index of its
// per-(extruder x volume type) column in the expanded variant arrays, cached by grouping context.
int get_filament_config_indx(int filament_id, int layer_id);
// Orca: without use_cache, the filament resolver leaves the cache alone, for the G-code export
// pipeline's cooling stage, which runs concurrently with the generator stage filling it.
int get_filament_config_indx(int filament_id, int layer_id, bool use_cache = true);
int get_nozzle_config_index(int filament_id, int layer_id);
// Orca: Implement prusa's filament shrink compensation approach
@@ -1282,7 +1284,7 @@ protected:
};
using FilamentIndexMap = std::unordered_map<FilamentIndexKey, int, FilamentIndexKeyHash>;
using PrintIndexMap = std::unordered_map<PrintIndexKey, int, PrintIndexKeyHash>;
int get_config_index(int filament_id, int layer_id, const std::vector<std::string> &variant_list, const std::vector<int>& self_index_list, FilamentIndexMap &index_map);
int get_config_index(int filament_id, int layer_id, const std::vector<std::string> &variant_list, const std::vector<int>& self_index_list, FilamentIndexMap *index_map);
int get_config_index(int filament_id, int layer_id, const std::vector<std::string> &variant_list, const std::vector<int>& self_index_list, PrintIndexMap &index_map);
// Invalidates the step, and its depending steps in Print.
+10
View File
@@ -9516,6 +9516,16 @@ std::set<std::string> filament_options_with_variant = {
"adaptive_pressure_advance_model",
"adaptive_pressure_advance_overhangs",
"adaptive_pressure_advance_bridges",
// Orca: cooling fans, multi-tool ramming and recommended nozzle temperature range
"fan_min_speed",
"fan_max_speed",
"additional_cooling_fan_speed",
"filament_minimal_purge_on_wipe_tower",
"filament_multitool_ramming",
"filament_multitool_ramming_volume",
"filament_multitool_ramming_flow",
"nozzle_temperature_range_low",
"nozzle_temperature_range_high",
"activate_air_filtration",
"activate_air_filtration_during_print",
"activate_air_filtration_on_completion",
+21 -4
View File
@@ -1000,11 +1000,12 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
// update if nozzle_temperature_range is found
const int variant_index = get_filament_variant_index(*filament_it, nozzle_diameter_str);
ConfigOption *opt_min = filament_it->config.option("nozzle_temperature_range_low");
if (opt_min) {
ConfigOptionInts *opt_min_ints = dynamic_cast<ConfigOptionInts *>(opt_min);
if (opt_min_ints) {
wxString text_nozzle_temp_min = wxString::Format("%d", opt_min_ints->get_at(0));
wxString text_nozzle_temp_min = wxString::Format("%d", opt_min_ints->get_at(variant_index));
m_input_nozzle_min->GetTextCtrl()->SetValue(text_nozzle_temp_min);
}
}
@@ -1012,7 +1013,7 @@ void AMSMaterialsSetting::Popup(wxString filament, wxString sn, wxString temp_mi
if (opt_max) {
ConfigOptionInts *opt_max_ints = dynamic_cast<ConfigOptionInts *>(opt_max);
if (opt_max_ints) {
wxString text_nozzle_temp_max = wxString::Format("%d", opt_max_ints->get_at(0));
wxString text_nozzle_temp_max = wxString::Format("%d", opt_max_ints->get_at(variant_index));
m_input_nozzle_max->GetTextCtrl()->SetValue(text_nozzle_temp_max);
}
}
@@ -1218,6 +1219,21 @@ void AMSMaterialsSetting::on_select_cali_result(wxCommandEvent &evt)
}
}
int AMSMaterialsSetting::get_filament_variant_index(const Preset &filament, const std::string &nozzle_diameter_str)
{
PresetBundle *preset_bundle = wxGetApp().preset_bundle;
if (!obj || !preset_bundle)
return 0;
const std::set<std::string> printer_names =
preset_bundle->get_printer_names_by_printer_type_and_nozzle(DevPrinterConfigUtil::get_printer_display_name(obj->printer_type), nozzle_diameter_str);
const Preset *printer = printer_names.empty() ? nullptr : preset_bundle->printers.find_preset(*printer_names.begin());
if (!printer)
return 0;
const int extruder_id = obj->get_extruder_id_by_ams_id(std::to_string(ams_id));
return PresetBundle::get_filament_variant_index(filament.config, printer->config, obj->get_preset_extruder_index(extruder_id),
DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(extruder_id)));
}
void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
{
// Get the flag whether to open the filament setting dialog from the device page
@@ -1249,11 +1265,12 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
if (it->filament_id != filament_id)
continue;
// ) if nozzle_temperature_range is found
const int variant_index = get_filament_variant_index(*it, nozzle_diameter_str);
ConfigOption* opt_min = it->config.option("nozzle_temperature_range_low");
if (opt_min) {
ConfigOptionInts* opt_min_ints = dynamic_cast<ConfigOptionInts*>(opt_min);
if (opt_min_ints) {
wxString text_nozzle_temp_min = wxString::Format("%d", opt_min_ints->get_at(0));
wxString text_nozzle_temp_min = wxString::Format("%d", opt_min_ints->get_at(variant_index));
m_input_nozzle_min->GetTextCtrl()->SetValue(text_nozzle_temp_min);
}
}
@@ -1261,7 +1278,7 @@ void AMSMaterialsSetting::on_select_filament(wxCommandEvent &evt)
if (opt_max) {
ConfigOptionInts* opt_max_ints = dynamic_cast<ConfigOptionInts*>(opt_max);
if (opt_max_ints) {
wxString text_nozzle_temp_max = wxString::Format("%d", opt_max_ints->get_at(0));
wxString text_nozzle_temp_max = wxString::Format("%d", opt_max_ints->get_at(variant_index));
m_input_nozzle_max->GetTextCtrl()->SetValue(text_nozzle_temp_max);
}
}
+2
View File
@@ -150,6 +150,8 @@ protected:
void update_widgets();
void update_filament_editing(bool is_printing);
// Orca: the variant index of the filament's per-variant options on the nozzle this tray feeds
int get_filament_variant_index(const Preset &filament, const std::string &nozzle_diameter_str);
protected:
StateColor m_btn_bg_green;
+12 -12
View File
@@ -78,12 +78,12 @@ void ConfigManipulation::set_option_label(const std::string& opt_key, const wxSt
cb_set_option_label(opt_key, label, opt_index);
}
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config) {
void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index) {
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
// Get the selected filament type
std::string filament_type = "";
@@ -123,16 +123,16 @@ void ConfigManipulation::check_nozzle_recommended_temperature_range(DynamicPrint
}
}
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config)
void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *config, unsigned int variant_index)
{
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
if (config->has("nozzle_temperature")) {
if (config->opt_int("nozzle_temperature", 0) < temperature_range_low || config->opt_int("nozzle_temperature", 0) > temperature_range_high) {
if (config->opt_int("nozzle_temperature", variant_index) < temperature_range_low || config->opt_int("nozzle_temperature", variant_index) > temperature_range_high) {
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
MessageDialog dialog(m_msg_dlg_parent, msg_text, "", wxICON_WARNING | wxOK);
@@ -143,17 +143,17 @@ void ConfigManipulation::check_nozzle_temperature_range(DynamicPrintConfig *conf
}
}
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config)
void ConfigManipulation::check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index)
{
if (is_msg_dlg_already_exist)
return;
int temperature_range_low, temperature_range_high;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high)) return;
if (!get_temperature_range(config, temperature_range_low, temperature_range_high, variant_index)) return;
if (config->has("nozzle_temperature_initial_layer")) {
if (config->opt_int("nozzle_temperature_initial_layer", 0) < temperature_range_low ||
config->opt_int("nozzle_temperature_initial_layer", 0) > temperature_range_high)
if (config->opt_int("nozzle_temperature_initial_layer", variant_index) < temperature_range_low ||
config->opt_int("nozzle_temperature_initial_layer", variant_index) > temperature_range_high)
{
wxString msg_text = _(L("The nozzle may become clogged when the temperature is out of the recommended range.\nPlease make sure whether to use this temperature to print.\n\n"));
msg_text += wxString::Format(_L("The recommended nozzle temperature for this filament type is [%d, %d] degrees Celsius."), temperature_range_low, temperature_range_high);
@@ -1295,15 +1295,15 @@ int ConfigManipulation::show_spiral_mode_settings_dialog(bool is_object_config)
return answer;
}
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high)
bool ConfigManipulation::get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index)
{
bool range_low_exist = false, range_high_exist = false;
if (config->has("nozzle_temperature_range_low")) {
range_low = config->opt_int("nozzle_temperature_range_low", (unsigned int) 0);
range_low = config->opt_int("nozzle_temperature_range_low", variant_index);
range_low_exist = true;
}
if (config->has("nozzle_temperature_range_high")) {
range_high = config->opt_int("nozzle_temperature_range_high", (unsigned int) 0);
range_high = config->opt_int("nozzle_temperature_range_high", variant_index);
range_high_exist = true;
}
return range_low_exist && range_high_exist;
+4 -4
View File
@@ -79,9 +79,9 @@ public:
void apply_null_fff_config(DynamicPrintConfig *config, std::vector<std::string> const &keys, std::map<ObjectBase*, ModelConfig*> const & configs);
//BBS: FFF filament nozzle temperature range
void check_nozzle_recommended_temperature_range(DynamicPrintConfig *config);
void check_nozzle_temperature_range(DynamicPrintConfig* config);
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config);
void check_nozzle_recommended_temperature_range(DynamicPrintConfig *config, unsigned int variant_index);
void check_nozzle_temperature_range(DynamicPrintConfig* config, unsigned int variant_index);
void check_nozzle_temperature_initial_layer_range(DynamicPrintConfig* config, unsigned int variant_index);
void check_adaptive_pressure_advance_model(DynamicPrintConfig* config);
void check_filament_max_volumetric_speed(DynamicPrintConfig *config);
void check_chamber_temperature(DynamicPrintConfig* config);
@@ -104,7 +104,7 @@ public:
int show_spiral_mode_settings_dialog(bool is_object_config = false);
private:
bool get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high);
bool get_temperature_range(DynamicPrintConfig *config, int &range_low, int &range_high, unsigned int variant_index);
};
} // GUI
+15 -16
View File
@@ -5696,7 +5696,7 @@ void MachineObject::update_filament_list()
PresetBundle *preset_bundle = Slic3r::GUI::wxGetApp().preset_bundle;
// custom filament
typedef std::map<std::string, std::pair<int, int>> map_pair;
typedef std::map<std::string, std::pair<std::vector<int>, std::vector<int>>> map_pair;
std::map<std::string, map_pair> map_list;
for (auto &pair : m_nozzle_filament_data) {
map_list[pair.second.printer_preset_name] = map_pair{};
@@ -5708,19 +5708,13 @@ void MachineObject::update_filament_list()
for (const std::string &printer_str : printer_strs->values) {
if (map_list.find(printer_str) != map_list.end()) {
auto & filament_list = map_list[printer_str];
ConfigOption *opt_min = const_cast<Preset &>(preset).config.option("nozzle_temperature_range_low");
int min_temp = -1;
if (opt_min) {
ConfigOptionInts *opt_min_ints = dynamic_cast<ConfigOptionInts *>(opt_min);
min_temp = opt_min_ints->get_at(0);
}
ConfigOption *opt_max = const_cast<Preset &>(preset).config.option("nozzle_temperature_range_high");
int max_temp = -1;
if (opt_max) {
ConfigOptionInts *opt_max_ints = dynamic_cast<ConfigOptionInts *>(opt_max);
max_temp = opt_max_ints->get_at(0);
}
filament_list[preset.filament_id] = std::make_pair(min_temp, max_temp);
// Every variant's range, so a change to any of them rechecks the trays
std::vector<int> min_temps{-1}, max_temps{-1};
if (auto *opt_min = preset.config.option<ConfigOptionInts>("nozzle_temperature_range_low"))
min_temps = opt_min->values;
if (auto *opt_max = preset.config.option<ConfigOptionInts>("nozzle_temperature_range_high"))
max_temps = opt_max->values;
filament_list[preset.filament_id] = std::make_pair(min_temps, max_temps);
break;
}
}
@@ -5856,10 +5850,13 @@ void MachineObject::check_ams_filament_valid()
need_checked_filament_id[nozzle_diameter_str].insert(curr_tray->setting_id);
try {
std::string preset_setting_id;
const int extruder_id = ams->GetExtruderId();
bool is_equation = preset_bundle->check_filament_temp_equation_by_printer_type_and_nozzle_for_mas_tray(printer_model, nozzle_diameter_str,
curr_tray->setting_id, curr_tray->tag_uid,
curr_tray->nozzle_temp_min,
curr_tray->nozzle_temp_max, preset_setting_id);
curr_tray->nozzle_temp_max, preset_setting_id,
get_preset_extruder_index(extruder_id),
DevNozzle::ToNozzleVolumeType(m_extder_system->GetNozzleFlowType(extruder_id)));
if (!is_equation) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__ << " ams filament is not match min max temp and reset, ams_id: " << ams_id << " tray_id"
<< slot_id << "filament_id: " << curr_tray->setting_id;
@@ -5924,7 +5921,9 @@ void MachineObject::check_ams_filament_valid()
this->printer_type),
nozzle_diameter_str, vt_tray.setting_id,
vt_tray.tag_uid, vt_tray.nozzle_temp_min,
vt_tray.nozzle_temp_max, preset_setting_id);
vt_tray.nozzle_temp_max, preset_setting_id,
get_preset_extruder_index(index),
DevNozzle::ToNozzleVolumeType(m_extder_system->GetNozzleFlowType(index)));
if (!is_equation) {
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " " << __LINE__
<< " vt_tray filament is not match min max temp and reset, filament_id: " << vt_tray.setting_id;
+4 -1
View File
@@ -341,6 +341,8 @@ public:
bool is_main_extruder_on_left() const { return false; } // only means the extruder is on the left hand when extruder id is 0
bool is_multi_extruders() const;
int get_extruder_id_by_ams_id(const std::string& ams_id);
// Orca: the printer preset's extruder index of device extruder extder_id
int get_preset_extruder_index(int extder_id) const { return is_multi_extruders() ? (is_main_extruder_on_left() ? extder_id : 1 - extder_id) : 0; }
/* E3D has extra nozzle flow type info */
bool has_extra_flow_type{false};
@@ -957,7 +959,8 @@ public:
{
std::set<std::string> checked_filament;
std::string printer_preset_name;
std::map<std::string, std::pair<int, int>> filament_list; // filament_id, pair<min temp, max temp>
// filament_id, pair<min temps, max temps>, one per filament variant
std::map<std::string, std::pair<std::vector<int>, std::vector<int>>> filament_list;
};
std::map<std::string, FilamentData> m_nozzle_filament_data;
void update_filament_list();
+5
View File
@@ -8882,6 +8882,11 @@ void GUI_App::load_current_presets(bool active_preset_combox/*= false*/, bool ch
if (active_preset_combox)
tab->reactive_preset_combo_box();
}
// Preset loading can resize the filament list without an extruder-count change event.
// Refresh the controls even when the list already matches the printer's nozzle count.
if (printer_technology == ptFFF)
this->plater()->on_filament_count_change(preset_bundle->filament_presets.size());
// BBS: model config
for (Tab *tab : model_tabs_list)
if (tab->supports_printer_technology(printer_technology)) {
+12 -4
View File
@@ -1798,11 +1798,14 @@ bool Sidebar::priv::switch_diameter_to(const wxString &diameter)
Preset& printer_preset = wxGetApp().preset_bundle->printers.get_edited_preset();
// The combo lists printer variants, and the variant of a mixed-nozzle machine ("0.4+0.6") is no
// single extruder's diameter, so the preset's own variant answers first.
if (printer_preset.config.opt_string("printer_variant") == diameter.ToStdString()) {
const std::string &printer_variant = printer_preset.config.opt_string("printer_variant");
if (printer_variant == diameter.ToStdString()) {
return true;
}
// A named variant ("0.4 High Flow") shares its diameter with the standard profile, which selecting
// the plain diameter switches back to, so only a preset naming no variant is kept by its diameter.
auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(printer_preset.config.option("nozzle_diameter"));
if (nozzle_diameter && nozzle_diameter->size() > 0) {
if (printer_variant.empty() && nozzle_diameter && nozzle_diameter->size() > 0) {
auto current_nozzle_dia = get_diameter_string(nozzle_diameter->values[0]);
// If the selected diameter is the same as current nozzle, don't switch profiles
if (current_nozzle_dia == diameter.ToStdString()) {
@@ -3934,13 +3937,18 @@ void Sidebar::update_presets(Preset::Type preset_type)
combo_flow->Show(combo_flow->GetCount() > 0);
};
auto update_extruder_diameter = [&diameters, &nozzle_diameter](int extruder_index,ExtruderGroup & extruder) {
auto update_extruder_diameter = [&diameters, &nozzle_diameter, &diameter](int extruder_index,ExtruderGroup & extruder) {
extruder.combo_diameter->Clear();
if (extruder_index >= int(nozzle_diameter->values.size()))
return;
int select = -1;
// ORCA get the actual nozzle diameter from printer config
auto nozzle_dia = get_diameter_string(nozzle_diameter->values[extruder_index]);
// Named variants such as "0.4HS" and "0.4 High Flow" share a physical diameter.
// Retain the variant selection unless the diameter was customized.
const bool keep_variant = diameter.substr(0, diameter.find_first_not_of("0123456789.")) == nozzle_dia &&
std::find(diameters.begin(), diameters.end(), diameter) != diameters.end();
const std::string &selected_variant = keep_variant ? diameter : nozzle_dia;
// ORCA try to add nozzle diameter from config if list is empty. fixes blank nozzle combo box when preset has no alias
if(!diameters.empty() && diameters[0].empty() && !nozzle_dia.empty()){
diameters[0] = nozzle_dia;
@@ -3950,7 +3958,7 @@ void Sidebar::update_presets(Preset::Type preset_type)
diameters.push_back(nozzle_dia);
}
for (size_t i = 0; i < diameters.size(); ++i) {
if (diameters[i] == nozzle_dia)
if (diameters[i] == selected_variant)
select = extruder.combo_diameter->GetCount();
extruder.combo_diameter->Append(diameters[i], {});
}
+36 -32
View File
@@ -4396,16 +4396,17 @@ void TabFilament::build()
optgroup->append_single_option_line("temperature_vitrification", "material_basic_information#softening-temperature");
optgroup->append_single_option_line("idle_temperature", "material_basic_information#idle-temperature");
Line line = { L("Recommended nozzle temperature"), L("Recommended nozzle temperature range of this filament. 0 means not set") };
line.append_option(optgroup->get_option("nozzle_temperature_range_low"));
line.append_option(optgroup->get_option("nozzle_temperature_range_high"));
line.append_option(optgroup->get_option("nozzle_temperature_range_low", 0));
line.append_option(optgroup->get_option("nozzle_temperature_range_high", 0));
optgroup->append_line(line);
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value) {
DynamicPrintConfig &filament_config = m_preset_bundle->filaments.get_edited_preset().config;
update_dirty();
if (!m_postpone_update_ui && (opt_key == "nozzle_temperature_range_low" || opt_key == "nozzle_temperature_range_high")) {
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config);
const std::string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
if (!m_postpone_update_ui && (opt_key_without_idx == "nozzle_temperature_range_low" || opt_key_without_idx == "nozzle_temperature_range_high")) {
m_config_manipulation.check_nozzle_recommended_temperature_range(&filament_config, selected_variant_index());
}
on_value_change(opt_key, value);
};
@@ -4520,6 +4521,7 @@ void TabFilament::build()
DynamicPrintConfig& filament_config = m_preset_bundle->filaments.get_edited_preset().config;
update_dirty();
const std::string opt_key_without_idx = opt_key.substr(0, opt_key.find('#'));
/*if (opt_key == "cool_plate_temp" || opt_key == "cool_plate_temp_initial_layer") {
m_config_manipulation.check_bed_temperature_difference(BedType::btPC, &filament_config);
}
@@ -4532,11 +4534,11 @@ void TabFilament::build()
else if (opt_key == "textured_plate_temp" || opt_key == "textured_plate_temp_initial_layer") {
m_config_manipulation.check_bed_temperature_difference(BedType::btPTE, &filament_config);
}
else */if (opt_key == "nozzle_temperature") {
m_config_manipulation.check_nozzle_temperature_range(&filament_config);
else */if (opt_key_without_idx == "nozzle_temperature") {
m_config_manipulation.check_nozzle_temperature_range(&filament_config, selected_variant_index());
}
else if (opt_key == "nozzle_temperature_initial_layer") {
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config);
else if (opt_key_without_idx == "nozzle_temperature_initial_layer") {
m_config_manipulation.check_nozzle_temperature_initial_layer_range(&filament_config, selected_variant_index());
}
on_value_change(opt_key, value);
@@ -4571,12 +4573,12 @@ void TabFilament::build()
optgroup = page->new_optgroup(L("Part cooling fan"), L"param_cooling_part_fan");
line = { L("Min fan speed threshold"), L("The part cooling fan will run at the minimum fan speed when the estimated layer time is longer than the threshold value. When the layer time is shorter than the threshold, the fan speed will be interpolated between the minimum and maximum fan speed according to layer printing time.") };
line.label_path = "material_cooling#material-part-cooling-fan";
line.append_option(optgroup->get_option("fan_min_speed"));
line.append_option(optgroup->get_option("fan_min_speed", 0));
line.append_option(optgroup->get_option("fan_cooling_layer_time"));
optgroup->append_line(line);
line = { L("Max fan speed threshold"), L("The part cooling fan will run at maximum speed when the estimated layer time is shorter than the threshold value.") };
line.label_path = "material_cooling#material-part-cooling-fan";
line.append_option(optgroup->get_option("fan_max_speed"));
line.append_option(optgroup->get_option("fan_max_speed", 0));
line.append_option(optgroup->get_option("slow_down_layer_time"));
optgroup->append_line(line);
optgroup->append_single_option_line("reduce_fan_stop_start_freq", "material_cooling#keep-fan-always-on");
@@ -4592,7 +4594,7 @@ void TabFilament::build()
optgroup->append_single_option_line("ironing_fan_speed", "material_cooling#ironing-fan-speed"); // ORCA: Add support for ironing fan speed control
optgroup = page->new_optgroup(L("Auxiliary part cooling fan"), L"param_cooling_aux_fan");
optgroup->append_single_option_line("additional_cooling_fan_speed", "material_cooling#auxiliary-part-cooling-fan");
optgroup->append_single_option_line("additional_cooling_fan_speed", "material_cooling#auxiliary-part-cooling-fan", 0);
optgroup = page->new_optgroup(L("Exhaust fan"),L"param_cooling_exhaust");
@@ -4656,7 +4658,7 @@ void TabFilament::build()
page = add_options_page(L("Multimaterial"), "custom-gcode_multi_material"); // ORCA: icon only visible on placeholders
optgroup = page->new_optgroup(L("Wipe tower parameters"), "param_tower");
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_minimal_purge_on_wipe_tower", "material_multimaterial#multimaterial-wipe-tower-parameters", 0);
optgroup->append_single_option_line("filament_tower_interface_pre_extrusion_dist", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_tower_interface_pre_extrusion_length", "material_multimaterial#multimaterial-wipe-tower-parameters");
optgroup->append_single_option_line("filament_tower_ironing_area", "material_multimaterial#multimaterial-wipe-tower-parameters");
@@ -4700,9 +4702,9 @@ void TabFilament::build()
});
optgroup = page->new_optgroup(L("Tool change parameters with multi extruder MM printers"), "param_toolchange_multi_extruder");
optgroup->append_single_option_line("filament_multitool_ramming", "material_multimaterial#tool-change-parameters-with-multi-extruder");
optgroup->append_single_option_line("filament_multitool_ramming_volume", "material_multimaterial#multi-tool-ramming-volume");
optgroup->append_single_option_line("filament_multitool_ramming_flow", "material_multimaterial#multi-tool-ramming-flow");
optgroup->append_single_option_line("filament_multitool_ramming", "material_multimaterial#tool-change-parameters-with-multi-extruder", 0);
optgroup->append_single_option_line("filament_multitool_ramming_volume", "material_multimaterial#multi-tool-ramming-volume", 0);
optgroup->append_single_option_line("filament_multitool_ramming_flow", "material_multimaterial#multi-tool-ramming-flow", 0);
page = add_options_page(L("Dependencies"), "advanced");
optgroup = page->new_optgroup(L("Compatible printers"), "param_dependencies_printers");
@@ -4770,8 +4772,14 @@ void TabFilament::update_description_lines()
// this->update_volumetric_flow_preset_hints();
}
unsigned int TabFilament::selected_variant_index() const
{
return m_variant_combo ? std::max(0, m_variant_combo->GetSelection()) : 0;
}
void TabFilament::toggle_options()
{
const unsigned int variant_index = selected_variant_index();
if (!m_active_page)
return;
bool is_BBL_printer = false;
@@ -4813,7 +4821,7 @@ void TabFilament::toggle_options()
}
}
toggle_line("additional_cooling_fan_speed", printer_cfg.opt_bool("auxiliary_fan"));
toggle_line("additional_cooling_fan_speed", printer_cfg.opt_bool("auxiliary_fan"), 256 + variant_index);
bool support_air_filtration = printer_cfg.opt_bool("support_air_filtration");
for (auto el : {"activate_air_filtration", "during_print_exhaust_fan_speed", "complete_print_exhaust_fan_speed"})
@@ -4829,11 +4837,8 @@ void TabFilament::toggle_options()
}
if (m_active_page->title() == L("Filament"))
{
const int selection = m_variant_combo ? m_variant_combo->GetSelection() : 0;
const unsigned int variant_idx = (unsigned int) std::max(selection, 0);
bool pa = m_config->opt_bool("enable_pressure_advance", variant_idx);
toggle_option("pressure_advance", pa, 0);
bool pa = m_config->opt_bool("enable_pressure_advance", variant_index);
toggle_option("pressure_advance", pa, 256 + variant_index);
//Orca: Enable the plates that should be visible when multi bed support is enabled or a BBL printer is selected; otherwise, enable only the plate visible for the selected bed type.
DynamicConfig& proj_cfg = m_preset_bundle->project_config;
@@ -4863,7 +4868,7 @@ void TabFilament::toggle_options()
// If adaptive PA is not enabled, hide the adaptive PA model section
toggle_option("adaptive_pressure_advance", pa, 0);
toggle_option("adaptive_pressure_advance_overhangs", pa, 0);
bool has_adaptive_pa = m_config->opt_bool("adaptive_pressure_advance", variant_idx);
bool has_adaptive_pa = m_config->opt_bool("adaptive_pressure_advance", variant_index);
toggle_line("adaptive_pressure_advance_overhangs", has_adaptive_pa && pa, 0);
toggle_line("adaptive_pressure_advance_model", has_adaptive_pa && pa, 0);
toggle_line("adaptive_pressure_advance_bridges", has_adaptive_pa && pa, 0);
@@ -4874,9 +4879,9 @@ void TabFilament::toggle_options()
toggle_line("activate_chamber_temp_control", printer_cfg.opt_bool("support_chamber_temp_control"));
std::string volumetric_speed_cos = m_config->opt_string("volumetric_speed_coefficients", variant_idx);
std::string volumetric_speed_cos = m_config->opt_string("volumetric_speed_coefficients", variant_index);
bool enable_fit = volumetric_speed_cos != "0 0 0 0 0 0";
toggle_option("filament_adaptive_volumetric_speed", enable_fit, 256 + variant_idx);
toggle_option("filament_adaptive_volumetric_speed", enable_fit, 256 + variant_index);
}
if (m_active_page->title() == L("Setting Overrides"))
@@ -4884,20 +4889,19 @@ void TabFilament::toggle_options()
if (m_active_page->title() == L("Multimaterial")) {
// Orca: hide specific settings for BBL printers
for (auto el : {"filament_minimal_purge_on_wipe_tower", "filament_loading_speed_start", "filament_loading_speed",
toggle_option("filament_minimal_purge_on_wipe_tower", !is_BBL_printer, 256 + variant_index);
for (auto el : {"filament_loading_speed_start", "filament_loading_speed",
"filament_unloading_speed_start", "filament_unloading_speed", "filament_toolchange_delay", "filament_cooling_moves",
"filament_cooling_initial_speed", "filament_cooling_final_speed"})
toggle_option(el, !is_BBL_printer);
bool multitool_ramming = m_config->opt_bool("filament_multitool_ramming", 0);
toggle_option("filament_multitool_ramming_volume", multitool_ramming);
toggle_option("filament_multitool_ramming_flow", multitool_ramming);
bool multitool_ramming = m_config->opt_bool("filament_multitool_ramming", variant_index);
toggle_option("filament_multitool_ramming_volume", multitool_ramming, 256 + variant_index);
toggle_option("filament_multitool_ramming_flow", multitool_ramming, 256 + variant_index);
bool is_BBL_multi_extruder = is_BBL_printer && printer_cfg.option<ConfigOptionFloats>("nozzle_diameter")->size() > 1;
const int selection = m_variant_combo ? m_variant_combo->GetSelection() : 0;
const int extruder_idx = std::max(selection, 0);
toggle_line("long_retractions_when_ec", is_BBL_multi_extruder, 256 + extruder_idx);
toggle_line("retraction_distances_when_ec", is_BBL_multi_extruder && m_config->opt_bool("long_retractions_when_ec", extruder_idx), 256 + extruder_idx);
toggle_line("long_retractions_when_ec", is_BBL_multi_extruder, 256 + variant_index);
toggle_line("retraction_distances_when_ec", is_BBL_multi_extruder && m_config->opt_bool("long_retractions_when_ec", variant_index), 256 + variant_index);
}
}
+2
View File
@@ -616,6 +616,8 @@ private:
void add_filament_overrides_page();
void update_filament_overrides_page(const DynamicPrintConfig* printers_config);
void update_volumetric_flow_preset_hints();
// The variant index the variant switch shows, 0 without one.
unsigned int selected_variant_index() const;
std::map<std::string, ::CheckBox*> m_overrides_options;