mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-09-28 19:33:11 +08:00
Revert "ENH:support checking the complete material blacklist"
This reverts commit 86c43077dead8255a6d28b21dc03523c42e1defc. Reason for revert: <test> Change-Id: I624441b210d7202661fb667ebb4d53f0c6d105df
This commit is contained in:
parent
70d1a22974
commit
504bfbf0b4
@ -1070,10 +1070,8 @@ int MachineObject::ams_filament_mapping(
|
||||
// mapping algorithm
|
||||
for (int i = 0; i < filaments.size(); i++) {
|
||||
FilamentInfo info;
|
||||
info.id = filaments[i].id;
|
||||
info.tray_id = -1;
|
||||
info.type = filaments[i].type;
|
||||
info.filament_id = filaments[i].filament_id;
|
||||
info.id = filaments[i].id;
|
||||
info.tray_id = -1;
|
||||
result.push_back(info);
|
||||
}
|
||||
|
||||
@ -1118,22 +1116,24 @@ int MachineObject::ams_filament_mapping(
|
||||
}
|
||||
if (picked_src_idx >= 0 && picked_tar_idx >= 0) {
|
||||
auto tray = tray_filaments.find(distance_map[k][picked_tar_idx].tray_id);
|
||||
|
||||
if (tray != tray_filaments.end()) {
|
||||
result[picked_src_idx].tray_id = tray->first;
|
||||
|
||||
result[picked_src_idx].color = tray->second.color;
|
||||
result[picked_src_idx].type = tray->second.type;
|
||||
result[picked_src_idx].distance = tray->second.distance;
|
||||
result[picked_src_idx].color = tray->second.color;
|
||||
result[picked_src_idx].type = tray->second.type;
|
||||
result[picked_src_idx].distance = tray->second.distance;
|
||||
result[picked_src_idx].filament_id = tray->second.filament_id;
|
||||
result[picked_src_idx].ctype = tray->second.ctype;
|
||||
result[picked_src_idx].colors = tray->second.colors;
|
||||
result[picked_src_idx].ctype = tray->second.ctype;
|
||||
result[picked_src_idx].colors = tray->second.colors;
|
||||
|
||||
|
||||
/*for new ams mapping*/
|
||||
result[picked_src_idx].ams_id = tray->second.ams_id;
|
||||
result[picked_src_idx].slot_id = tray->second.slot_id;
|
||||
}
|
||||
|
||||
else {
|
||||
FilamentInfo info;
|
||||
info.tray_id = -1;
|
||||
}
|
||||
::sprintf(buffer, "ams_mapping, picked F(%02d) AMS(%02d), distance=%6.0f", picked_src_idx+1, picked_tar_idx+1,
|
||||
distance_map[picked_src_idx][picked_tar_idx].distance);
|
||||
BOOST_LOG_TRIVIAL(info) << std::string(buffer);
|
||||
|
@ -65,7 +65,6 @@ enum PrintDialogStatus : unsigned int {
|
||||
PrintStatusAmsMappingU0Invalid,
|
||||
PrintStatusAmsMappingMixInvalid,
|
||||
PrintStatusTPUUnsupportAutoCali,
|
||||
PrintStatusHasFilamentInBlackList,
|
||||
PrintStatusFilamentErrorEnd,
|
||||
|
||||
PrintStatusErrorEnd,//->end error<-
|
||||
@ -116,7 +115,7 @@ public:
|
||||
static ::std::string get_print_status_info(PrintDialogStatus status);
|
||||
|
||||
wxString get_pre_state_msg(PrintDialogStatus status);
|
||||
bool is_error(PrintDialogStatus status) { return (PrintStatusErrorBegin < status) && (PrintStatusErrorEnd > status); };
|
||||
bool is_error(PrintDialogStatus status) { return (PrintStatusErrorBegin < status) && (PrintStatusErrorEnd > status); };
|
||||
bool is_error_printer(PrintDialogStatus status) { return (PrintStatusPrinterErrorBegin < status) && (PrintStatusPrinterErrorEnd > status); };
|
||||
bool is_error_filament(PrintDialogStatus status) { return (PrintStatusFilamentErrorBegin < status) && (PrintStatusFilamentErrorEnd > status); };
|
||||
bool is_warning(PrintDialogStatus status) { return (PrintStatusWarningBegin < status) && (PrintStatusWarningEnd > status); };
|
||||
|
@ -1804,15 +1804,13 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
msg = msg_text;
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(true);
|
||||
} else if (status == PrintStatusMixAmsAndVtSlotWarning) {
|
||||
}
|
||||
else if (status == PrintStatusMixAmsAndVtSlotWarning) {
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(true);
|
||||
} else if (status == PrintStatusTPUUnsupportAutoCali) {
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
} else if (status == PrintStatusHasFilamentInBlackList) {
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
} else if (status == PrintStatusWarningKvalueNotUsed) {
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(true);
|
||||
@ -2034,6 +2032,7 @@ void SelectMachineDialog::show_errors(wxString &info)
|
||||
|
||||
void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
{
|
||||
|
||||
bool has_slice_warnings = false;
|
||||
bool is_printing_block = false;
|
||||
|
||||
@ -2126,6 +2125,11 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
auto mapping_result = m_mapping_popup.parse_ams_mapping(obj_->amsList);
|
||||
auto has_unknown_filament = false;
|
||||
|
||||
// check if ams mapping is has errors, tpu
|
||||
bool has_prohibited_filament = false;
|
||||
wxString prohibited_error = wxEmptyString;
|
||||
|
||||
|
||||
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
|
||||
|
||||
const auto& ams_id = m_ams_mapping_result[i].get_ams_id();
|
||||
@ -2144,6 +2148,16 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
}
|
||||
}
|
||||
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
DeviceManager::check_filaments_in_blacklist(obj_->printer_type, filament_brand, filament_type, ams_id, slot_id, "", in_blacklist, action, info);
|
||||
|
||||
if (in_blacklist && action == "prohibition") {
|
||||
has_prohibited_filament = true;
|
||||
prohibited_error = wxString::FromUTF8(info);
|
||||
}
|
||||
|
||||
for (auto miter : mapping_result) {
|
||||
//matching
|
||||
if (miter.id == tid) {
|
||||
@ -2155,6 +2169,12 @@ void SelectMachineDialog::on_ok_btn(wxCommandEvent &event)
|
||||
}
|
||||
}
|
||||
|
||||
if (has_prohibited_filament && obj_->has_ams()) {
|
||||
wxString tpu_tips = prohibited_error;
|
||||
show_errors(tpu_tips);
|
||||
return;
|
||||
}
|
||||
|
||||
if (has_unknown_filament) {
|
||||
has_slice_warnings = true;
|
||||
confirm_text.push_back(ConfirmBeforeSendInfo(_L("There are some unknown filaments in the AMS mappings. Please check whether they are the required filaments. If they are okay, press \"Confirm\" to start printing.")));
|
||||
@ -3498,35 +3518,6 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
||||
return;
|
||||
}
|
||||
|
||||
// filaments check for black list
|
||||
for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
|
||||
const auto &ams_id = m_ams_mapping_result[i].get_ams_id();
|
||||
const auto &slot_id = m_ams_mapping_result[i].get_slot_id();
|
||||
|
||||
auto tid = m_ams_mapping_result[i].tray_id;
|
||||
|
||||
std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
|
||||
std::string filament_brand;
|
||||
|
||||
for (auto fs : m_filaments) {
|
||||
if (fs.id == m_ams_mapping_result[i].id) { filament_brand = m_filaments[i].brand; }
|
||||
}
|
||||
|
||||
bool in_blacklist = false;
|
||||
std::string action;
|
||||
std::string info;
|
||||
|
||||
DeviceManager::check_filaments_in_blacklist(obj_->printer_type, filament_brand, filament_type, m_ams_mapping_result[i].filament_id, ams_id, slot_id, "", in_blacklist,
|
||||
action, info);
|
||||
|
||||
if (in_blacklist && action == "prohibition") {
|
||||
std::vector<wxString> error_msg;
|
||||
error_msg.emplace_back(info);
|
||||
show_status(PrintDialogStatus::PrintStatusHasFilamentInBlackList, error_msg);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/** warning check **/
|
||||
struct ExtruderStatus
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user