fix some bug

This commit is contained in:
wjyLearn
2025-11-25 15:02:34 +08:00
parent 2809d34cb6
commit 8ce31ed7e1
8 changed files with 45 additions and 8 deletions

View File

@@ -7972,6 +7972,8 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
stream << "\"/>\n"; stream << "\"/>\n";
} }
//y74
int print_id = 0;
for (auto it = plate_data->objects_and_instances.begin(); it != plate_data->objects_and_instances.end(); it++) for (auto it = plate_data->objects_and_instances.begin(); it != plate_data->objects_and_instances.end(); it++)
{ {
int obj_id = it->first; int obj_id = it->first;
@@ -8003,9 +8005,24 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
identify_id = inst->id().id; identify_id = inst->id().id;
bool skipped = std::find(plate_data->skipped_objects.begin(), plate_data->skipped_objects.end(), identify_id) != bool skipped = std::find(plate_data->skipped_objects.begin(), plate_data->skipped_objects.end(), identify_id) !=
plate_data->skipped_objects.end(); plate_data->skipped_objects.end();
stream << " <" << OBJECT_TAG << " " << IDENTIFYID_ATTR << "=\"" << std::to_string(identify_id) << "\" " << NAME_ATTR << "=\"" << xml_escape(obj->name)
auto obj_name = obj->name;
// replace space in obj_name with '-'
//y74
std::replace(obj_name.begin(), obj_name.end(), ' ', '_');
std::replace(obj_name.begin(), obj_name.end(), '#', '_');
std::replace(obj_name.begin(), obj_name.end(), '*', '_');
std::replace(obj_name.begin(), obj_name.end(), ':', '_');
std::replace(obj_name.begin(), obj_name.end(), ';', '_');
std::replace(obj_name.begin(), obj_name.end(), '\'', '_');
obj_name = (boost::format("%1%_id_%2%_copy_%3%") % obj_name % print_id % inst_id).str();
stream << " <" << OBJECT_TAG << " " << IDENTIFYID_ATTR << "=\"" << std::to_string(identify_id) << "\" " << NAME_ATTR << "=\"" << xml_escape(obj_name)
<< "\" " << SKIPPED_ATTR << "=\"" << (skipped ? "true" : "false") << "\" " << SKIPPED_ATTR << "=\"" << (skipped ? "true" : "false")
<< "\" />\n"; << "\" />\n";
print_id++;
} }
for (auto it = plate_data->slice_filaments_info.begin(); it != plate_data->slice_filaments_info.end(); it++) for (auto it = plate_data->slice_filaments_info.begin(); it != plate_data->slice_filaments_info.end(); it++)

View File

@@ -295,7 +295,7 @@ std::vector<PerExtruderAdjustments> GCodeEditor::parse_layer_gcode( const
active_speed_modifier = size_t(-1); active_speed_modifier = size_t(-1);
} }
// y71 // y71
else if (boost::starts_with(sline, "TOOL_CHANGE")) { else if (boost::starts_with(sline, "TOOL_CHANGE_START")) {
; ;
} }
//y72 //y72

View File

@@ -4375,8 +4375,8 @@ bool GUI_App::is_user_login()
if (m_agent) { if (m_agent) {
return m_agent->is_user_login(); return m_agent->is_user_login();
} }
return false;
#endif #endif
return false;
} }

View File

@@ -3931,6 +3931,12 @@ void PartPlateList::set_default_wipe_tower_pos_for_plate(int plate_idx, bool ini
} }
} }
//y74
if( x < plate_bbox_x_max_local_coord * 0.8)
x = plate_bbox_x_max_local_coord * 0.8;
if ( y < plate_bbox_y_max_local_coord * 0.8)
y = plate_bbox_y_max_local_coord * 0.8;
ConfigOptionFloat wt_x_opt(x); ConfigOptionFloat wt_x_opt(x);
ConfigOptionFloat wt_y_opt(y); ConfigOptionFloat wt_y_opt(y);

View File

@@ -15760,6 +15760,20 @@ void Plater::export_gcode(bool prefer_removable)
); );
if (dlg.ShowModal() == wxID_OK) { if (dlg.ShowModal() == wxID_OK) {
output_path = into_path(dlg.GetPath()); output_path = into_path(dlg.GetPath());
delete_file_name_redundant_suffix(output_path, L".gcode");
if (boost::iends_with(output_path.string(), ".gcode")) {
std::wstring temp_path = output_path.wstring();
temp_path = temp_path.substr(0, temp_path.size() - 6);
output_path = temp_path + L".gcode";
}
else if (boost::iends_with(output_path.string(), ".gcode.gcode")) {//for mac
std::wstring temp_path = output_path.wstring();
temp_path = temp_path.substr(0, temp_path.size() - 16);
output_path = temp_path + L".gcode";
}
else if (!boost::iends_with(output_path.string(), ".gcode")) {
output_path = output_path.replace_extension(".gcode");
}
while (has_illegal_filename_characters(output_path.filename().string())) { while (has_illegal_filename_characters(output_path.filename().string())) {
show_error(this, _L("The provided file name is not valid.") + "\n" + show_error(this, _L("The provided file name is not valid.") + "\n" +
_L("The following characters are not allowed by a FAT file system:") + "#\'<>:\\|?*\""); _L("The following characters are not allowed by a FAT file system:") + "#\'<>:\\|?*\"");

View File

@@ -3459,7 +3459,7 @@ void SelectMachineDialog::on_rename_enter()
auto m_valid_type = Valid; auto m_valid_type = Valid;
wxString info_line; wxString info_line;
const char* unusable_symbols = " #;\'<>:\\|?*\""; const char* unusable_symbols = "#;\'<>:\\|?*\"";
const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)"; const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)";
for (size_t i = 0; i < std::strlen(unusable_symbols); i++) { for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {

View File

@@ -1715,7 +1715,7 @@ void SendMultiMachinePage::set_default()
//unsupported character filter //unsupported character filter
//y51 //y51
m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), " #;\'<>:\\|?*\"")); m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "#;\'<>:\\|?*\""));
m_task_name->SetLabel(m_current_project_name); m_task_name->SetLabel(m_current_project_name);
@@ -1752,7 +1752,7 @@ void SendMultiMachinePage::on_rename_enter()
wxString info_line; wxString info_line;
//y51 //y51
const char* unusable_symbols = " #;\'<>:\\|?*\""; const char* unusable_symbols = "#;\'<>:\\|?*\"";
const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)"; const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)";
for (size_t i = 0; i < std::strlen(unusable_symbols); i++) { for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {

View File

@@ -158,7 +158,7 @@ void SendToPrinterDialog::on_rename_enter()
wxString info_line; wxString info_line;
//y51 //y51
const char* unusable_symbols = " #;\'<>:\\|?*\""; const char* unusable_symbols = "#;\'<>:\\|?*\"";
const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)"; const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)";
for (size_t i = 0; i < std::strlen(unusable_symbols); i++) { for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {
@@ -2010,7 +2010,7 @@ void SendToPrinterDialog::set_default()
//unsupported character filter //unsupported character filter
//y51 //y51
m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), " #;\'<>:\\|?*\"")); m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "#;\'<>:\\|?*\""));
m_rename_text->SetLabelText(m_current_project_name); m_rename_text->SetLabelText(m_current_project_name);
m_rename_normal_panel->Layout(); m_rename_normal_panel->Layout();