mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00:00
ENH: set filament retract params even if nil
1.Always set filament retract params to filament_num size.In gcode export module, we can always use filament idx to get retract params 2. add logic in update_filament_maps_to_config to update the retraction related params which can be overiden by filament jira:NONE Signed-off-by: xun.zhang <xun.zhang@bambulab.com> Change-Id: Ia45dd1401aa3565d062d5da1c9f4a2ba8966f693 (cherry picked from commit 4b083d8d8220b8f65a1b804688cb2d6e238eb4e6)
This commit is contained in:
@@ -286,7 +286,7 @@ public:
|
||||
return *this != *rhs;
|
||||
}
|
||||
// Apply an override option, possibly a nullable one.
|
||||
virtual bool apply_override(const ConfigOption *rhs) {
|
||||
virtual bool apply_override(const ConfigOption *rhs, std::vector<int>& default_index) {
|
||||
if (*this == *rhs)
|
||||
return false;
|
||||
*this = *rhs;
|
||||
@@ -583,7 +583,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
// Apply an override option, possibly a nullable one.
|
||||
bool apply_override(const ConfigOption *rhs) override {
|
||||
bool apply_override(const ConfigOption *rhs, std::vector<int>& default_index) override {
|
||||
if (this->nullable())
|
||||
throw ConfigurationError("Cannot override a nullable ConfigOption.");
|
||||
if (rhs->type() != this->type())
|
||||
@@ -607,14 +607,16 @@ public:
|
||||
else
|
||||
this->values.resize(rhs_vec->size(), this->values.front());
|
||||
|
||||
bool modified = false;
|
||||
auto default_value = this->values[0];
|
||||
assert(default_index.size() == rhs_vec->size());
|
||||
|
||||
bool modified = false;
|
||||
std::vector<T> default_value = this->values;
|
||||
for (size_t i = 0; i < rhs_vec->size(); ++i) {
|
||||
if (!rhs_vec->is_nil(i)) {
|
||||
this->values[i] = rhs_vec->values[i];
|
||||
modified = true;
|
||||
} else {
|
||||
this->values[i] = default_value;
|
||||
this->values[i] = default_value[default_index[i]-1];
|
||||
}
|
||||
}
|
||||
return modified;
|
||||
|
||||
Reference in New Issue
Block a user