ENH: Add tips for auto cali
1. add tip for 0.2 nozzle 2. add tip for foam filaments jira:none Change-Id: I0d653bc96522f8a78b89d8aee9ef2472e575f273
This commit is contained in:
parent
efb0c2f025
commit
8b7ef47197
|
@ -231,7 +231,7 @@ void CaliPresetWarningPanel::create_panel(wxWindow* parent)
|
|||
{
|
||||
m_warning_text = new Label(parent, wxEmptyString);
|
||||
m_warning_text->SetFont(Label::Body_13);
|
||||
m_warning_text->SetForegroundColour(wxColour(230, 92, 92));
|
||||
//m_warning_text->SetForegroundColour(wxColour(230, 92, 92));
|
||||
m_warning_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
m_top_sizer->Add(m_warning_text, 0, wxEXPAND | wxTOP | wxBOTTOM, FromDIP(5));
|
||||
}
|
||||
|
@ -241,6 +241,11 @@ void CaliPresetWarningPanel::set_warning(wxString text)
|
|||
m_warning_text->SetLabel(text);
|
||||
}
|
||||
|
||||
void CaliPresetWarningPanel::set_color(wxColour color)
|
||||
{
|
||||
m_warning_text->SetForegroundColour(color);
|
||||
}
|
||||
|
||||
CaliPresetCustomRangePanel::CaliPresetCustomRangePanel(
|
||||
wxWindow* parent,
|
||||
int input_value_nums,
|
||||
|
@ -519,6 +524,13 @@ void CalibrationPresetPage::create_selection_panel(wxWindow* parent)
|
|||
m_comboBox_nozzle_dia = new ComboBox(parent, wxID_ANY, "", wxDefaultPosition, CALIBRATION_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
|
||||
panel_sizer->Add(m_comboBox_nozzle_dia, 0, wxALL, 0);
|
||||
|
||||
m_nozzle_diameter_tips = new Label(parent, "");
|
||||
m_nozzle_diameter_tips->Hide();
|
||||
m_nozzle_diameter_tips->SetFont(Label::Body_13);
|
||||
//m_nozzle_diameter_tips->SetForegroundColour(wxColour(100, 100, 100));
|
||||
m_nozzle_diameter_tips->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
|
||||
panel_sizer->Add(m_nozzle_diameter_tips, 0, wxALL, 0);
|
||||
|
||||
panel_sizer->AddSpacer(PRESET_GAP);
|
||||
|
||||
auto plate_type_combo_text = new Label(parent, _L("Plate Type"));
|
||||
|
@ -746,6 +758,10 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
|
|||
m_ext_spool_panel->Hide();
|
||||
|
||||
m_warning_panel = new CaliPresetWarningPanel(parent);
|
||||
m_warning_panel->Hide();
|
||||
|
||||
m_error_panel = new CaliPresetWarningPanel(parent);
|
||||
m_error_panel->set_color(wxColour(230, 92, 92));
|
||||
|
||||
m_tips_panel = new CaliPresetTipsPanel(parent);
|
||||
|
||||
|
@ -770,6 +786,7 @@ void CalibrationPresetPage::create_page(wxWindow* parent)
|
|||
m_top_sizer->Add(m_custom_range_panel, 0);
|
||||
m_top_sizer->AddSpacer(FromDIP(15));
|
||||
m_top_sizer->Add(m_warning_panel, 0);
|
||||
m_top_sizer->Add(m_error_panel, 0);
|
||||
m_top_sizer->Add(m_tips_panel, 0);
|
||||
m_top_sizer->AddSpacer(PRESET_GAP);
|
||||
m_top_sizer->Add(m_sending_panel, 0, wxALIGN_CENTER);
|
||||
|
@ -860,6 +877,7 @@ void CalibrationPresetPage::update_priner_status_msg(wxString msg, bool is_warni
|
|||
|
||||
void CalibrationPresetPage::on_select_nozzle(wxCommandEvent& evt)
|
||||
{
|
||||
check_nozzle_diameter_for_auto_cali();
|
||||
update_combobox_filaments(curr_obj);
|
||||
}
|
||||
|
||||
|
@ -950,6 +968,30 @@ void CalibrationPresetPage::on_recommend_input_value()
|
|||
}
|
||||
}
|
||||
|
||||
void CalibrationPresetPage::check_nozzle_diameter_for_auto_cali()
|
||||
{
|
||||
m_nozzle_diameter_tips->Hide();
|
||||
if (!curr_obj)
|
||||
return;
|
||||
|
||||
if (m_cali_method == CALI_METHOD_AUTO) {
|
||||
float nozzle_diameter = get_nozzle_value();
|
||||
if (nozzle_diameter < 0.3) {
|
||||
if (curr_obj->get_printer_arch() == PrinterArch::ARCH_I3) {
|
||||
wxString tips = (boost::format(_u8L("Tip: Using a %.1fmm nozzle for auto dynamic flow calibration may have a high probability of failure.\n"
|
||||
"If it fails, it is recommended to use manual calibration.")) % nozzle_diameter).str();
|
||||
m_nozzle_diameter_tips->SetLabel(tips);
|
||||
}
|
||||
else if (curr_obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
wxString tips = (boost::format(_u8L("Tip: Using a %.1fmm nozzle for auto dynamic flow calibration may not get accurate calibration results.\n"
|
||||
"It is recommended to use manual calibration.")) % nozzle_diameter).str();
|
||||
m_nozzle_diameter_tips->SetLabel(tips);
|
||||
}
|
||||
m_nozzle_diameter_tips->Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrationPresetPage::check_filament_compatible()
|
||||
{
|
||||
std::map<int, Preset*> selected_filaments = get_selected_filaments();
|
||||
|
@ -961,20 +1003,22 @@ void CalibrationPresetPage::check_filament_compatible()
|
|||
for (auto& item: selected_filaments)
|
||||
selected_filaments_list.push_back(item.second);
|
||||
|
||||
check_filament_cali_reliability(selected_filaments_list);
|
||||
|
||||
if (!is_filaments_compatiable(selected_filaments_list, bed_temp, incompatiable_filament_name, error_tips)) {
|
||||
m_tips_panel->set_params(0, 0, 0.0f);
|
||||
if (!error_tips.empty()) {
|
||||
wxString tips = from_u8(error_tips);
|
||||
m_warning_panel->set_warning(tips);
|
||||
m_error_panel->set_warning(tips);
|
||||
} else {
|
||||
wxString tips = wxString::Format(_L("%s is not compatible with %s"), m_comboBox_bed_type->GetValue(), incompatiable_filament_name);
|
||||
m_warning_panel->set_warning(tips);
|
||||
m_error_panel->set_warning(tips);
|
||||
}
|
||||
m_has_filament_incompatible = true;
|
||||
update_show_status();
|
||||
} else {
|
||||
m_tips_panel->set_params(0, bed_temp, 0);
|
||||
m_warning_panel->set_warning("");
|
||||
m_error_panel->set_warning("");
|
||||
m_has_filament_incompatible = false;
|
||||
update_show_status();
|
||||
}
|
||||
|
@ -1081,6 +1125,46 @@ bool CalibrationPresetPage::is_filaments_compatiable(const std::vector<Preset*>
|
|||
return true;
|
||||
}
|
||||
|
||||
void CalibrationPresetPage::check_filament_cali_reliability(const std::vector<Preset *> &prests)
|
||||
{
|
||||
m_warning_panel->Hide();
|
||||
if (!curr_obj)
|
||||
return;
|
||||
|
||||
if (m_cali_method == CALI_METHOD_AUTO) {
|
||||
std::set<std::string> foam_filaments;
|
||||
for (auto &item : prests) {
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
if (item->filament_id == "GFA11" || item->filament_id == "GFB02") { // PLA Aero, ASA-Aero
|
||||
foam_filaments.insert(item->name);
|
||||
}
|
||||
}
|
||||
|
||||
if (!foam_filaments.empty()) {
|
||||
std::string names;
|
||||
for (auto foam_filament : foam_filaments) {
|
||||
names += foam_filament;
|
||||
names += ",";
|
||||
}
|
||||
names.pop_back();
|
||||
|
||||
wxString tips;
|
||||
if (curr_obj->get_printer_series() == PrinterSeries::SERIES_X1) {
|
||||
tips = (boost::format(_u8L("Tip: Calibrating foam filaments(%s) in X series printers may not get accurate results\n"
|
||||
"because their dynamic response is much different from that of ordinary filaments, and there is a high risk of oozing when printing calibration lines.")) %names).str();
|
||||
}
|
||||
else if (curr_obj->get_printer_arch() == PrinterArch::ARCH_I3) {
|
||||
tips = (boost::format(_u8L("Tip: When using the A1/A1 mini machine, we do not recommend calibrating foam filaments(%s),\n"
|
||||
"as the results may be unstable and affect print quality."))%names).str();
|
||||
}
|
||||
m_warning_panel->set_warning(tips);
|
||||
m_warning_panel->Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CalibrationPresetPage::update_plate_type_collection(CalibrationMethod method)
|
||||
{
|
||||
m_comboBox_bed_type->Clear();
|
||||
|
|
|
@ -81,6 +81,9 @@ public:
|
|||
void create_panel(wxWindow* parent);
|
||||
|
||||
void set_warning(wxString text);
|
||||
|
||||
void set_color(wxColour color);
|
||||
|
||||
protected:
|
||||
wxBoxSizer* m_top_sizer;
|
||||
Label* m_warning_text;
|
||||
|
@ -236,6 +239,7 @@ protected:
|
|||
|
||||
void on_recommend_input_value();
|
||||
|
||||
void check_nozzle_diameter_for_auto_cali();
|
||||
void check_filament_compatible();
|
||||
bool is_filaments_compatiable(const std::vector<Preset*>& prests);
|
||||
bool is_filament_in_blacklist(Preset* preset, std::string& error_tips);
|
||||
|
@ -244,6 +248,8 @@ protected:
|
|||
std::string& incompatiable_filament_name,
|
||||
std::string& error_tips);
|
||||
|
||||
void check_filament_cali_reliability(const std::vector<Preset *> &prests);
|
||||
|
||||
float get_nozzle_value();
|
||||
|
||||
void update_plate_type_collection(CalibrationMethod method);
|
||||
|
@ -265,7 +271,8 @@ protected:
|
|||
wxPanel* m_multi_ams_panel { nullptr };
|
||||
wxPanel* m_filament_list_panel { nullptr };
|
||||
wxPanel* m_ext_spool_panel { nullptr };
|
||||
CaliPresetWarningPanel* m_warning_panel { nullptr };
|
||||
CaliPresetWarningPanel* m_warning_panel{nullptr};
|
||||
CaliPresetWarningPanel* m_error_panel { nullptr };
|
||||
CaliPresetCustomRangePanel* m_custom_range_panel { nullptr };
|
||||
CaliPresetTipsPanel* m_tips_panel { nullptr };
|
||||
CaliPageSendingPanel* m_sending_panel { nullptr };
|
||||
|
@ -276,6 +283,7 @@ protected:
|
|||
ComboBox* m_comboBox_nozzle_dia;
|
||||
ComboBox* m_comboBox_bed_type;
|
||||
ComboBox* m_comboBox_process;
|
||||
Label* m_nozzle_diameter_tips{nullptr};
|
||||
|
||||
wxRadioButton* m_ams_radiobox;
|
||||
wxRadioButton* m_ext_spool_radiobox;
|
||||
|
|
Loading…
Reference in New Issue