mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-30 06:12:12 +00:00
ENH: some tpu filaments are not support auto cali
jira: none Change-Id: I253e5c5936bc5fb90612f385e358b3015bdabf2e (cherry picked from commit f38d8f959fabd36e4971c9b58eac193eb30fcd8f)
This commit is contained in:
@@ -725,6 +725,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()) {
|
||||
@@ -1185,6 +1186,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);
|
||||
|
||||
@@ -7419,6 +7419,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;
|
||||
|
||||
@@ -1416,6 +1416,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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1924,6 +1931,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
|
||||
@@ -3404,6 +3414,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)
|
||||
{
|
||||
@@ -3581,6 +3596,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;
|
||||
|
||||
@@ -105,7 +105,8 @@ enum PrintDialogStatus {
|
||||
PrintStatusMixAmsAndVtSlotWarning,
|
||||
PrintStatusPublicInitFailed,
|
||||
PrintStatusPublicUploadFiled,
|
||||
PrintStatusInvalidMapping
|
||||
PrintStatusInvalidMapping,
|
||||
PrintStatusTPUUnsupportAutoCali
|
||||
};
|
||||
|
||||
|
||||
@@ -493,6 +494,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;
|
||||
|
||||
Reference in New Issue
Block a user