mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +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:
@@ -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