This commit is contained in:
enricoturri1966 2020-12-15 15:57:32 +01:00
commit 9704eb6ece
12 changed files with 62 additions and 24 deletions

View file

@ -1020,6 +1020,12 @@ bool load_amf_archive(const char* path, DynamicPrintConfig* config, Model* model
#endif // forward compatibility
close_zip_reader(&archive);
for (ModelObject *o : model->objects)
for (ModelVolume *v : o->volumes)
if (v->source.input_file.empty() && (v->type() == ModelVolumeType::MODEL_PART))
v->source.input_file = path;
return true;
}

View file

@ -1849,6 +1849,13 @@ void PhysicalPrinterCollection::select_printer(const std::string& full_name)
m_selected_preset = it->get_preset_name(full_name);
}
void PhysicalPrinterCollection::select_printer(const std::string& printer_name, const std::string& preset_name)
{
if (preset_name.empty())
return select_printer(printer_name);
return select_printer(printer_name + PhysicalPrinter::separator() + preset_name);
}
void PhysicalPrinterCollection::select_printer(const PhysicalPrinter& printer)
{
return select_printer(printer.name);

View file

@ -701,6 +701,7 @@ public:
// If full_name doesn't contain name of selected preset, then select first preset in the list for this printer
void select_printer(const std::string& full_name);
void select_printer(const PhysicalPrinter& printer);
void select_printer(const std::string& printer_name, const std::string& preset_name);
bool has_selection() const;
void unselect_printer() ;
bool is_selected(ConstIterator it, const std::string &preset_name) const;

View file

@ -876,7 +876,7 @@ void PresetBundle::load_config_file_config(const std::string &name_or_path, bool
// Activate the physical printer profile if possible.
PhysicalPrinter *pp = this->physical_printers.find_printer(physical_printer, true);
if (pp != nullptr && std::find(pp->preset_names.begin(), pp->preset_names.end(), this->printers.get_edited_preset().name) != pp->preset_names.end())
this->physical_printers.select_printer(*pp);
this->physical_printers.select_printer(pp->name, this->printers.get_edited_preset().name);
else
this->physical_printers.unselect_printer();
}
@ -1396,7 +1396,7 @@ size_t PresetBundle::load_configbundle(const std::string &path, unsigned int fla
if (! active_printer.empty())
printers.select_preset_by_name(active_printer, true);
if (! active_physical_printer.empty())
physical_printers.select_printer(active_physical_printer +" * " + active_printer);
physical_printers.select_printer(active_physical_printer, active_printer);
// Activate the first filament preset.
if (! active_filaments.empty() && ! active_filaments.front().empty())
filaments.select_preset_by_name(active_filaments.front(), true);

View file

@ -184,13 +184,13 @@ void PrintConfigDef::init_fff_params()
def->mode = comExpert;
def->set_default_value(new ConfigOptionBool(false));
def = this->add("avoid_crossing_perimeters_max_detour", coFloat);
def = this->add("avoid_crossing_perimeters_max_detour", coFloatOrPercent);
def->label = L("Avoid crossing perimeters - Max detour length");
def->category = L("Layers and Perimeters");
def->tooltip = L("The maximum detour length for avoid crossing perimeters. "
"If the detour is longer than this value, avoid crossing perimeters is not applied for this travel path. "
"Detour length could be specified either as an absolute value or as percentage (for example 50%) of a direct travel path.");
def->sidetext = L("mm (zero to disable)");
def->sidetext = L("mm or % (zero to disable)");
def->min = 0;
def->mode = comExpert;
def->set_default_value(new ConfigOptionFloatOrPercent(0., false));