Fill a new extruder's machine limits the same way as its other settings

This commit is contained in:
SoftFever
2026-10-07 18:42:09 +08:00
parent 6b2b200f50
commit b805f2ffd6
4 changed files with 64 additions and 63 deletions
+5 -7
View File
@@ -1161,9 +1161,8 @@ std::string Tab::options_list_storage_key(const std::string& opt_key) const
// Orca: deep_diff() flags every vector entry at or past the reference vector's length as changed,
// whatever its value (e.g. the values of an extruder added by raising the extruder count). A vector
// grows by copying its first entry (ConfigOptionVector::resize), and machine limits by copying their
// first (normal, silent) pair (set_num_extruders), so such an entry only counts as changed when it
// differs from the reference entry it was copied from, as before Orca's deep_diff() change.
// grows by copying its first entry (ConfigOptionVector::resize), so such an entry only counts as
// changed when it differs from the reference's first entry, as before Orca's deep_diff() change.
// The change of the count itself shows on "extruders_count".
static void drop_unchanged_added_entries(std::vector<std::string> &options, const DynamicPrintConfig &current, const Preset *reference)
{
@@ -1172,7 +1171,7 @@ static void drop_unchanged_added_entries(std::vector<std::string> &options, cons
// deep_diff() lists a key's entries one after another, so serialize each key's vectors once.
std::string serialized_key;
std::vector<std::string> cur_values;
std::vector<std::string> ref_values;
std::string ref_first;
options.erase(std::remove_if(options.begin(), options.end(), [&](const std::string &opt) {
const auto pos = opt.find('#');
if (pos == std::string::npos)
@@ -1186,10 +1185,9 @@ static void drop_unchanged_added_entries(std::vector<std::string> &options, cons
if (key != serialized_key) {
serialized_key = key;
cur_values = cur->vserialize();
ref_values = ref->vserialize();
ref_first = ref->vserialize().front();
}
const size_t copied_from = printer_options_with_variant_2.count(key) > 0 && idx % 2 < ref_values.size() ? idx % 2 : 0;
return cur_values[idx] == ref_values[copied_from];
return cur_values[idx] == ref_first;
}), options.end());
}