From 5b4ece44e7c45c89c00ecb46647178ec25cbb512 Mon Sep 17 00:00:00 2001 From: tao wang Date: Fri, 24 Nov 2023 16:13:10 +0800 Subject: [PATCH] FIX:fixed issue with lan mode jira:[STUDIO-5189] Change-Id: I1d0a05f19dcea154cf3ef2b61ed0546d3581905e --- src/slic3r/GUI/DeviceManager.cpp | 2 ++ src/slic3r/GUI/SelectMachine.cpp | 7 ++----- src/slic3r/GUI/SelectMachine.hpp | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/slic3r/GUI/DeviceManager.cpp b/src/slic3r/GUI/DeviceManager.cpp index 403fa9d13..768f115ab 100644 --- a/src/slic3r/GUI/DeviceManager.cpp +++ b/src/slic3r/GUI/DeviceManager.cpp @@ -376,6 +376,8 @@ std::string MachineObject::parse_printer_type(std::string type_str) return "BL-P001"; } else if (type_str.compare("BL-P001") == 0) { return type_str; + } else if (type_str.compare("BL-P002") == 0) { + return type_str; } else { return DeviceManager::parse_printer_type(type_str); } diff --git a/src/slic3r/GUI/SelectMachine.cpp b/src/slic3r/GUI/SelectMachine.cpp index c940e76be..80ad455d1 100644 --- a/src/slic3r/GUI/SelectMachine.cpp +++ b/src/slic3r/GUI/SelectMachine.cpp @@ -2214,14 +2214,11 @@ void SelectMachineDialog::on_cancel(wxCloseEvent &event) this->EndModal(wxID_CANCEL); } -bool SelectMachineDialog::is_blocking_printing() +bool SelectMachineDialog::is_blocking_printing(MachineObject* obj_) { DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager(); if (!dev) return true; - MachineObject* obj_ = dev->get_selected_machine(); - if (obj_ == nullptr) return true; - PresetBundle* preset_bundle = wxGetApp().preset_bundle; auto source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle); auto target_model = obj_->printer_type; @@ -3413,7 +3410,7 @@ void SelectMachineDialog::update_show_status() } } - if (m_print_type == PrintFromType::FROM_NORMAL && is_blocking_printing()) { + if (m_print_type == PrintFromType::FROM_NORMAL && is_blocking_printing(obj_)) { show_status(PrintDialogStatus::PrintStatusUnsupportedPrinter); return; } diff --git a/src/slic3r/GUI/SelectMachine.hpp b/src/slic3r/GUI/SelectMachine.hpp index ad51a8499..35c1f9a68 100644 --- a/src/slic3r/GUI/SelectMachine.hpp +++ b/src/slic3r/GUI/SelectMachine.hpp @@ -450,7 +450,7 @@ public: bool has_timelapse_warning(); void update_timelapse_enable_status(); bool is_same_printer_model(); - bool is_blocking_printing(); + bool is_blocking_printing(MachineObject* obj_); bool is_same_nozzle_diameters(std::string& nozzle_type, std::string& nozzle_diameter); bool is_same_nozzle_type(std::string& filament_type, std::string& tag_nozzle_type); bool has_tips(MachineObject* obj);