FIX: update the text

jira: [STUDIO-11676]
Change-Id: I7c5139fd3f81d0b1f83aef938e7ac248a0ed3887
This commit is contained in:
xin.zhang 2025-04-21 10:32:56 +08:00 committed by lane.wei
parent 5a0cf116e3
commit b609a45079
2 changed files with 20 additions and 7 deletions

View File

@ -2021,7 +2021,7 @@ bool SelectMachineDialog::is_same_nozzle_diameters(float &tag_nozzle_diameter, i
return true;
}
bool SelectMachineDialog::is_same_nozzle_type(const Extder& extruder, std::string& filament_type) const
bool SelectMachineDialog::is_nozzle_hrc_matched(const Extder& extruder, std::string& filament_type) const
{
auto printer_nozzle_hrc = Print::get_hrc_by_nozzle_type(extruder.current_nozzle_type);
@ -3360,6 +3360,19 @@ static wxString _check_kval_not_default(const MachineObject* obj, const std::vec
return ams_names;
}
static wxString _get_nozzle_name(int total_ext_count, int ext_id)
{
if (total_ext_count == 2) {
if (ext_id == MAIN_NOZZLE_ID) {
return _L("right nozzle");
} else {
return _L("left nozzle");
}
}
return _L("nozzle");
}
void SelectMachineDialog::update_show_status()
{
// refreshing return
@ -3574,12 +3587,12 @@ void SelectMachineDialog::update_show_status()
if (used_nozzle_idxes.count(extder.nozzle_id) == 0) { continue; }
std::string filament_type;
if (!is_same_nozzle_type(extder, filament_type))
{
if (!is_nozzle_hrc_matched(extder, filament_type)) {
std::vector<wxString> error_msg;
error_msg.emplace_back(wxString::Format(_L("Printing high temperature material(%s) with %s nozzle may cause nozzle damage, please check the type of nozzle"),
filament_type, format_steel_name(extder.current_nozzle_type)));
return show_status(PrintDialogStatus::PrintStatusNozzleTypeMismatch, error_msg);
error_msg.emplace_back(wxString::Format(_L("The hardness of current material (%s) exceeds the hardness of %s(%s). Please verify the nozzle or material settings and try again."),
filament_type, _get_nozzle_name(obj_->m_extder_data.total_extder_count, extder.nozzle_id), format_steel_name(extder.current_nozzle_type)));
show_status(PrintDialogStatus::PrintStatusNozzleTypeMismatch, error_msg);
return;
}
}
}

View File

@ -542,7 +542,7 @@ public:
bool is_blocking_printing(MachineObject* obj_);
bool is_nozzle_data_valid(const ExtderData& ext_data) const;
bool is_same_nozzle_diameters(float& tag_nozzle_diameter, int& mismatch_nozzle_id) const;
bool is_same_nozzle_type(const Extder& extruder, std::string& filament_type) const;
bool is_nozzle_hrc_matched(const Extder& extruder, std::string& filament_type) const;
bool has_tips(MachineObject* obj);
bool is_timeout();
int update_print_required_data(Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name, std::string file_path);