mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-16 21:42:43 +00:00
fix: make model_id/dev_type optional instead of blocking
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "Jobs/PlaterWorker.hpp"
|
||||
|
||||
#include "DeviceCore/DevConfig.h"
|
||||
#include "DeviceCore/DevConfigUtil.h"
|
||||
#include "DeviceCore/DevNozzleSystem.h"
|
||||
#include "DeviceCore/DevNozzleRack.h"
|
||||
#include "DeviceCore/DevExtensionTool.h"
|
||||
@@ -2315,8 +2316,10 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
} else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
}else if (status == PrintDialogStatus::PrintStatusUnsupportedPrinter) {
|
||||
}else if (status == PrintDialogStatus::PrintStatusUnsupportedPrinter ||
|
||||
status == PrintDialogStatus::PrintStatusOptionalPrinterModel) {
|
||||
wxString msg_text;
|
||||
const bool block_send = status == PrintDialogStatus::PrintStatusUnsupportedPrinter;
|
||||
try
|
||||
{
|
||||
DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
@@ -2342,17 +2345,21 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
||||
|
||||
auto target_print_name = wxString(DevPrinterConfigUtil::get_printer_display_name(target_model_id));
|
||||
target_print_name.Replace(wxT("Bambu Lab "), wxEmptyString);
|
||||
msg_text = wxString::Format(_L("The selected printer (%s) is incompatible with the print file configuration (%s). Please adjust the printer preset in the prepare page or choose a compatible printer on this page."), sourcet_print_name, target_print_name);
|
||||
if (block_send) {
|
||||
msg_text = wxString::Format(_L("The selected printer (%s) is incompatible with the print file configuration (%s). Please adjust the printer preset in the prepare page or choose a compatible printer on this page."), sourcet_print_name, target_print_name);
|
||||
} else {
|
||||
msg_text = wxString::Format(_L("The selected printer (%s) has an unknown model, so compatibility with the print file configuration (%s) cannot be verified. Please verify the printer preset before sending."), sourcet_print_name, target_print_name);
|
||||
}
|
||||
|
||||
|
||||
msg = msg_text;
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Send_Button(!block_send);
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
Enable_Refresh_Button(true);
|
||||
Enable_Send_Button(false);
|
||||
Enable_Send_Button(!block_send);
|
||||
}
|
||||
|
||||
|
||||
@@ -2529,6 +2536,11 @@ bool SelectMachineDialog::is_blocking_printing(MachineObject* obj_)
|
||||
}
|
||||
}
|
||||
|
||||
if (DevPrinterConfigUtil::is_optional_printer_model_id(source_model) ||
|
||||
DevPrinterConfigUtil::is_optional_printer_model_id(target_model)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (source_model != target_model) {
|
||||
std::vector<std::string> compatible_machine = obj_->get_compatible_machine();
|
||||
vector<std::string>::iterator it = find(compatible_machine.begin(), compatible_machine.end(), source_model);
|
||||
@@ -2625,6 +2637,10 @@ bool SelectMachineDialog::is_same_printer_model()
|
||||
if(preset_bundle == nullptr) return result;
|
||||
const auto source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
|
||||
const auto target_model = obj_->printer_type;
|
||||
if (DevPrinterConfigUtil::is_optional_printer_model_id(source_model) ||
|
||||
DevPrinterConfigUtil::is_optional_printer_model_id(target_model)) {
|
||||
return true;
|
||||
}
|
||||
// Orca: ignore P1P -> P1S
|
||||
if (source_model != target_model) {
|
||||
if ((source_model == "C12" && target_model == "C11") || (source_model == "C11" && target_model == "C12") ||
|
||||
@@ -4786,6 +4802,22 @@ void SelectMachineDialog::update_show_status(MachineObject* obj_)
|
||||
return;
|
||||
}
|
||||
|
||||
bool has_optional_printer_model = DevPrinterConfigUtil::is_optional_printer_model_id(obj_->printer_type);
|
||||
if (m_print_type == PrintFromType::FROM_NORMAL) {
|
||||
PresetBundle* preset_bundle = wxGetApp().preset_bundle;
|
||||
has_optional_printer_model = has_optional_printer_model ||
|
||||
(preset_bundle && DevPrinterConfigUtil::is_optional_printer_model_id(
|
||||
preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle)));
|
||||
} else if (m_print_type == PrintFromType::FROM_SDCARD_VIEW && !m_required_data_plate_data_list.empty()) {
|
||||
has_optional_printer_model = has_optional_printer_model ||
|
||||
DevPrinterConfigUtil::is_optional_printer_model_id(
|
||||
m_required_data_plate_data_list[m_print_plate_idx]->printer_model_id);
|
||||
}
|
||||
|
||||
if (has_optional_printer_model) {
|
||||
show_status(PrintDialogStatus::PrintStatusOptionalPrinterModel);
|
||||
}
|
||||
|
||||
if (is_blocking_printing(obj_)) {
|
||||
show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user