FIX: user can accept nozzle wear to continue sending calibration
even if the nozzle type does not match github: 3365 Change-Id: If35dac3f4844b950ffc11f243c479074bb68687a
This commit is contained in:
parent
e9b33cfcb9
commit
c15d54eb74
|
@ -641,11 +641,11 @@ void PressureAdvanceWizard::on_cali_start()
|
|||
cali_page->set_pa_cali_image(int(pa_cali_method));
|
||||
curr_obj->manual_pa_cali_method = pa_cali_method;
|
||||
|
||||
CalibUtils::calib_generic_PA(calib_info, wx_err_string);
|
||||
|
||||
if (!CalibUtils::calib_generic_PA(calib_info, wx_err_string)) {
|
||||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1003,7 +1003,13 @@ void FlowRateWizard::on_cali_start(CaliPresetStage stage, float cali_value, Flow
|
|||
calib_info.filament_prest = temp_filament_preset;
|
||||
|
||||
if (cali_stage > 0) {
|
||||
CalibUtils::calib_flowrate(cali_stage, calib_info, wx_err_string);
|
||||
if (!CalibUtils::calib_flowrate(cali_stage, calib_info, wx_err_string)) {
|
||||
if (!wx_err_string.empty()) {
|
||||
MessageDialog msg_dlg(nullptr, wx_err_string, wxEmptyString, wxICON_WARNING | wxOK);
|
||||
msg_dlg.ShowModal();
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
else {
|
||||
wx_err_string = _L("Internal Error") + wxString(": Invalid calibration stage");
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include "../GUI/PartPlate.hpp"
|
||||
|
||||
#include "libslic3r/Model.hpp"
|
||||
#include "../GUI/MsgDialog.hpp"
|
||||
|
||||
|
||||
namespace Slic3r {
|
||||
|
@ -118,9 +119,18 @@ static bool is_same_nozzle_type(const DynamicPrintConfig &full_config, const Mac
|
|||
std::string filament_type = full_config.opt_string("filament_type", 0);
|
||||
error_msg = wxString::Format(_L("*Printing %s material with %s may cause nozzle damage"), filament_type, to_wstring_name(obj->nozzle_type));
|
||||
error_msg += "\n";
|
||||
|
||||
MessageDialog msg_dlg(nullptr, error_msg, wxEmptyString, wxICON_WARNING | wxOK | wxCANCEL);
|
||||
auto result = msg_dlg.ShowModal();
|
||||
if (result == wxID_OK) {
|
||||
error_msg.clear();
|
||||
return true;
|
||||
} else {
|
||||
error_msg.clear();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -460,10 +470,10 @@ bool CalibUtils::get_flow_ratio_calib_results(std::vector<FlowRatioCalibResult>&
|
|||
return flow_ratio_calib_results.size() > 0;
|
||||
}
|
||||
|
||||
void CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message)
|
||||
bool CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
if (pass != 1 && pass != 2)
|
||||
return;
|
||||
return false;
|
||||
|
||||
Model model;
|
||||
std::string input_file;
|
||||
|
@ -549,11 +559,11 @@ void CalibUtils::calib_flowrate(int pass, const CalibInfo &calib_info, wxString
|
|||
|
||||
Calib_Params params;
|
||||
params.mode = CalibMode::Calib_Flow_Rate;
|
||||
process_and_store_3mf(&model, full_config, params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
if (!process_and_store_3mf(&model, full_config, params, error_message))
|
||||
return false;
|
||||
|
||||
send_to_print(calib_info, error_message, pass);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalibUtils::calib_pa_pattern(const CalibInfo &calib_info, Model& model)
|
||||
|
@ -610,11 +620,11 @@ void CalibUtils::calib_pa_pattern(const CalibInfo &calib_info, Model& model)
|
|||
model.calib_pa_pattern = std::make_unique<CalibPressureAdvancePattern>(pa_pattern);
|
||||
}
|
||||
|
||||
void CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_message)
|
||||
bool CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_message)
|
||||
{
|
||||
const Calib_Params ¶ms = calib_info.params;
|
||||
if (params.mode != CalibMode::Calib_PA_Line && params.mode != CalibMode::Calib_PA_Pattern)
|
||||
return;
|
||||
return false;
|
||||
|
||||
Model model;
|
||||
std::string input_file;
|
||||
|
@ -640,11 +650,11 @@ void CalibUtils::calib_generic_PA(const CalibInfo &calib_info, wxString &error_m
|
|||
full_config.apply(filament_config);
|
||||
full_config.apply(printer_config);
|
||||
|
||||
process_and_store_3mf(&model, full_config, params, error_message);
|
||||
if (!error_message.empty())
|
||||
return;
|
||||
if (!process_and_store_3mf(&model, full_config, params, error_message))
|
||||
return false;
|
||||
|
||||
send_to_print(calib_info, error_message);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalibUtils::calib_temptue(const CalibInfo &calib_info, wxString &error_message)
|
||||
|
@ -927,7 +937,7 @@ bool CalibUtils::get_pa_k_n_value_by_cali_idx(const MachineObject *obj, int cali
|
|||
return false;
|
||||
}
|
||||
|
||||
void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &full_config, const Calib_Params ¶ms, wxString &error_message)
|
||||
bool CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &full_config, const Calib_Params ¶ms, wxString &error_message)
|
||||
{
|
||||
Pointfs bedfs = full_config.opt<ConfigOptionPoints>("printable_area")->values;
|
||||
double print_height = full_config.opt_float("printable_height");
|
||||
|
@ -944,7 +954,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||
int count = std::llround(std::ceil((params.end - params.start) / params.step)) + 1;
|
||||
if (count > max_line_nums) {
|
||||
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -980,7 +990,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||
unsigned int count = model->update_print_volume_state(build_volume);
|
||||
if (count == 0) {
|
||||
error_message = _L("Unable to calibrate: maybe because the set calibration value range is too large, or the step is too small");
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
// apply the new print config
|
||||
|
@ -998,7 +1008,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||
//}
|
||||
|
||||
if (!check_nozzle_diameter_and_type(full_config, error_message))
|
||||
return;
|
||||
return false;
|
||||
|
||||
fff_print->process();
|
||||
part_plate->update_slice_result_valid_state(true);
|
||||
|
@ -1089,6 +1099,7 @@ void CalibUtils::process_and_store_3mf(Model *model, const DynamicPrintConfig &f
|
|||
success = Slic3r::store_bbs_3mf(store_params);
|
||||
|
||||
release_PlateData_list(plate_data_list);
|
||||
return true;
|
||||
}
|
||||
|
||||
void CalibUtils::send_to_print(const CalibInfo &calib_info, wxString &error_message, int flow_ratio_mode)
|
||||
|
|
|
@ -48,11 +48,11 @@ public:
|
|||
static void calib_flowrate_X1C(const X1CCalibInfos& calib_infos, std::string& error_message);
|
||||
static void emit_get_flow_ratio_calib_results(float nozzle_diameter);
|
||||
static bool get_flow_ratio_calib_results(std::vector<FlowRatioCalibResult> &flow_ratio_calib_results);
|
||||
static void calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message);
|
||||
static bool calib_flowrate(int pass, const CalibInfo &calib_info, wxString &error_message);
|
||||
|
||||
static void calib_pa_pattern(const CalibInfo &calib_info, Model &model);
|
||||
|
||||
static void calib_generic_PA(const CalibInfo &calib_info, wxString &error_message);
|
||||
static bool calib_generic_PA(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_temptue(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_max_vol_speed(const CalibInfo &calib_info, wxString &error_message);
|
||||
static void calib_VFA(const CalibInfo &calib_info, wxString &error_message);
|
||||
|
@ -66,7 +66,7 @@ public:
|
|||
static bool validate_input_flow_ratio(wxString flow_ratio, float* output_value);
|
||||
|
||||
private:
|
||||
static void process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, wxString& error_message);
|
||||
static bool process_and_store_3mf(Model* model, const DynamicPrintConfig& full_config, const Calib_Params& params, wxString& error_message);
|
||||
static void send_to_print(const CalibInfo &calib_info, wxString& error_message, int flow_ratio_mode = 0); // 0: none 1: coarse 2: fine
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue