Pick updates from BS 1.9.3

sync bbl profiles
FIX: [#4320] crash when edit project preset

github: #4320

Change-Id: I81eb5f0d461565d63a32100a5bebb4569cfb0b1b
ENH: add pctg type

Jira: none

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: Ie01fcd4bef0d3ebec5bbd7185a87a1740068bdba
(cherry picked from commit c6276932dd92bc4283600954415eedeac6d351ce)
ENH: CLI: add logic to save metadata into 3mf from CLI

JIRA: no jira
Change-Id: I7f96c2ab9671ec1c0115e90f6d64230b8170eb38
(cherry picked from commit 3d2d6e23ba318a2b331a62e320f8ca199168f1f5)
This commit is contained in:
SoftFever 2024-06-21 18:16:14 +08:00
parent 6a28bae6fd
commit b7a0b30578
16 changed files with 134 additions and 14 deletions

View file

@ -590,7 +590,8 @@ double getadhesionCoeff(const PrintObject* printObject)
for (auto iter = extrudersFirstLayer.begin(); iter != extrudersFirstLayer.end(); iter++)
if (modelVolume->extruder_id() == *iter) {
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end())
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG") {
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG" ||
Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PCTG") {
adhesionCoeff = 2;
}
else if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "TPU") {

View file

@ -6450,6 +6450,13 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
metadata_item_map[BBL_MAKERLAB_VERSION_TAG] = xml_escape(model.mk_version);
BOOST_LOG_TRIVIAL(info) << "saved mk_version " << model.mk_version;
}
if (!model.md_name.empty()) {
for (unsigned int i = 0; i < model.md_name.size(); i++)
{
BOOST_LOG_TRIVIAL(info) << boost::format("saved metadata_name %1%, metadata_value %2%") %model.md_name[i] %model.md_value[i];
metadata_item_map[model.md_name[i]] = xml_escape(model.md_value[i]);
}
}
// store metadata info
for (auto item : metadata_item_map) {

View file

@ -96,6 +96,8 @@ Model& Model::assign_copy(const Model &rhs)
this->mk_name = rhs.mk_name;
this->mk_version = rhs.mk_version;
this->md_name = rhs.md_name;
this->md_value = rhs.md_value;
return *this;
}
@ -129,6 +131,8 @@ Model& Model::assign_copy(Model &&rhs)
this->stl_design_country = rhs.stl_design_country;
this->mk_name = rhs.mk_name;
this->mk_version = rhs.mk_version;
this->md_name = rhs.md_name;
this->md_value = rhs.md_value;
this->backup_path = std::move(rhs.backup_path);
this->object_backup_id_map = std::move(rhs.object_backup_id_map);
this->next_object_backup_id = rhs.next_object_backup_id;
@ -983,6 +987,8 @@ void Model::load_from(Model& model)
profile_info = model.profile_info;
mk_name = model.mk_name;
mk_version = model.mk_version;
md_name = model.md_name;
md_value = model.md_value;
model.design_info.reset();
model.model_info.reset();
model.profile_info.reset();
@ -2956,7 +2962,7 @@ bool Model::obj_import_vertex_color_deal(const std::vector<unsigned char> &verte
case _3_SAME_COLOR: {
std::string result;
get_real_filament_id(filament_id0, result);
volume->mmu_segmentation_facets.set_triangle_from_string(i, result);
volume->mmu_segmentation_facets.set_triangle_from_string(i, result);
break;
}
case _3_DIFF_COLOR: {
@ -3161,7 +3167,8 @@ double getadhesionCoeff(const ModelVolumePtrs objectVolumes)
double adhesionCoeff = 1;
for (const ModelVolume* modelVolume : objectVolumes) {
if (Model::extruderParamsMap.find(modelVolume->extruder_id()) != Model::extruderParamsMap.end())
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG") {
if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PETG" ||
Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "PCTG") {
adhesionCoeff = 2;
}
else if (Model::extruderParamsMap.at(modelVolume->extruder_id()).materialName == "TPU") {

View file

@ -423,7 +423,7 @@ public:
bool is_mm_painted() const;
// This object may have a varying layer height by painting or by a table.
// Even if true is returned, the layer height profile may be "flat" with no difference to default layering.
bool has_custom_layering() const
bool has_custom_layering() const
{ return ! this->layer_config_ranges.empty() || ! this->layer_height_profile.empty(); }
ModelInstance* add_instance();
@ -1508,6 +1508,8 @@ public:
//makerlab information
std::string mk_name;
std::string mk_version;
std::vector<std::string> md_name;
std::vector<std::string> md_value;
void SetDesigner(std::string designer, std::string designer_user_id) {
if (design_info == nullptr) {

View file

@ -2452,9 +2452,9 @@ FilamentTempType Print::get_filament_temp_type(const std::string& filament_type)
catch (const json::parse_error& err){
in.close();
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": parse " << file_path.string() << " got a nlohmann::detail::parse_error, reason = " << err.what();
filament_temp_type_map[HighTempFilamentStr] = {"ABS","ASA","PC","PA","PA-CF","PA6-CF","PET-CF","PPS","PPS-CF","PPA-GF","PPA-CF"};
filament_temp_type_map[LowTempFilamentStr] = {"PLA","TPU","PLA-CF","PLA-AERO","PVA"};
filament_temp_type_map[HighLowCompatibleFilamentStr] = { "HIPS","PETG" };
filament_temp_type_map[HighTempFilamentStr] = {"ABS","ASA","PC","PA","PA-CF","PA-GF","PA6-CF","PET-CF","PPS","PPS-CF","PPA-GF","PPA-CF","ABS-Aero","ABS-GF"};
filament_temp_type_map[LowTempFilamentStr] = {"PLA","TPU","PLA-CF","PLA-AERO","PVA","BVOH"};
filament_temp_type_map[HighLowCompatibleFilamentStr] = { "HIPS","PETG","PCTG","PE","PP","EVA","PE-CF","PP-CF","PP-GF","PHA"};
}
}

View file

@ -1944,6 +1944,7 @@ void PrintConfigDef::init_fff_params()
def->enum_values.push_back("ASA");
def->enum_values.push_back("ASA-Aero");
def->enum_values.push_back("BVOH");
def->enum_values.push_back("PCTG");
def->enum_values.push_back("EVA");
def->enum_values.push_back("HIPS");
def->enum_values.push_back("PA");
@ -7074,6 +7075,18 @@ CLIMiscConfigDef::CLIMiscConfigDef()
def->cli_params = "version";
def->set_default_value(new ConfigOptionString());
def = this->add("metadata_name", coStrings);
def->label = "metadata name list";
def->tooltip = "matadata name list added into 3mf";
def->cli_params = "\"name1;name2;...\"";
def->set_default_value(new ConfigOptionStrings());
def = this->add("metadata_value", coStrings);
def->label = "metadata value list";
def->tooltip = "matadata value list added into 3mf";
def->cli_params = "\"value1;value2;...\"";
def->set_default_value(new ConfigOptionStrings());
def = this->add("allow_newer_file", coBool);
def->label = "Allow 3mf with newer version to be sliced";
def->tooltip = "Allow 3mf with newer version to be sliced";