mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-14 09:02:06 +00:00
FIX: support calibration for multi-nozzles with different diameters
github: 7543 Change-Id: Ifa20d786836f1991af35b3b95e25f91431d752e0 (cherry picked from commit 0c1053e962c928b253c268fc6658b8ec98f692ff)
This commit is contained in:
@@ -978,11 +978,17 @@ NozzleVolumeType CalibrationPresetPage::get_nozzle_volume_type(int extruder_id)
|
||||
|
||||
ExtruderType CalibrationPresetPage::get_extruder_type(int extruder_id) const
|
||||
{
|
||||
if (m_extrder_types.size() > extruder_id)
|
||||
return ExtruderType(m_extrder_types[extruder_id]);
|
||||
else {
|
||||
return ExtruderType::etDirectDrive;
|
||||
if (curr_obj) {
|
||||
int extruder_idx = 0;
|
||||
if (curr_obj->is_multi_extruders()) {
|
||||
if (extruder_id == RIGHT_EXTRUDER_ID) {
|
||||
extruder_idx = 1;
|
||||
}
|
||||
}
|
||||
if (m_extrder_types.size() > extruder_idx)
|
||||
return m_extrder_types[extruder_idx];
|
||||
}
|
||||
return ExtruderType::etDirectDrive;
|
||||
}
|
||||
|
||||
void CalibrationPresetPage::create_multi_extruder_filament_list_panel(wxWindow *parent)
|
||||
@@ -1734,17 +1740,17 @@ void CalibrationPresetPage::update_show_status()
|
||||
return;
|
||||
}
|
||||
|
||||
if (obj_->is_multi_extruders()) {
|
||||
float diameter = obj_->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
bool is_same_diameter = std::all_of(obj_->m_extder_data.extders.begin(), obj_->m_extder_data.extders.end(),
|
||||
[diameter](const Extder& extruder) {
|
||||
return std::fabs(extruder.current_nozzle_diameter - diameter) < EPSILON;
|
||||
});
|
||||
if (!is_same_diameter) {
|
||||
show_status(CaliPresetPageStatus::CaliPresetStatusDifferentNozzleDiameters);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//if (obj_->is_multi_extruders()) {
|
||||
// float diameter = obj_->m_extder_data.extders[0].current_nozzle_diameter;
|
||||
// bool is_same_diameter = std::all_of(obj_->m_extder_data.extders.begin(), obj_->m_extder_data.extders.end(),
|
||||
// [diameter](const Extder& extruder) {
|
||||
// return std::fabs(extruder.current_nozzle_diameter - diameter) < EPSILON;
|
||||
// });
|
||||
// if (!is_same_diameter) {
|
||||
// show_status(CaliPresetPageStatus::CaliPresetStatusDifferentNozzleDiameters);
|
||||
// return;
|
||||
// }
|
||||
//}
|
||||
|
||||
// check sdcard when if lan mode printer
|
||||
if (obj_->is_lan_mode_printer()) {
|
||||
|
||||
@@ -13834,7 +13834,7 @@ void Plater::export_core_3mf()
|
||||
export_3mf(path_u8, SaveStrategy::Silence);
|
||||
}
|
||||
|
||||
Preset *get_printer_preset(MachineObject *obj)
|
||||
Preset *get_printer_preset(const MachineObject *obj)
|
||||
{
|
||||
if (!obj)
|
||||
return nullptr;
|
||||
|
||||
@@ -947,7 +947,7 @@ private:
|
||||
|
||||
std::vector<int> get_min_flush_volumes(const DynamicPrintConfig &full_config, size_t nozzle_id);
|
||||
|
||||
Preset *get_printer_preset(MachineObject *obj);
|
||||
Preset *get_printer_preset(const MachineObject *obj);
|
||||
wxArrayString get_all_camera_view_type();
|
||||
|
||||
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
#include "slic3r/GUI/Jobs/BoostThreadWorker.hpp"
|
||||
#include "slic3r/GUI/Jobs/PlaterWorker.hpp"
|
||||
#include "../GUI/MsgDialog.hpp"
|
||||
#include "../GUI/Plater.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
@@ -78,6 +79,16 @@ wxString get_nozzle_volume_type_name(NozzleVolumeType type)
|
||||
return wxString();
|
||||
}
|
||||
|
||||
static int get_physical_extruder_idx(std::vector<int> physical_extruder_maps, int extruder_id)
|
||||
{
|
||||
for (size_t index = 0; index < physical_extruder_maps.size(); ++index) {
|
||||
if (physical_extruder_maps[index] == extruder_id) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return extruder_id;
|
||||
}
|
||||
|
||||
void get_tray_ams_and_slot_id(MachineObject* obj, int in_tray_id, int &ams_id, int &slot_id, int &tray_id)
|
||||
{
|
||||
assert(obj);
|
||||
@@ -1117,26 +1128,13 @@ bool CalibUtils::check_printable_status_before_cali(const MachineObject *obj, co
|
||||
return false;
|
||||
}
|
||||
|
||||
float cali_diameter = cali_infos.calib_datas[0].nozzle_diameter;
|
||||
int extruder_id = cali_infos.calib_datas[0].extruder_id;
|
||||
for (const auto& cali_info : cali_infos.calib_datas) {
|
||||
if (cali_infos.cali_mode == CalibMode::Calib_PA_Line && !is_support_auto_pa_cali(cali_info.filament_id)) {
|
||||
error_message = _L("TPU 90A/TPU 85A is too soft and does not support automatic Flow Dynamics calibration.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_approx(cali_diameter, cali_info.nozzle_diameter)) {
|
||||
error_message = _L("Automatic calibration only supports cases where the left and right nozzle diameters are identical.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (extruder_id >= obj->m_extder_data.extders.size()) {
|
||||
error_message = _L("The number of printer extruders and the printer selected for calibration does not match.");
|
||||
return false;
|
||||
}
|
||||
|
||||
float diameter = obj->m_extder_data.extders[extruder_id].current_nozzle_diameter;
|
||||
bool is_multi_extruder = obj->is_multi_extruders();
|
||||
std::vector<NozzleFlowType> nozzle_volume_types;
|
||||
if (is_multi_extruder) {
|
||||
@@ -1145,12 +1143,24 @@ bool CalibUtils::check_printable_status_before_cali(const MachineObject *obj, co
|
||||
}
|
||||
}
|
||||
|
||||
Preset *printer_preset = get_printer_preset(obj);
|
||||
|
||||
for (const auto &cali_info : cali_infos.calib_datas) {
|
||||
wxString name = _L("left");
|
||||
if (cali_info.extruder_id == 0) {
|
||||
name = _L("right");
|
||||
}
|
||||
|
||||
float cali_diameter = cali_info.nozzle_diameter;
|
||||
int extruder_id = cali_info.extruder_id;
|
||||
|
||||
if (extruder_id >= obj->m_extder_data.extders.size()) {
|
||||
error_message = _L("The number of printer extruders and the printer selected for calibration does not match.");
|
||||
return false;
|
||||
}
|
||||
|
||||
float diameter = obj->m_extder_data.extders[extruder_id].current_nozzle_diameter;
|
||||
|
||||
if (!is_approx(cali_info.nozzle_diameter, diameter)) {
|
||||
if (is_multi_extruder)
|
||||
error_message = wxString::Format(_L("The currently selected nozzle diameter of %s extruder does not match the actual nozzle diameter.\n"
|
||||
|
||||
Reference in New Issue
Block a user