mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-31 13:57:07 +00:00
feat(print): add per-filament config-index resolvers and filament_map_2
- Print::get_nozzle_config_index / get_filament_config_indx resolve a filament's variant slot per layer from the nozzle group result, with hashed index caches; when no group result is published (sequential prints), they fall back to the static filament->extruder mapping so behavior is unchanged - filament_map_2 caches each filament's resolved print-variant slot; rebuilt in Print::apply after the filament_map diff handling and in the filament-map write-back - filament retract overrides now key by slot indices: apply_override fallback indexing flips to 0-based, Print::apply passes filament_map/extruder indices, the write-back passes filament_map_2 (identical resolution while slots equal extruders) - filament_volume_map/filament_nozzle_map/filament_map_2/ filament_self_index become PrintConfig static members (required for member access); grouping input guards tightened so their registered 1-element defaults are never mistaken for real per-filament maps (single-filament manual mode keeps the mix-marker fallback) - update_filament_self_index_cache refreshed at every full-config assignment - tests: 0-based apply_override fallback, get_config_index_base hit/miss/mixed-type cases The resolvers are not consumed by the g-code writer yet. Non-Hybrid g-code is unchanged except the config header, which now serializes the three new static keys (defaults until the per-filament producer lands); verified by the 19-fixture byte gate: 3 added header lines per fixture, zero motion changes.
This commit is contained in:
@@ -716,6 +716,7 @@ public:
|
||||
return false;
|
||||
}
|
||||
// Apply an override option, possibly a nullable one.
|
||||
//default_index are 0 based
|
||||
bool apply_override(const ConfigOption *rhs, std::vector<int>& default_index) override {
|
||||
if (this->nullable())
|
||||
throw ConfigurationError("Cannot override a nullable ConfigOption.");
|
||||
@@ -751,8 +752,8 @@ public:
|
||||
this->values[i] = rhs_vec->values[i];
|
||||
modified = true;
|
||||
} else {
|
||||
if ((i < default_index.size()) && (default_index[i] - 1 < default_value.size()))
|
||||
this->values[i] = default_value[default_index[i] - 1];
|
||||
if ((i < default_index.size()) && (default_index[i] < default_value.size()))
|
||||
this->values[i] = default_value[default_index[i]];
|
||||
else
|
||||
this->values[i] = default_value[0];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user