ENH: some tpu filaments are not support auto cali
jira: none Change-Id: I253e5c5936bc5fb90612f385e358b3015bdabf2e
This commit is contained in:
parent
04bed7f239
commit
f38d8f959f
|
@ -45,6 +45,7 @@
|
|||
},
|
||||
"model_id": "BL-P001",
|
||||
"compatible_machine": [ "BL-P002", "C11", "C12", "C13" ],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "3DPrinter-X1-Carbon",
|
||||
"printer_thumbnail_image": "printer_thumbnail",
|
||||
"printer_connect_help_image": "input_access_code_x1",
|
||||
|
|
|
@ -45,6 +45,7 @@
|
|||
},
|
||||
"model_id": "BL-P002",
|
||||
"compatible_machine": [ "BL-P001", "C11", "C12", "C13" ],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "3DPrinter-X1",
|
||||
"printer_thumbnail_image": "printer_thumbnail",
|
||||
"printer_connect_help_image": "input_access_code_x1",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
},
|
||||
"model_id": "C11",
|
||||
"compatible_machine": [ "BL-P001", "BL-P002", "C12", "C13" ],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "C11",
|
||||
"ftp_folder": "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1p",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
},
|
||||
"model_id": "C12",
|
||||
"compatible_machine": [ "BL-P001", "BL-P002", "C11", "C13" ],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "C12",
|
||||
"ftp_folder": "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1s",
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
},
|
||||
"model_id": "C13",
|
||||
"compatible_machine": [ "BL-P001", "BL-P002", "C11", "C12" ],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "C13",
|
||||
"printer_thumbnail_image": "printer_thumbnail",
|
||||
"printer_connect_help_image": "input_access_code_x1",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
},
|
||||
"model_id": "N1",
|
||||
"compatible_machine": [],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "N1",
|
||||
"ftp_folder": "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_n1",
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
},
|
||||
"model_id": "N2S",
|
||||
"compatible_machine": [],
|
||||
"auto_cali_not_support_filaments": [ "GFU03", "GFU04" ],
|
||||
"printer_type": "N2S",
|
||||
"ftp_folder": "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_n2s",
|
||||
|
|
|
@ -67,6 +67,7 @@ public:
|
|||
};
|
||||
|
||||
std::vector<X1CCalibInfo> calib_datas;
|
||||
CalibMode cali_mode{ CalibMode::Calib_None };
|
||||
};
|
||||
|
||||
class CaliPresetInfo
|
||||
|
|
|
@ -726,6 +726,7 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
calib_info.max_volumetric_speed = max_volumetric_speed;
|
||||
calib_infos.calib_datas.push_back(calib_info);
|
||||
}
|
||||
calib_infos.cali_mode = CalibMode::Calib_PA_Line;
|
||||
CalibUtils::calib_PA(calib_infos, 0, wx_err_string); // mode = 0 for auto
|
||||
|
||||
if (!wx_err_string.empty()) {
|
||||
|
@ -1186,6 +1187,7 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
calib_info.flow_rate = flow_ratio;
|
||||
calib_infos.calib_datas.push_back(calib_info);
|
||||
}
|
||||
calib_infos.cali_mode = CalibMode::Calib_Flow_Rate;
|
||||
|
||||
wxString wx_err_string;
|
||||
CalibUtils::calib_flowrate_X1C(calib_infos, wx_err_string);
|
||||
|
|
|
@ -7402,6 +7402,27 @@ std::vector<std::string> DeviceManager::get_compatible_machine(std::string type_
|
|||
return compatible_machine;
|
||||
}
|
||||
|
||||
std::vector<std::string> DeviceManager::get_unsupport_auto_cali_filaments(std::string type_str)
|
||||
{
|
||||
std::vector<std::string> filaments;
|
||||
std::string config_file = Slic3r::resources_dir() + "/printers/" + type_str + ".json";
|
||||
boost::nowide::ifstream json_file(config_file.c_str());
|
||||
try {
|
||||
json jj;
|
||||
if (json_file.is_open()) {
|
||||
json_file >> jj;
|
||||
if (jj.contains("00.00.00.00")) {
|
||||
json const &printer = jj["00.00.00.00"];
|
||||
if (printer.contains("auto_cali_not_support_filaments")) {
|
||||
for (auto res : printer["auto_cali_not_support_filaments"])
|
||||
filaments.emplace_back(res.get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (...) {}
|
||||
return filaments;
|
||||
}
|
||||
|
||||
boost::bimaps::bimap<std::string, std::string> DeviceManager::get_all_model_id_with_name()
|
||||
{
|
||||
boost::bimaps::bimap<std::string, std::string> models;
|
||||
|
|
|
@ -1413,6 +1413,7 @@ public:
|
|||
static bool load_filaments_blacklist_config();
|
||||
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||
static std::vector<std::string> get_compatible_machine(std::string type_str);
|
||||
static std::vector<std::string> get_unsupport_auto_cali_filaments(std::string type_str);
|
||||
static void check_filaments_in_blacklist(std::string model_id, std::string tag_vendor, std::string tag_type, int ams_id, int slot_id, std::string tag_name, bool &in_blacklist, std::string &ac, std::string &info);
|
||||
static bool check_filaments_printable(const std::string &tag_vendor, const std::string &tag_type, int ams_id, bool &in_blacklist, std::string &ac, std::string &info);
|
||||
static boost::bimaps::bimap<std::string, std::string> get_all_model_id_with_name();
|
||||
|
|
|
@ -1004,11 +1004,18 @@ void SelectMachineDialog::update_select_layout(MachineObject *obj)
|
|||
m_checkbox_list["flow_cali"]->update_options(ops_auto);
|
||||
m_checkbox_list["flow_cali"]->setValue("auto");
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->update_options(ops_no_auto);
|
||||
if (config && config->get("print", "flow_cali") == "0") {
|
||||
if (can_support_auto_cali()) {
|
||||
m_checkbox_list["flow_cali"]->update_options(ops_no_auto);
|
||||
if (config && config->get("print", "flow_cali") == "0") {
|
||||
m_checkbox_list["flow_cali"]->setValue("off");
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->setValue("on");
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_checkbox_list["flow_cali"]->setValue("off");
|
||||
} else {
|
||||
m_checkbox_list["flow_cali"]->setValue("on");
|
||||
if (config)
|
||||
config->set_str("print", "flow_cali", "0");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1926,6 +1933,9 @@ void SelectMachineDialog::show_status(PrintDialogStatus status, std::vector<wxSt
|
|||
else if (status == PrintStatusMixAmsAndVtSlotWarning) {
|
||||
wxString msg_text = _L("You have selected both external and AMS filaments for an extruder. You will need to manually switch the external filament during printing.");
|
||||
update_print_status_msg(msg_text, false, true, true);
|
||||
} else if (status == PrintStatusTPUUnsupportAutoCali) {
|
||||
wxString msg_text = _L("TPU 90A/TPU 85A is too soft and does not support automatic Flow Dynamics calibration.");
|
||||
update_print_status_msg(msg_text, false, false, true);
|
||||
}
|
||||
|
||||
// m_panel_warn m_simplebook
|
||||
|
@ -3422,6 +3432,11 @@ void SelectMachineDialog::update_show_status()
|
|||
}
|
||||
}
|
||||
|
||||
if (!can_support_auto_cali() && m_checkbox_list["flow_cali"]->getValue() == "on") {
|
||||
show_status(PrintDialogStatus::PrintStatusTPUUnsupportAutoCali);
|
||||
return;
|
||||
}
|
||||
|
||||
// check nozzle type and diameter
|
||||
if (m_print_type == PrintFromType::FROM_NORMAL)
|
||||
{
|
||||
|
@ -3599,6 +3614,28 @@ bool SelectMachineDialog::has_timelapse_warning()
|
|||
return false;
|
||||
}
|
||||
|
||||
bool SelectMachineDialog::can_support_auto_cali()
|
||||
{
|
||||
DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
|
||||
if (!dev)
|
||||
return true;
|
||||
MachineObject *obj = dev->get_selected_machine();
|
||||
if (!obj)
|
||||
return true;
|
||||
|
||||
std::vector<std::string> unsupport_auto_cali_filaments = DeviceManager::get_unsupport_auto_cali_filaments(obj->printer_type);
|
||||
if (!unsupport_auto_cali_filaments.empty()) {
|
||||
auto iter = std::find_if(m_filaments.begin(), m_filaments.end(),
|
||||
[&unsupport_auto_cali_filaments](const FilamentInfo &item) {
|
||||
auto iter = std::find(unsupport_auto_cali_filaments.begin(), unsupport_auto_cali_filaments.end(), item.filament_id);
|
||||
return iter != unsupport_auto_cali_filaments.end();
|
||||
});
|
||||
|
||||
return iter == m_filaments.end();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
void SelectMachineDialog::update_timelapse_enable_status()
|
||||
{
|
||||
AppConfig *config = wxGetApp().app_config;
|
||||
|
|
|
@ -103,7 +103,8 @@ enum PrintDialogStatus {
|
|||
PrintStatusMixAmsAndVtSlotWarning,
|
||||
PrintStatusPublicInitFailed,
|
||||
PrintStatusPublicUploadFiled,
|
||||
PrintStatusInvalidMapping
|
||||
PrintStatusInvalidMapping,
|
||||
PrintStatusTPUUnsupportAutoCali
|
||||
};
|
||||
|
||||
class Material
|
||||
|
@ -490,6 +491,7 @@ public:
|
|||
void set_flow_calibration_state(bool state, bool show_tips = true);
|
||||
bool has_timelapse_warning();
|
||||
void update_timelapse_enable_status();
|
||||
bool can_support_auto_cali();
|
||||
bool is_same_printer_model();
|
||||
bool is_blocking_printing(MachineObject* obj_);
|
||||
bool is_nozzle_data_valid(const ExtderData& ext_data) const;
|
||||
|
|
|
@ -31,6 +31,11 @@ static std::string MachineBedTypeString[6] = {
|
|||
"suprtack"
|
||||
};
|
||||
|
||||
std::vector<std::string> not_support_auto_pa_cali_filaments = {
|
||||
"GFU03", // TPU 90A
|
||||
"GFU04" // TPU 85A
|
||||
};
|
||||
|
||||
void get_default_k_n_value(const std::string &filament_id, float &k, float &n)
|
||||
{
|
||||
if (filament_id.compare("GFG00") == 0) {
|
||||
|
@ -1105,6 +1110,15 @@ void CalibUtils::calib_retraction(const CalibInfo &calib_info, wxString &error_m
|
|||
send_to_print(calib_info, error_message);
|
||||
}
|
||||
|
||||
bool CalibUtils::is_support_auto_pa_cali(std::string filament_id)
|
||||
{
|
||||
auto iter = std::find(not_support_auto_pa_cali_filaments.begin(), not_support_auto_pa_cali_filaments.end(), filament_id);
|
||||
if (iter != not_support_auto_pa_cali_filaments.end()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
int CalibUtils::get_selected_calib_idx(const std::vector<PACalibResult> &pa_calib_values, int cali_idx) {
|
||||
for (int i = 0; i < pa_calib_values.size(); ++i) {
|
||||
if(pa_calib_values[i].cali_idx == cali_idx)
|
||||
|
@ -1137,6 +1151,11 @@ bool CalibUtils::check_printable_status_before_cali(const MachineObject *obj, co
|
|||
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;
|
||||
|
|
|
@ -64,6 +64,8 @@ public:
|
|||
static void calib_retraction(const CalibInfo &calib_info, wxString &error_message);
|
||||
|
||||
//help function
|
||||
static bool is_support_auto_pa_cali(std::string filament_id);
|
||||
|
||||
static int get_selected_calib_idx(const std::vector<PACalibResult> &pa_calib_values, int cali_idx);
|
||||
static bool get_pa_k_n_value_by_cali_idx(const MachineObject* obj, int cali_idx, float& out_k, float& out_n);
|
||||
|
||||
|
|
Loading…
Reference in New Issue