NEW: add plate name

referenced OrcaSlicer code and support for Chinese textures,chinese xml,limit plate_name length,Code decoupling,wxColour use Local Variables

Change-Id: I6434b90efb2f90235527c7dfb3a7ed516ac2cf4b
(cherry picked from commit 0ecfefb0e1cfccbe73b0fcc530e04e6405ecf68a)
This commit is contained in:
zhou.xu 2023-04-19 19:59:07 +08:00 committed by Lane.Wei
parent 21fbe91ca7
commit 2b9f3c9912
14 changed files with 227 additions and 86 deletions

View file

@ -277,6 +277,7 @@ static constexpr const char* OBJECT_ID_ATTR = "object_id";
static constexpr const char* INSTANCEID_ATTR = "instance_id";
static constexpr const char* IDENTIFYID_ATTR = "identify_id";
static constexpr const char* PLATERID_ATTR = "plater_id";
static constexpr const char* PLATER_NAME_ATTR = "plater_name";
static constexpr const char* PLATE_IDX_ATTR = "index";
static constexpr const char* SLICE_PREDICTION_ATTR = "prediction";
static constexpr const char* SLICE_WEIGHT_ATTR = "weight";
@ -2038,6 +2039,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]->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;
@ -3814,6 +3816,9 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
if (key == PLATERID_ATTR)
{
m_curr_plater->plate_index = atoi(value.c_str());
}
else if (key == PLATER_NAME_ATTR) {
m_curr_plater->plate_name = encode_path(value.c_str());
}
else if (key == LOCK_ATTR)
{
@ -6962,6 +6967,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 << "=\"" << decode_path(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();