FIX: fix plate name encoding issue

Change-Id: Ia89b2c5bbb4519ed938ae23ff124719cfe6203de
Signed-off-by: Stone Li <stone.li@bambulab.com>
This commit is contained in:
Stone Li 2023-06-20 11:54:31 +08:00 committed by Lane.Wei
parent 869a3046aa
commit 14cb2449c6
11 changed files with 45 additions and 55 deletions

View file

@ -2044,7 +2044,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
}
plate_data_list[it->first-1]->locked = it->second->locked;
plate_data_list[it->first-1]->plate_index = it->second->plate_index-1;
plate_data_list[it->first - 1]->plate_name = it->second->plate_name;
plate_data_list[it->first-1]->plate_name = it->second->plate_name;
plate_data_list[it->first-1]->obj_inst_map = it->second->obj_inst_map;
plate_data_list[it->first-1]->gcode_file = (m_load_restore || it->second->gcode_file.empty()) ? it->second->gcode_file : m_backup_path + "/" + it->second->gcode_file;
plate_data_list[it->first-1]->gcode_prediction = it->second->gcode_prediction;
@ -3831,7 +3831,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
m_curr_plater->plate_index = atoi(value.c_str());
}
else if (key == PLATER_NAME_ATTR) {
m_curr_plater->plate_name = xml_unescape(encode_path(value.c_str()));
m_curr_plater->plate_name = xml_unescape(value.c_str());
}
else if (key == LOCK_ATTR)
{
@ -6997,7 +6997,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
stream << " <" << PLATE_TAG << ">\n";
//plate index
stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << PLATERID_ATTR << "\" " << VALUE_ATTR << "=\"" << plate_data->plate_index + 1 << "\"/>\n";
stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << PLATER_NAME_ATTR << "\" " << VALUE_ATTR << "=\"" << xml_escape(decode_path(plate_data->plate_name.c_str())) << "\"/>\n";
stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << PLATER_NAME_ATTR << "\" " << VALUE_ATTR << "=\"" << xml_escape(plate_data->plate_name.c_str()) << "\"/>\n";
stream << " <" << METADATA_TAG << " " << KEY_ATTR << "=\"" << LOCK_ATTR << "\" " << VALUE_ATTR << "=\"" << std::boolalpha<< plate_data->locked<< "\"/>\n";
ConfigOption* bed_type_opt = plate_data->config.option("curr_bed_type");
t_config_enum_names bed_type_names = ConfigOptionEnum<BedType>::get_enum_names();