OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::CalibrationPresetPage Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/CalibrationWizardPresetPage.hpp>

Inheritance diagram for Slic3r::GUI::CalibrationPresetPage:
Collaboration diagram for Slic3r::GUI::CalibrationPresetPage:

Public Member Functions

 CalibrationPresetPage (wxWindow *parent, CalibMode cali_mode, bool custom_range=false, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void create_page (wxWindow *parent)
void update_print_status_msg (wxString msg, bool is_warning)
wxString format_text (wxString &m_msg)
void stripWhiteSpace (std::string &str)
void update_priner_status_msg (wxString msg, bool is_warning)
void update (MachineObject *obj) override
void update_flow_ratio_type (FlowRatioCalibrationType type)
void on_device_connected (MachineObject *obj) override
void update_print_error_info (int code, const std::string &msg, const std::string &extra)
void set_cali_filament_mode (CalibrationFilamentMode mode) override
void set_cali_method (CalibrationMethod method) override
void on_cali_start_job ()
void on_cali_finished_job ()
void on_cali_cancel_job ()
void init_with_machine (MachineObject *obj)
void sync_ams_info (MachineObject *obj)
void select_default_compatible_filament ()
int get_index_by_tray_id (int tray_id)
std::vector< FilamentComboBox * > get_selected_filament_combobox ()
std::map< int, Preset * > get_selected_filaments ()
std::map< int, DynamicPrintConfig > get_filament_ams_list () const
void get_preset_info (float &nozzle_dia, BedType &plate_type)
void get_cali_stage (CaliPresetStage &stage, float &value)
std::shared_ptr< ProgressIndicator > get_sending_progress_bar ()
Preset * get_printer_preset (MachineObject *obj, float nozzle_value)
Preset * get_print_preset ()
std::string get_print_preset_name ()
wxArrayString get_custom_range_values ()
CalibMode get_pa_cali_method ()
CaliPresetPageStatus get_page_status ()
MachineObject * get_current_object ()
void msw_rescale () override
void on_sys_color_changed () override
int get_extruder_id_by_tray_id (int tray_id)
float get_nozzle_diameter (int extruder_id) const
NozzleVolumeType get_nozzle_volume_type (int extruder_id) const
ExtruderType get_extruder_type (int extruder_id) const
CaliPageType get_page_type ()
CalibrationWizardPage * get_prev_page ()
CalibrationWizardPage * get_next_page ()
void set_prev_page (CalibrationWizardPage *prev)
void set_next_page (CalibrationWizardPage *next)
CalibrationWizardPage * chain (CalibrationWizardPage *next)
virtual void on_reset_page ()

Protected Member Functions

void create_selection_panel (wxWindow *parent)
void create_filament_list_panel (wxWindow *parent)
wxBoxSizer * create_ams_items_sizer (MachineObject *obj, wxPanel *ams_preview_panel, std::vector< AMSPreview * > &ams_preview_list, std::vector< AMSinfo > &ams_info, int nozzle_id)
void init_selection_values ()
void update_filament_combobox (std::string ams_id="")
void on_select_nozzle (wxCommandEvent &evt)
void on_select_plate_type (wxCommandEvent &evt)
void on_choose_ams (wxCommandEvent &event)
void on_choose_ext_spool (wxCommandEvent &event)
void on_select_tray (wxCommandEvent &event)
void on_switch_ams (std::string ams_id="")
void on_recommend_input_value ()
void check_filament_compatible ()
bool is_filaments_compatiable (const std::map< int, Preset * > &prests)
bool is_filament_in_blacklist (int tray_id, Preset *preset, std::string &error_tips)
bool is_filaments_compatiable (const std::map< int, Preset * > &prests, int &bed_temp, std::string &incompatiable_filament_name, std::string &error_tips)
float get_nozzle_value ()
void update_plate_type_collection (CalibrationMethod method)
void update_combobox_filaments (MachineObject *obj)
void update_show_status ()
void update_sync_button_status ()
bool is_nozzle_info_synced () const
void show_status (CaliPresetPageStatus status)
void Enable_Send_Button (bool enable)
bool need_check_sdcard (MachineObject *obj)
CaliPresetPageStatus get_status ()
void update_multi_extruder_filament_combobox (const std::string &ams_id, int nozzle_id)
void create_multi_extruder_filament_list_panel (wxWindow *parent)
void on_select_nozzle_volume_type (wxCommandEvent &evt, size_t extruder_id)

Protected Attributes

CaliPageStepGuide * m_step_panel { nullptr }
CaliComboBox * m_pa_cali_method_combox {nullptr}
CaliPresetCaliStagePanel * m_cali_stage_panel { nullptr }
wxPanel * m_selection_panel { nullptr }
wxPanel * m_filament_from_panel { nullptr }
Label * m_filament_list_tips { nullptr }
wxPanel * m_multi_ams_panel { nullptr }
wxPanel * m_filament_list_panel { nullptr }
CaliPresetWarningPanel * m_warning_panel { nullptr }
CaliPresetCustomRangePanel * m_custom_range_panel { nullptr }
CaliPresetTipsPanel * m_tips_panel { nullptr }
CaliPageSendingPanel * m_sending_panel { nullptr }
wxBoxSizer * m_top_sizer
ComboBox * m_comboBox_nozzle_dia
ComboBox * m_comboBox_nozzle_volume
ComboBox * m_comboBox_bed_type
ComboBox * m_comboBox_process
Label * m_nozzle_diameter_tips {nullptr}
std::vector< BedType > m_displayed_bed_types
Button * m_btn_sync {nullptr}
Label * m_sync_button_text
wxPanel * m_single_nozzle_info_panel {nullptr}
wxPanel * m_multi_nozzle_info_panel {nullptr}
wxPanel * m_multi_exutrder_filament_list_panel {nullptr}
ComboBox * m_left_comboBox_nozzle_dia
ComboBox * m_right_comboBox_nozzle_dia
ComboBox * m_left_comboBox_nozzle_volume
ComboBox * m_right_comboBox_nozzle_volume
wxPanel * m_main_ams_preview_panel {nullptr}
wxPanel * m_deputy_ams_preview_panel {nullptr}
wxBoxSizer * m_main_ams_items_sizer {nullptr}
wxBoxSizer * m_deputy_ams_items_sizer {nullptr}
std::vector< AMSPreview * > m_main_ams_preview_list
std::vector< AMSPreview * > m_deputy_ams_preview_list
FilamentComboBoxList m_main_filament_comboBox_list
FilamentComboBoxList m_deputy_filament_comboBox_list
std::unordered_map< int, int > m_ams_id_to_extruder_id_map
std::vector< ExtruderType > m_extrder_types
std::vector< NozzleVolumeType > m_extruder_nozzle_types
bool m_main_extruder_on_left {true}
wxBoxSizer * m_multi_extruder_ams_panel_sizer
wxBoxSizer * m_multi_exturder_ams_sizer
wxStaticBoxSizer * m_main_sizer
wxStaticBoxSizer * m_deputy_sizer
wxStaticBoxSizer * m_left_nozzle_volume_type_sizer
wxStaticBoxSizer * m_right_nozzle_volume_type_sizer
ScalableButton * m_ams_sync_button
FilamentComboBoxList m_filament_comboBox_list
std::vector< AMSPreview * > m_ams_preview_list
std::map< int, DynamicPrintConfig > filament_ams_list
CaliPresetPageStatus m_page_status { CaliPresetPageStatus::CaliPresetStatusInit }
bool m_stop_update_page_status { false }
bool m_show_custom_range { false }
bool m_has_filament_incompatible { false }
MachineObject * curr_obj { nullptr }
CalibMode m_cali_mode
CaliPageType m_page_type
CalibrationFilamentMode m_cali_filament_mode
CalibrationMethod m_cali_method { CalibrationMethod::CALI_METHOD_MANUAL }
wxWindow * m_parent { nullptr }
CaliPageCaption * m_page_caption { nullptr }
CaliPageActionPanel * m_action_panel { nullptr }
Label * m_statictext_printer_msg { nullptr }

Private Attributes

CalibrationWizardPage * m_prev_page {nullptr}
CalibrationWizardPage * m_next_page {nullptr}

Detailed Description

Constructor & Destructor Documentation

◆ CalibrationPresetPage()

Slic3r::GUI::CalibrationPresetPage::CalibrationPresetPage ( wxWindow * parent,
CalibMode cali_mode,
bool custom_range = false,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL )
547 : CalibrationWizardPage(parent, id, pos, size, style)
548 , m_show_custom_range(custom_range)
549{
550 SetBackgroundColour(*wxWHITE);
551
552 m_cali_mode = cali_mode;
555 m_top_sizer = new wxBoxSizer(wxVERTICAL);
558
559 create_page(this);
560
561 this->SetSizer(m_top_sizer);
562 m_top_sizer->Fit(this);
563}
#define style
Definition WipeTowerDialog.cpp:101
void create_page(wxWindow *parent)
Definition CalibrationWizardPresetPage.cpp:1221
std::vector< NozzleVolumeType > m_extruder_nozzle_types
Definition CalibrationWizardPresetPage.hpp:353
wxBoxSizer * m_top_sizer
Definition CalibrationWizardPresetPage.hpp:313
bool m_show_custom_range
Definition CalibrationWizardPresetPage.hpp:377
std::vector< ExtruderType > m_extrder_types
Definition CalibrationWizardPresetPage.hpp:352
CalibrationFilamentMode m_cali_filament_mode
Definition CalibrationWizardPage.hpp:339
CaliPageType m_page_type
Definition CalibrationWizardPage.hpp:338
CalibMode m_cali_mode
Definition CalibrationWizardPage.hpp:337
CalibrationWizardPage(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Definition CalibrationWizardPage.cpp:989
@ CALI_PAGE_PRESET
Definition CalibrationWizardPage.hpp:83
@ CALI_MODEL_SINGLE
Definition CalibrationWizardPage.hpp:58
@ nvtHighFlow
Definition PrintConfig.hpp:620
@ etDirectDrive
Definition PrintConfig.hpp:613

References Slic3r::GUI::CalibrationWizardPage::CalibrationWizardPage(), Slic3r::GUI::CALI_MODEL_SINGLE, Slic3r::GUI::CALI_PAGE_PRESET, create_page(), Slic3r::etDirectDrive, Slic3r::GUI::CalibrationWizardPage::m_cali_filament_mode, Slic3r::GUI::CalibrationWizardPage::m_cali_mode, m_extrder_types, m_extruder_nozzle_types, Slic3r::GUI::CalibrationWizardPage::m_page_type, m_show_custom_range, m_top_sizer, Slic3r::nvtHighFlow, and style.

Referenced by Slic3r::GUI::MaxVolumetricSpeedPresetPage::MaxVolumetricSpeedPresetPage().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ chain()

CalibrationWizardPage * Slic3r::GUI::CalibrationWizardPage::chain ( CalibrationWizardPage * next)
inlineinherited
313 {
314 set_next_page(next);
315 next->set_prev_page(this);
316 return next;
317 }
void set_next_page(CalibrationWizardPage *next)
Definition CalibrationWizardPage.hpp:311

References CalibrationWizardPage(), set_next_page(), and set_prev_page().

Here is the call graph for this function:

◆ check_filament_compatible()

void Slic3r::GUI::CalibrationPresetPage::check_filament_compatible ( )
protected
1480{
1481 std::map<int, Preset*> selected_filaments = get_selected_filaments();
1482 std::string incompatiable_filament_name;
1483 std::string error_tips;
1484 int bed_temp = 0;
1485
1486 std::vector<Preset *> selected_filaments_list;
1487 for (auto &item : selected_filaments)
1488 selected_filaments_list.push_back(item.second);
1489
1490 if (!is_filaments_compatiable(selected_filaments, bed_temp, incompatiable_filament_name, error_tips)) {
1491 m_tips_panel->set_params(0, 0, 0.0f);
1492 if (!error_tips.empty()) {
1493 wxString tips = from_u8(error_tips);
1494 m_warning_panel->set_warning(tips);
1495 } else {
1496 wxString tips = wxString::Format(_L("%s is not compatible with %s"), m_comboBox_bed_type->GetValue(), incompatiable_filament_name);
1497 m_warning_panel->set_warning(tips);
1498 }
1501 } else {
1502 m_tips_panel->set_params(0, bed_temp, 0);
1503 m_warning_panel->set_warning("");
1506 }
1507
1508 Layout();
1509}
#define _L(s)
Definition OBJ.cpp:34
void update_show_status()
Definition CalibrationWizardPresetPage.cpp:1751
bool is_filaments_compatiable(const std::map< int, Preset * > &prests)
Definition CalibrationWizardPresetPage.cpp:1511
CaliPresetTipsPanel * m_tips_panel
Definition CalibrationWizardPresetPage.hpp:310
std::map< int, Preset * > get_selected_filaments()
Definition CalibrationWizardPresetPage.cpp:2548
ComboBox * m_comboBox_bed_type
Definition CalibrationWizardPresetPage.hpp:318
bool m_has_filament_incompatible
Definition CalibrationWizardPresetPage.hpp:378
CaliPresetWarningPanel * m_warning_panel
Definition CalibrationWizardPresetPage.hpp:308
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References _L, Slic3r::GUI::from_u8(), get_selected_filaments(), is_filaments_compatiable(), m_comboBox_bed_type, m_has_filament_incompatible, m_tips_panel, m_warning_panel, and update_show_status().

Referenced by on_select_plate_type(), on_select_tray(), and select_default_compatible_filament().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_ams_items_sizer()

wxBoxSizer * Slic3r::GUI::CalibrationPresetPage::create_ams_items_sizer ( MachineObject * obj,
wxPanel * ams_preview_panel,
std::vector< AMSPreview * > & ams_preview_list,
std::vector< AMSinfo > & ams_info,
int nozzle_id )
protected
1075 {
1076 /* clear ams_preview_list */
1077 for (auto &item : ams_preview_list) {
1078 delete item;
1079 }
1080 ams_preview_list.clear();
1081
1082 /* create ams_preview_list */
1083 auto ams_items_sizer = new wxBoxSizer(wxHORIZONTAL);
1084 for (auto &info : ams_info) {
1085 auto preview_ams_item = new AMSPreview(ams_preview_panel, wxID_ANY, info, info.ams_type);
1086 preview_ams_item->UpdateInfo(info);
1087 preview_ams_item->Open();
1088 ams_preview_list.push_back(preview_ams_item);
1089 std::string ams_id = preview_ams_item->get_ams_id();
1090 bool is_single = !obj->is_multi_extruders();
1091 preview_ams_item->Bind(wxEVT_LEFT_DOWN, [this, ams_id, nozzle_id, is_single](wxMouseEvent &e) {
1092 if(is_single){
1094 } else{
1095 update_multi_extruder_filament_combobox(ams_id, nozzle_id);
1096 }
1097 e.Skip();
1098 });
1099 ams_items_sizer->Add(preview_ams_item, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(6));
1100 }
1101 return ams_items_sizer;
1102}
void update_multi_extruder_filament_combobox(const std::string &ams_id, int nozzle_id)
Definition CalibrationWizardPresetPage.cpp:2593
void update_filament_combobox(std::string ams_id="")
Definition CalibrationWizardPresetPage.cpp:2689
wxMouseEvent
Definition CameraPopup.cpp:47

References Slic3r::MachineObject::is_multi_extruders(), update_filament_combobox(), update_multi_extruder_filament_combobox(), and Slic3r::GUI::wxMouseEvent.

Referenced by sync_ams_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_filament_list_panel()

void Slic3r::GUI::CalibrationPresetPage::create_filament_list_panel ( wxWindow * parent)
protected
967{
968 auto panel_sizer = new wxBoxSizer(wxVERTICAL);
969
970 m_filament_list_tips = new Label(parent, _L("Tips for calibration material:\n- Materials that can share same hot bed temperature\n- Different filament brand and family (Brand = Bambu, Family = Basic, Matte)"));
971 m_filament_list_tips->Hide();
973 m_filament_list_tips->SetForegroundColour(wxColour(145, 145, 145));
975 panel_sizer->Add(m_filament_list_tips, 0, wxBOTTOM, FromDIP(10));
976
977 // Preview item
978 m_multi_ams_panel = new wxPanel(parent);
979 panel_sizer->Add(m_multi_ams_panel);
980
981 auto filament_fgSizer = new wxFlexGridSizer(2, 2, FromDIP(10), CALIBRATION_FGSIZER_HGAP);
982 for (int i = 0; i < 4; i++) {
983 auto filament_comboBox_sizer = new wxBoxSizer(wxHORIZONTAL);
984 wxRadioButton* radio_btn = new wxRadioButton(m_filament_list_panel, wxID_ANY, "");
985 CheckBox* check_box = new CheckBox(m_filament_list_panel);
986 check_box->SetBackgroundColour(*wxWHITE);
987 FilamentComboBox* fcb = new FilamentComboBox(m_filament_list_panel, i);
988 fcb->SetRadioBox(radio_btn);
989 fcb->SetCheckBox(check_box);
990 fcb->set_select_mode(CalibrationFilamentMode::CALI_MODEL_SINGLE);
991 filament_comboBox_sizer->Add(radio_btn, 0, wxALIGN_CENTER);
992 filament_comboBox_sizer->Add(check_box, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
993 filament_comboBox_sizer->Add(fcb, 0, wxALIGN_CENTER);
994 filament_fgSizer->Add(filament_comboBox_sizer, 0);
995
996 fcb->Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
997
998 radio_btn->Bind(wxEVT_RADIOBUTTON, [this](wxCommandEvent& evt) {
999 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1000 event.SetEventObject(this);
1001 wxPostEvent(this, event);
1002 });
1003 check_box->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent& evt) {
1004 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1005 event.SetEventObject(this);
1006 wxPostEvent(this, event);
1007 evt.Skip();
1008 });
1009 m_filament_comboBox_list.push_back(fcb);
1010
1011 if (i == 0)
1012 radio_btn->SetValue(true);
1013 }
1014 panel_sizer->Add(filament_fgSizer, 0);
1015
1016 parent->SetSizer(panel_sizer);
1017 panel_sizer->Fit(parent);
1018}
#define CALIBRATION_TEXT_MAX_LENGTH
Definition CalibrationWizardPage.hpp:40
#define CALIBRATION_FGSIZER_HGAP
Definition CalibrationWizardPage.hpp:39
static wxFont Body_13
Definition Label.hpp:54
wxPanel * m_multi_ams_panel
Definition CalibrationWizardPresetPage.hpp:306
void on_select_tray(wxCommandEvent &event)
Definition CalibrationWizardPresetPage.cpp:1417
FilamentComboBoxList m_filament_comboBox_list
Definition CalibrationWizardPresetPage.hpp:366
Label * m_filament_list_tips
Definition CalibrationWizardPresetPage.hpp:305
wxPanel * m_filament_list_panel
Definition CalibrationWizardPresetPage.hpp:307

References _L, Label::Body_13, Slic3r::GUI::CALI_MODEL_SINGLE, CALIBRATION_FGSIZER_HGAP, CALIBRATION_TEXT_MAX_LENGTH, m_filament_comboBox_list, m_filament_list_panel, m_filament_list_tips, m_multi_ams_panel, on_select_tray(), Slic3r::GUI::FilamentComboBox::set_select_mode(), Slic3r::GUI::FilamentComboBox::SetCheckBox(), and Slic3r::GUI::FilamentComboBox::SetRadioBox().

Referenced by create_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_multi_extruder_filament_list_panel()

void Slic3r::GUI::CalibrationPresetPage::create_multi_extruder_filament_list_panel ( wxWindow * parent)
protected
1105{
1106 m_multi_extruder_ams_panel_sizer = new wxBoxSizer(wxVERTICAL);
1107
1108 m_filament_list_tips = new Label(
1109 parent,
1110 _L("Tips for calibration material:\n- Materials that can share same hot bed temperature\n- Different filament brand and family (Brand = Bambu, Family = Basic, Matte)"));
1111 m_filament_list_tips->Hide();
1113 m_filament_list_tips->SetForegroundColour(wxColour(145, 145, 145));
1115 m_multi_extruder_ams_panel_sizer->Add(m_filament_list_tips, 0, wxBOTTOM, FromDIP(10));
1116
1117 {
1118 // 1. Preview item
1119 m_main_sizer = new wxStaticBoxSizer(wxVERTICAL, parent, "Main");
1120 m_main_ams_preview_panel = new wxPanel(parent);
1122
1123 // 2. AMS item
1124 m_main_ams_items_sizer = new wxBoxSizer(wxVERTICAL);
1125 for (int i = 0; i < 4; i++) { // 4 slots
1126 auto filament_comboBox_sizer = new wxBoxSizer(wxHORIZONTAL);
1127 wxRadioButton *radio_btn = new wxRadioButton(m_multi_exutrder_filament_list_panel, wxID_ANY, "");
1128 CheckBox * check_box = new CheckBox(m_multi_exutrder_filament_list_panel);
1129 check_box->SetBackgroundColour(*wxWHITE);
1130 FilamentComboBox *fcb = new FilamentComboBox(m_multi_exutrder_filament_list_panel, i + 4);
1131 fcb->SetRadioBox(radio_btn);
1132 fcb->SetCheckBox(check_box);
1133 fcb->set_select_mode(CalibrationFilamentMode::CALI_MODEL_SINGLE);
1134 filament_comboBox_sizer->Add(radio_btn, 0, wxALIGN_CENTER);
1135 filament_comboBox_sizer->Add(check_box, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
1136 filament_comboBox_sizer->Add(fcb, 0, wxALIGN_CENTER);
1137 m_main_ams_items_sizer->Add(filament_comboBox_sizer, 0);
1138
1139 fcb->Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
1140 m_main_filament_comboBox_list.emplace_back(fcb);
1141
1142 radio_btn->Bind(wxEVT_RADIOBUTTON, [this](wxCommandEvent &evt) {
1143 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1144 event.SetEventObject(this);
1145 wxPostEvent(this, event);
1146 });
1147 check_box->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &evt) {
1148 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1149 event.SetEventObject(this);
1150 wxPostEvent(this, event);
1151 evt.Skip();
1152 });
1153
1154 if (i == 0)
1155 radio_btn->SetValue(true);
1156 }
1157
1158 m_main_sizer->Add(m_main_ams_items_sizer, 1, wxEXPAND | wxALL, 10);
1159 }
1160
1161 {
1162 // 1. Preview item
1163 m_deputy_sizer = new wxStaticBoxSizer(wxVERTICAL, parent, "Deputy");
1164 m_deputy_ams_preview_panel = new wxPanel(parent);
1166
1167 // 2. AMS item
1168 m_deputy_ams_items_sizer = new wxBoxSizer(wxVERTICAL);
1169 for (int i = 0; i < 4; ++i) { // 4 slots
1170 auto filament_comboBox_sizer = new wxBoxSizer(wxHORIZONTAL);
1171 wxRadioButton *radio_btn = new wxRadioButton(m_multi_exutrder_filament_list_panel, wxID_ANY, "");
1172 CheckBox * check_box = new CheckBox(m_multi_exutrder_filament_list_panel);
1173 check_box->SetBackgroundColour(*wxWHITE);
1174 FilamentComboBox *fcb = new FilamentComboBox(m_multi_exutrder_filament_list_panel, i);
1175 fcb->SetRadioBox(radio_btn);
1176 fcb->SetCheckBox(check_box);
1177 fcb->set_select_mode(CalibrationFilamentMode::CALI_MODEL_SINGLE);
1178 filament_comboBox_sizer->Add(radio_btn, 0, wxALIGN_CENTER);
1179 filament_comboBox_sizer->Add(check_box, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
1180 filament_comboBox_sizer->Add(fcb, 0, wxALIGN_CENTER);
1181 m_deputy_ams_items_sizer->Add(filament_comboBox_sizer, 0);
1182
1183 fcb->Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
1184 m_deputy_filament_comboBox_list.emplace_back(fcb);
1185
1186 radio_btn->Bind(wxEVT_RADIOBUTTON, [this](wxCommandEvent &evt) {
1187 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1188 event.SetEventObject(this);
1189 wxPostEvent(this, event);
1190 });
1191 check_box->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &evt) {
1192 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
1193 event.SetEventObject(this);
1194 wxPostEvent(this, event);
1195 evt.Skip();
1196 });
1197 }
1198
1199 m_deputy_sizer->Add(m_deputy_ams_items_sizer, 1, wxEXPAND | wxALL, 10);
1200 }
1201
1202 m_multi_exturder_ams_sizer = new wxBoxSizer(wxHORIZONTAL);
1204 m_main_sizer->GetStaticBox()->SetLabel(_L("Left Nozzle"));
1205 m_deputy_sizer->GetStaticBox()->SetLabel(_L("Right Nozzle"));
1206 m_multi_exturder_ams_sizer->Add(m_main_sizer, 1, wxALL | wxALIGN_BOTTOM, 10);
1207 m_multi_exturder_ams_sizer->Add(m_deputy_sizer, 1, wxALL | wxALIGN_BOTTOM, 10);
1208 }
1209 else {
1210 m_main_sizer->GetStaticBox()->SetLabel(_L("Right Nozzle"));
1211 m_deputy_sizer->GetStaticBox()->SetLabel(_L("Left Nozzle"));
1212 m_multi_exturder_ams_sizer->Add(m_deputy_sizer, 1, wxEXPAND | wxALL, 10);
1213 m_multi_exturder_ams_sizer->Add(m_main_sizer, 1, wxEXPAND | wxALL, 10);
1214 }
1216
1217 parent->SetSizer(m_multi_extruder_ams_panel_sizer);
1219}
void SetValue(bool value) override
Definition CheckBox.cpp:43
wxPanel * m_main_ams_preview_panel
Definition CalibrationWizardPresetPage.hpp:341
wxPanel * m_deputy_ams_preview_panel
Definition CalibrationWizardPresetPage.hpp:342
wxBoxSizer * m_deputy_ams_items_sizer
Definition CalibrationWizardPresetPage.hpp:344
wxStaticBoxSizer * m_deputy_sizer
Definition CalibrationWizardPresetPage.hpp:359
wxBoxSizer * m_multi_exturder_ams_sizer
Definition CalibrationWizardPresetPage.hpp:357
FilamentComboBoxList m_main_filament_comboBox_list
Definition CalibrationWizardPresetPage.hpp:348
wxPanel * m_multi_exutrder_filament_list_panel
Definition CalibrationWizardPresetPage.hpp:334
bool m_main_extruder_on_left
Definition CalibrationWizardPresetPage.hpp:354
FilamentComboBoxList m_deputy_filament_comboBox_list
Definition CalibrationWizardPresetPage.hpp:349
wxBoxSizer * m_main_ams_items_sizer
Definition CalibrationWizardPresetPage.hpp:343
wxStaticBoxSizer * m_main_sizer
Definition CalibrationWizardPresetPage.hpp:358
wxBoxSizer * m_multi_extruder_ams_panel_sizer
Definition CalibrationWizardPresetPage.hpp:356

References _L, Label::Body_13, Slic3r::GUI::CALI_MODEL_SINGLE, CALIBRATION_TEXT_MAX_LENGTH, m_deputy_ams_items_sizer, m_deputy_ams_preview_panel, m_deputy_filament_comboBox_list, m_deputy_sizer, m_filament_list_tips, m_main_ams_items_sizer, m_main_ams_preview_panel, m_main_extruder_on_left, m_main_filament_comboBox_list, m_main_sizer, m_multi_extruder_ams_panel_sizer, m_multi_exturder_ams_sizer, m_multi_exutrder_filament_list_panel, on_select_tray(), Slic3r::GUI::FilamentComboBox::set_select_mode(), Slic3r::GUI::FilamentComboBox::SetCheckBox(), and Slic3r::GUI::FilamentComboBox::SetRadioBox().

Referenced by create_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_page()

void Slic3r::GUI::CalibrationPresetPage::create_page ( wxWindow * parent)
1222{
1223 m_page_caption = new CaliPageCaption(parent, m_cali_mode);
1224 m_page_caption->show_prev_btn(true);
1225 m_top_sizer->Add(m_page_caption, 0, wxEXPAND, 0);
1226
1228 wxArrayString steps;
1229 steps.Add(_L("Preset"));
1230 steps.Add(_L("Calibration1"));
1231 steps.Add(_L("Calibration2"));
1232 steps.Add(_L("Record Factor"));
1233 m_step_panel = new CaliPageStepGuide(parent, steps);
1234 m_step_panel->set_steps(0);
1235 }
1236 else {
1237 wxArrayString steps;
1238 steps.Add(_L("Preset"));
1239 steps.Add(_L("Calibration"));
1240 steps.Add(_L("Record Factor"));
1241 m_step_panel = new CaliPageStepGuide(parent, steps);
1242 m_step_panel->set_steps(0);
1243 }
1244
1245 m_top_sizer->Add(m_step_panel, 0, wxEXPAND, 0);
1246
1247 m_cali_stage_panel = new CaliPresetCaliStagePanel(parent);
1248 m_cali_stage_panel->set_parent(this);
1250
1251 m_selection_panel = new wxPanel(parent);
1252 m_selection_panel->SetBackgroundColour(*wxWHITE);
1255
1256 m_filament_list_panel = new wxPanel(parent);
1257 m_filament_list_panel->SetBackgroundColour(*wxWHITE);
1259
1260 m_multi_exutrder_filament_list_panel = new wxPanel(parent);
1261 m_multi_exutrder_filament_list_panel->SetBackgroundColour(*wxWHITE);
1263
1265 wxArrayString pa_cali_modes;
1266 pa_cali_modes.push_back(_L("Line"));
1267 pa_cali_modes.push_back(_L("Pattern"));
1268 m_pa_cali_method_combox = new CaliComboBox(parent, _L("Method"), pa_cali_modes);
1269 }
1270
1271 m_warning_panel = new CaliPresetWarningPanel(parent);
1272
1273 m_tips_panel = new CaliPresetTipsPanel(parent);
1274
1275 m_sending_panel = new CaliPageSendingPanel(parent);
1276 m_sending_panel->get_sending_progress_bar()->set_cancel_callback_fina([this]() {
1278 });
1279 m_sending_panel->Bind(EVT_SHOW_ERROR_FAIL_SEND, [this](auto &event){on_cali_cancel_job();});
1280 m_sending_panel->Hide();
1281
1282 m_custom_range_panel = new CaliPresetCustomRangePanel(parent);
1283
1284 m_action_panel = new CaliPageActionPanel(parent, m_cali_mode, CaliPageType::CALI_PAGE_PRESET);
1285
1286 m_statictext_printer_msg = new Label(this, wxEmptyString, wxALIGN_CENTER_HORIZONTAL);
1289
1296 m_top_sizer->AddSpacer(FromDIP(15));
1298 m_top_sizer->Add(m_tips_panel, 0);
1299 m_top_sizer->AddSpacer(PRESET_GAP);
1300 m_top_sizer->Add(m_sending_panel, 0, wxALIGN_CENTER);
1301 m_top_sizer->Add(m_statictext_printer_msg, 0, wxALIGN_CENTER_HORIZONTAL, 0);
1302 m_top_sizer->Add(m_action_panel, 0, wxEXPAND, 0);
1303
1304 Bind(EVT_CALI_TRAY_CHANGED, &CalibrationPresetPage::on_select_tray, this);
1305}
#define PRESET_GAP
Definition CalibrationWizardPage.hpp:34
void create_multi_extruder_filament_list_panel(wxWindow *parent)
Definition CalibrationWizardPresetPage.cpp:1104
void on_cali_cancel_job()
Definition CalibrationWizardPresetPage.cpp:2117
void create_selection_panel(wxWindow *parent)
Definition CalibrationWizardPresetPage.cpp:614
CaliPageSendingPanel * m_sending_panel
Definition CalibrationWizardPresetPage.hpp:311
wxPanel * m_selection_panel
Definition CalibrationWizardPresetPage.hpp:303
CaliPageStepGuide * m_step_panel
Definition CalibrationWizardPresetPage.hpp:300
void create_filament_list_panel(wxWindow *parent)
Definition CalibrationWizardPresetPage.cpp:966
CaliPresetCustomRangePanel * m_custom_range_panel
Definition CalibrationWizardPresetPage.hpp:309
void init_selection_values()
Definition CalibrationWizardPresetPage.cpp:896
CaliComboBox * m_pa_cali_method_combox
Definition CalibrationWizardPresetPage.hpp:301
CaliPresetCaliStagePanel * m_cali_stage_panel
Definition CalibrationWizardPresetPage.hpp:302
CaliPageActionPanel * m_action_panel
Definition CalibrationWizardPage.hpp:345
Label * m_statictext_printer_msg
Definition CalibrationWizardPage.hpp:346
CaliPageCaption * m_page_caption
Definition CalibrationWizardPage.hpp:344
@ Calib_PA_Line
Definition calib.hpp:25
@ Calib_PA_Pattern
Definition calib.hpp:26
@ Calib_Flow_Rate
Definition calib.hpp:29

References _L, Label::Body_13, Slic3r::GUI::CALI_PAGE_PRESET, Slic3r::Calib_Flow_Rate, Slic3r::Calib_PA_Line, Slic3r::Calib_PA_Pattern, create_filament_list_panel(), create_multi_extruder_filament_list_panel(), create_selection_panel(), init_selection_values(), Slic3r::GUI::CalibrationWizardPage::m_action_panel, Slic3r::GUI::CalibrationWizardPage::m_cali_mode, m_cali_stage_panel, m_custom_range_panel, m_filament_list_panel, m_multi_exutrder_filament_list_panel, m_pa_cali_method_combox, Slic3r::GUI::CalibrationWizardPage::m_page_caption, m_selection_panel, m_sending_panel, Slic3r::GUI::CalibrationWizardPage::m_statictext_printer_msg, m_step_panel, m_tips_panel, m_top_sizer, m_warning_panel, on_cali_cancel_job(), on_select_tray(), and PRESET_GAP.

Referenced by CalibrationPresetPage().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ create_selection_panel()

void Slic3r::GUI::CalibrationPresetPage::create_selection_panel ( wxWindow * parent)
protected
615{
616 auto panel_sizer = new wxBoxSizer(wxVERTICAL);
617
618 auto sync_button_sizer = new wxBoxSizer(wxHORIZONTAL);
619 m_btn_sync = new Button(parent, "", "ams_nozzle_sync");
620 m_btn_sync->SetToolTip(_L("Synchronize nozzle and AMS information"));
621 m_btn_sync->SetCornerRadius(8);
622 StateColor btn_sync_bg_col(std::pair<wxColour, int>(wxColour("#CECECE"), StateColor::Pressed),
623 std::pair<wxColour, int>(wxColour("#F8F8F8"), StateColor::Hovered),
624 std::pair<wxColour, int>(wxColour("#F8F8F8"), StateColor::Normal));
625 StateColor btn_sync_bd_col(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Pressed),
626 std::pair<wxColour, int>(wxColour("#009688"), StateColor::Hovered),
627 std::pair<wxColour, int>(wxColour("#EEEEEE"), StateColor::Normal));
628 m_btn_sync->SetBackgroundColor(btn_sync_bg_col);
629 m_btn_sync->SetBorderColor(btn_sync_bd_col);
630 m_btn_sync->SetCanFocus(false);
631 m_btn_sync->SetPaddingSize({FromDIP(6), FromDIP(12)});
632 m_btn_sync->SetMinSize(SYNC_BUTTON_SIZE);
633 m_btn_sync->SetMaxSize(SYNC_BUTTON_SIZE);
634 m_btn_sync->SetVertical();
635 m_btn_sync->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) {
636 if (!curr_obj) {
637 MessageDialog msg_dlg(nullptr, _L("Please connect the printer first before synchronizing."), wxEmptyString, wxICON_WARNING | wxOK);
638 msg_dlg.ShowModal();
639 return;
640 }
641 BOOST_LOG_TRIVIAL(info) << "CalibrationPresetPage: sync_nozzle_info - machine object status:"
642 << " dev_id = " << curr_obj->get_dev_id()
643 << ", print_type = " << curr_obj->printer_type
644 << ", printer_status = " << curr_obj->print_status
645 << ", cali_finished = " << curr_obj->cali_finished
646 << ", cali_version = " << curr_obj->cali_version
647 << ", cache_flow_ratio = " << curr_obj->cache_flow_ratio
648 << ", sub_task_name = " << curr_obj->subtask_name
649 << ", gcode_file_name = " << curr_obj->m_gcode_file;
650
651 for (const CaliPresetInfo &preset_info : curr_obj->selected_cali_preset) {
652 BOOST_LOG_TRIVIAL(info) << "CalibrationPresetPage: sync_nozzle_info - selected preset: "
653 << "tray_id = " << preset_info.tray_id
654 << ", nozzle_diameter = " << preset_info.nozzle_diameter
655 << ", filament_id = " << preset_info.filament_id
656 << ", settring_id = " << preset_info.setting_id
657 << ", name = " << preset_info.name;
658 }
659
660 for (const auto& extruder : curr_obj->GetExtderSystem()->GetExtruders()) {
661 if (extruder.GetNozzleType() == NozzleType::ntUndefine) {
662 wxString msg = extruder.GetExtId() == 0 ?
663 _L("Printer right nozzle information has not been set. Please configure it before proceeding with the calibration.") :
664 _L("Printer left nozzle information has not been set. Please configure it before proceeding with the calibration.");
665 MessageDialog msg_dlg(nullptr, msg, wxEmptyString, wxICON_WARNING | wxOK);
666 msg_dlg.ShowModal();
667 break;
668 }
669 }
671 });
672
673 m_sync_button_text = new Label(parent, _L("AMS and nozzle information are synced"));
675 m_sync_button_text->Wrap(-1);
676 sync_button_sizer->Add(m_btn_sync);
677 sync_button_sizer->AddSpacer(FromDIP(20));
678 sync_button_sizer->Add(m_sync_button_text, 0, wxALIGN_CENTER_VERTICAL | wxALL, 0);
679 panel_sizer->Add(sync_button_sizer);
680 panel_sizer->AddSpacer(PRESET_GAP);
681
682 // single extruder
683 {
684 m_single_nozzle_info_panel = new wxPanel(parent);
685 m_single_nozzle_info_panel->SetBackgroundColour(*wxWHITE);
686 auto single_nozzle_sizer = new wxBoxSizer(wxVERTICAL);
687 auto nozzle_combo_text = new Label(m_single_nozzle_info_panel, _L("Nozzle Diameter"));
688 nozzle_combo_text->SetFont(Label::Head_14);
689 nozzle_combo_text->Wrap(-1);
690
691 single_nozzle_sizer->Add(nozzle_combo_text, 0, wxALL, 0);
692 single_nozzle_sizer->AddSpacer(FromDIP(10));
693 m_comboBox_nozzle_dia = new ComboBox(m_single_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
694 single_nozzle_sizer->Add(m_comboBox_nozzle_dia, 0, wxALL, 0);
695
699 // m_nozzle_diameter_tips->SetForegroundColour(wxColour(100, 100, 100));
701 single_nozzle_sizer->Add(m_nozzle_diameter_tips, 0, wxALL, 0);
702 single_nozzle_sizer->AddSpacer(PRESET_GAP);
703
704 auto nozzle_volume_type_text = new Label(m_single_nozzle_info_panel, _L("Nozzle Flow"));
705 nozzle_volume_type_text->SetFont(Label::Head_14);
706 nozzle_volume_type_text->Wrap(-1);
707
708 m_comboBox_nozzle_volume = new ComboBox(m_single_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
709 m_comboBox_nozzle_volume->Disable();
710
711 single_nozzle_sizer->Add(nozzle_volume_type_text, 0, wxALL, 0);
712 single_nozzle_sizer->AddSpacer(FromDIP(5));
713 single_nozzle_sizer->Add(m_comboBox_nozzle_volume, 0, wxALL, 0);
714 single_nozzle_sizer->AddSpacer(FromDIP(5));
715 single_nozzle_sizer->AddSpacer(PRESET_GAP);
716
717 m_single_nozzle_info_panel->SetSizer(single_nozzle_sizer);
718 panel_sizer->Add(m_single_nozzle_info_panel);
719 }
720
721 // multi extruder
722 {
723 m_multi_nozzle_info_panel = new wxPanel(parent);
724 m_multi_nozzle_info_panel->SetBackgroundColour(*wxWHITE);
725 auto nozzle_volume_sizer = new wxBoxSizer(wxVERTICAL);
726 auto nozzle_info_text = new Label(m_multi_nozzle_info_panel, _L("Nozzle Info"));
727 nozzle_info_text->SetFont(Label::Head_14);
728 nozzle_info_text->Wrap(-1);
729 nozzle_volume_sizer->Add(nozzle_info_text, 0, wxALL, 0);
730 //nozzle_volume_sizer->AddSpacer(FromDIP(10));
731
732 wxBoxSizer * type_sizer = new wxBoxSizer(wxHORIZONTAL);
733 m_left_nozzle_volume_type_sizer = new wxStaticBoxSizer(wxVERTICAL, m_multi_nozzle_info_panel, _L("Left Nozzle"));
734 {
735 //wxBoxSizer *nozzle_diameter_sizer = new wxBoxSizer(wxHORIZONTAL);
736 auto nozzle_diameter_text = new Label(m_multi_nozzle_info_panel, _L("Nozzle Diameter"));
737 nozzle_diameter_text->SetFont(Label::Head_14);
738 nozzle_diameter_text->Wrap(-1);
739
740 m_left_comboBox_nozzle_dia = new ComboBox(m_multi_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_FILAMENT_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
742
743 m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
744 m_left_nozzle_volume_type_sizer->Add(nozzle_diameter_text, 0, wxLEFT | wxRIGHT, 10);
745 m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
746 m_left_nozzle_volume_type_sizer->Add(m_left_comboBox_nozzle_dia, 0, wxLEFT | wxRIGHT, 10);
747 m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
748
749 //wxBoxSizer *nozzle_volume_sizer = new wxBoxSizer(wxHORIZONTAL);
750 auto nozzle_volume_type_text = new Label(m_multi_nozzle_info_panel, _L("Nozzle Flow"));
751 nozzle_volume_type_text->SetFont(Label::Head_14);
752 nozzle_volume_type_text->Wrap(-1);
753
754 m_left_comboBox_nozzle_volume = new ComboBox(m_multi_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_FILAMENT_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
756
757 m_left_nozzle_volume_type_sizer->Add(nozzle_volume_type_text, 0, wxLEFT | wxRIGHT, 10);
758 m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
760 m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
761
762 //m_left_nozzle_volume_type_sizer->Add(nozzle_diameter_sizer);
763 //m_left_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
764 //m_left_nozzle_volume_type_sizer->Add(nozzle_volume_sizer);
765 }
766
767 m_right_nozzle_volume_type_sizer = new wxStaticBoxSizer(wxVERTICAL, m_multi_nozzle_info_panel, _L("Right Nozzle"));
768 {
769 //wxBoxSizer *nozzle_diameter_sizer = new wxBoxSizer(wxHORIZONTAL);
770 auto nozzle_diameter_text = new Label(m_multi_nozzle_info_panel, _L("Nozzle Diameter"));
771 nozzle_diameter_text->SetFont(Label::Head_14);
772 nozzle_diameter_text->Wrap(-1);
773
774 m_right_comboBox_nozzle_dia = new ComboBox(m_multi_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_FILAMENT_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
776
777 m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
778 m_right_nozzle_volume_type_sizer->Add(nozzle_diameter_text, 0, wxLEFT | wxRIGHT, 10);
779 m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
781 m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
782
783 //wxBoxSizer *nozzle_volume_sizer = new wxBoxSizer(wxHORIZONTAL);
784 auto nozzle_volume_type_text = new Label(m_multi_nozzle_info_panel, _L("Nozzle Flow"));
785 nozzle_volume_type_text->SetFont(Label::Head_14);
786 nozzle_volume_type_text->Wrap(-1);
787
788 m_right_comboBox_nozzle_volume = new ComboBox(m_multi_nozzle_info_panel, wxID_ANY, "", wxDefaultPosition, CALIBRATION_FILAMENT_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
790
791 m_right_nozzle_volume_type_sizer->Add(nozzle_volume_type_text, 0, wxLEFT | wxRIGHT, 10);
792 m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
794 m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
795
796 //m_right_nozzle_volume_type_sizer->Add(nozzle_diameter_sizer);
797 //m_right_nozzle_volume_type_sizer->AddSpacer(FromDIP(5));
798 //m_right_nozzle_volume_type_sizer->Add(nozzle_volume_sizer);
799 }
800
801 type_sizer->Add(m_left_nozzle_volume_type_sizer, 1, wxEXPAND | wxRIGHT, 10);
802 type_sizer->Add(m_right_nozzle_volume_type_sizer, 1, wxEXPAND, 0);
803
804 nozzle_volume_sizer->Add(type_sizer);
805 nozzle_volume_sizer->AddSpacer(PRESET_GAP);
806
807 m_multi_nozzle_info_panel->SetSizer(nozzle_volume_sizer);
808 panel_sizer->Add(m_multi_nozzle_info_panel);
809
811 }
812
813 auto plate_type_combo_text = new Label(parent, _L("Plate Type"));
814 plate_type_combo_text->SetFont(Label::Head_14);
815 plate_type_combo_text->Wrap(-1);
816 panel_sizer->Add(plate_type_combo_text, 0, wxALL, 0);
817 panel_sizer->AddSpacer(FromDIP(10));
818 m_comboBox_bed_type = new ComboBox(parent, wxID_ANY, "", wxDefaultPosition, CALIBRATION_COMBOX_SIZE, 0, nullptr, wxCB_READONLY);
819 panel_sizer->Add(m_comboBox_bed_type, 0, wxALL, 0);
820
821 panel_sizer->AddSpacer(PRESET_GAP);
822
823 m_filament_from_panel = new wxPanel(parent);
824 m_filament_from_panel->Hide();
825 auto filament_from_sizer = new wxBoxSizer(wxVERTICAL);
826 auto filament_from_text = new Label(m_filament_from_panel, _L("Filament position"));
827 filament_from_text->SetFont(Label::Head_14);
828 filament_from_sizer->Add(filament_from_text, 0);
829
830 m_filament_from_panel->SetSizer(filament_from_sizer);
831 panel_sizer->Add(m_filament_from_panel, 0, wxBOTTOM, PRESET_GAP);
832
833 auto filament_for_title_sizer = new wxBoxSizer(wxHORIZONTAL);
834 auto filament_for_text = new Label(parent, _L("Filament For Calibration"));
835 filament_for_text->SetFont(Label::Head_14);
836 filament_for_title_sizer->Add(filament_for_text, 0, wxALIGN_CENTER);
837 filament_for_title_sizer->AddSpacer(FromDIP(25));
838 m_ams_sync_button = new ScalableButton(parent, wxID_ANY, "ams_fila_sync", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, false, 18);
839 m_ams_sync_button->SetBackgroundColour(*wxWHITE);
840 m_ams_sync_button->SetToolTip(_L("Synchronize filament list from AMS"));
841 filament_for_title_sizer->Add(m_ams_sync_button, 0, wxALIGN_CENTER);
842 panel_sizer->Add(filament_for_title_sizer);
843 panel_sizer->AddSpacer(FromDIP(6));
844
845 parent->SetSizer(panel_sizer);
846 panel_sizer->Fit(parent);
847
848 m_ams_sync_button->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
850 });
851
853
855}
#define CALIBRATION_FILAMENT_COMBOX_SIZE
Definition CalibrationWizardPage.hpp:36
#define CALIBRATION_COMBOX_SIZE
Definition CalibrationWizardPage.hpp:35
#define SYNC_BUTTON_SIZE
Definition CalibrationWizardPresetPage.cpp:60
static wxFont Head_14
Definition Label.hpp:45
Label * m_nozzle_diameter_tips
Definition CalibrationWizardPresetPage.hpp:320
void on_select_plate_type(wxCommandEvent &evt)
Definition CalibrationWizardPresetPage.cpp:1395
wxPanel * m_multi_nozzle_info_panel
Definition CalibrationWizardPresetPage.hpp:333
ComboBox * m_left_comboBox_nozzle_dia
Definition CalibrationWizardPresetPage.hpp:336
MachineObject * curr_obj
Definition CalibrationWizardPresetPage.hpp:379
void sync_ams_info(MachineObject *obj)
Definition CalibrationWizardPresetPage.cpp:2268
void on_select_nozzle(wxCommandEvent &evt)
Definition CalibrationWizardPresetPage.cpp:1386
Button * m_btn_sync
Definition CalibrationWizardPresetPage.hpp:329
wxPanel * m_filament_from_panel
Definition CalibrationWizardPresetPage.hpp:304
wxStaticBoxSizer * m_right_nozzle_volume_type_sizer
Definition CalibrationWizardPresetPage.hpp:361
ComboBox * m_comboBox_nozzle_dia
Definition CalibrationWizardPresetPage.hpp:316
ComboBox * m_comboBox_nozzle_volume
Definition CalibrationWizardPresetPage.hpp:317
void on_device_connected(MachineObject *obj) override
Definition CalibrationWizardPresetPage.cpp:2007
ComboBox * m_right_comboBox_nozzle_dia
Definition CalibrationWizardPresetPage.hpp:337
Label * m_sync_button_text
Definition CalibrationWizardPresetPage.hpp:330
wxPanel * m_single_nozzle_info_panel
Definition CalibrationWizardPresetPage.hpp:332
ComboBox * m_left_comboBox_nozzle_volume
Definition CalibrationWizardPresetPage.hpp:338
wxStaticBoxSizer * m_left_nozzle_volume_type_sizer
Definition CalibrationWizardPresetPage.hpp:360
ScalableButton * m_ams_sync_button
Definition CalibrationWizardPresetPage.hpp:365
ComboBox * m_right_comboBox_nozzle_volume
Definition CalibrationWizardPresetPage.hpp:339
@ Hovered
Definition StateColor.hpp:20
@ Normal
Definition StateColor.hpp:16
@ Pressed
Definition StateColor.hpp:21
@ ntUndefine
Definition CommonDefs.hpp:14

References _L, Label::Body_13, CALIBRATION_COMBOX_SIZE, CALIBRATION_FILAMENT_COMBOX_SIZE, CALIBRATION_TEXT_MAX_LENGTH, curr_obj, Slic3r::CaliPresetInfo::filament_id, Label::Head_14, StateColor::Hovered, m_ams_sync_button, m_btn_sync, m_comboBox_bed_type, m_comboBox_nozzle_dia, m_comboBox_nozzle_volume, m_filament_from_panel, m_left_comboBox_nozzle_dia, m_left_comboBox_nozzle_volume, m_left_nozzle_volume_type_sizer, m_multi_nozzle_info_panel, m_nozzle_diameter_tips, m_right_comboBox_nozzle_dia, m_right_comboBox_nozzle_volume, m_right_nozzle_volume_type_sizer, m_single_nozzle_info_panel, m_sync_button_text, Slic3r::CaliPresetInfo::name, StateColor::Normal, Slic3r::CaliPresetInfo::nozzle_diameter, Slic3r::ntUndefine, on_device_connected(), on_select_nozzle(), on_select_plate_type(), PRESET_GAP, StateColor::Pressed, Slic3r::CaliPresetInfo::setting_id, Slic3r::GUI::DPIAware< P >::ShowModal(), sync_ams_info(), SYNC_BUTTON_SIZE, and Slic3r::CaliPresetInfo::tray_id.

Referenced by create_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ Enable_Send_Button()

void Slic3r::GUI::CalibrationPresetPage::Enable_Send_Button ( bool enable)
protected
1979{
1981}
@ CALI_ACTION_CALI
Definition CalibrationWizardPage.hpp:227

References Slic3r::GUI::CALI_ACTION_CALI, and Slic3r::GUI::CalibrationWizardPage::m_action_panel.

Referenced by on_cali_cancel_job(), on_cali_finished_job(), on_cali_start_job(), and show_status().

Here is the caller graph for this function:

◆ format_text()

wxString Slic3r::GUI::CalibrationPresetPage::format_text ( wxString & m_msg)
1313{
1314 if (wxGetApp().app_config->get("language") != "zh_CN") { return m_msg; }
1315
1316 wxString out_txt = m_msg;
1317 wxString count_txt = "";
1318 int new_line_pos = 0;
1319
1320 for (int i = 0; i < m_msg.length(); i++) {
1321 auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt);
1322 if (text_size.x < (FromDIP(600))) {
1323 count_txt += m_msg[i];
1324 }
1325 else {
1326 out_txt.insert(i - 1, '\n');
1327 count_txt = "";
1328 }
1329 }
1330 return out_txt;
1331}

References Slic3r::GUI::CalibrationWizardPage::m_statictext_printer_msg.

Referenced by update_priner_status_msg().

Here is the caller graph for this function:

◆ get_cali_stage()

void Slic3r::GUI::CalibrationPresetPage::get_cali_stage ( CaliPresetStage & stage,
float & value )
2578{
2579 m_cali_stage_panel->get_cali_stage(stage, value);
2580
2582 std::map<int, Preset*> selected_filaments = get_selected_filaments();
2583 if (!selected_filaments.empty()) {
2584 const ConfigOptionFloatsNullable* flow_ratio_opt = selected_filaments.begin()->second->config.option<ConfigOptionFloatsNullable>("filament_flow_ratio");
2585 if (flow_ratio_opt) {
2586 m_cali_stage_panel->set_flow_ratio_value(flow_ratio_opt->get_at(0));
2587 value = flow_ratio_opt->get_at(0);
2588 }
2589 }
2590 }
2591}
@ CALI_MANUAL_STAGE_2
Definition CalibrationWizardPresetPage.hpp:35
ConfigOptionFloatsTempl< true > ConfigOptionFloatsNullable
Definition Config.hpp:1016

References Slic3r::GUI::CALI_MANUAL_STAGE_2, Slic3r::ConfigOptionVector< double >::get_at(), get_selected_filaments(), and m_cali_stage_panel.

Referenced by Slic3r::GUI::CalibrationWizard::cache_preset_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_current_object()

MachineObject * Slic3r::GUI::CalibrationPresetPage::get_current_object ( )
inline
250{ return curr_obj; }

References curr_obj.

◆ get_custom_range_values()

wxArrayString Slic3r::GUI::CalibrationPresetPage::get_custom_range_values ( )
2820{
2822 return m_custom_range_panel->get_values();
2823 }
2824 return wxArrayString();
2825}

References m_custom_range_panel.

Referenced by Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_extruder_id_by_tray_id()

int Slic3r::GUI::CalibrationPresetPage::get_extruder_id_by_tray_id ( int tray_id)
591{
592 // An AMS behind a Filament Track Switch feeds both extruders, so the extruder is the one
593 // whose panel the filament was selected in.
594 if (curr_obj && curr_obj->is_multi_extruders()) {
595 for (FilamentComboBox *fcb : get_selected_filament_combobox()) {
596 if (fcb->get_tray_id() != tray_id)
597 continue;
598 const bool is_deputy = std::find(m_deputy_filament_comboBox_list.begin(), m_deputy_filament_comboBox_list.end(), fcb) !=
600 return is_deputy ? DEPUTY_EXTRUDER_ID : MAIN_EXTRUDER_ID;
601 }
602 }
603
604 int ams_id = tray_id / 4, slot_id, unused_tray_id;
605 if (curr_obj)
606 get_tray_ams_and_slot_id(curr_obj, tray_id, ams_id, slot_id, unused_tray_id);
608 return m_ams_id_to_extruder_id_map[ams_id];
609 }
610
611 return 0;
612}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101
std::vector< FilamentComboBox * > get_selected_filament_combobox()
Definition CalibrationWizardPresetPage.cpp:2500
std::unordered_map< int, int > m_ams_id_to_extruder_id_map
Definition CalibrationWizardPresetPage.hpp:351
void get_tray_ams_and_slot_id(MachineObject *obj, int in_tray_id, int &ams_id, int &slot_id, int &tray_id)
Definition CalibUtils.cpp:231

References curr_obj, DEPUTY_EXTRUDER_ID, get_selected_filament_combobox(), Slic3r::GUI::get_tray_ams_and_slot_id(), m_ams_id_to_extruder_id_map, m_deputy_filament_comboBox_list, and MAIN_EXTRUDER_ID.

Referenced by Slic3r::GUI::CalibrationWizard::cache_preset_info(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_extruder_type()

ExtruderType Slic3r::GUI::CalibrationPresetPage::get_extruder_type ( int extruder_id) const
1061{
1062 if (curr_obj) {
1063 int extruder_idx = 0;
1064 if (curr_obj->is_multi_extruders()) {
1065 if (extruder_id == RIGHT_EXTRUDER_ID) {
1066 extruder_idx = 1;
1067 }
1068 }
1069 if (m_extrder_types.size() > extruder_idx)
1070 return m_extrder_types[extruder_idx];
1071 }
1073}
#define RIGHT_EXTRUDER_ID
Definition CalibrationWizardPresetPage.cpp:64

References curr_obj, Slic3r::etDirectDrive, m_extrder_types, and RIGHT_EXTRUDER_ID.

Referenced by Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_filament_ams_list()

std::map< int, DynamicPrintConfig > Slic3r::GUI::CalibrationPresetPage::get_filament_ams_list ( ) const
inline
230{ return filament_ams_list; }
std::map< int, DynamicPrintConfig > filament_ams_list
Definition CalibrationWizardPresetPage.hpp:372

References filament_ams_list.

Referenced by Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_index_by_tray_id()

int Slic3r::GUI::CalibrationPresetPage::get_index_by_tray_id ( int tray_id)
2490{
2491 std::vector<FilamentComboBox*> fcb_list = get_selected_filament_combobox();
2492 for (auto fcb : fcb_list) {
2493 if (fcb->get_tray_id() == tray_id) {
2494 return fcb->get_index();
2495 }
2496 }
2497 return -1;
2498}

References get_selected_filament_combobox().

Referenced by Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_next_page()

CalibrationWizardPage * Slic3r::GUI::CalibrationWizardPage::get_next_page ( )
inlineinherited
309{ return m_next_page; }
CalibrationWizardPage * m_next_page
Definition CalibrationWizardPage.hpp:350

References CalibrationWizardPage(), and m_next_page.

Here is the call graph for this function:

◆ get_nozzle_diameter()

float Slic3r::GUI::CalibrationPresetPage::get_nozzle_diameter ( int extruder_id) const
1021{
1022 float nozzle_dia = -1.f;
1023 if (!curr_obj)
1024 return nozzle_dia;
1025
1026 if (curr_obj->is_multi_extruders()) {
1027 if (extruder_id == LEFT_EXTRUDER_ID) {
1028 if (m_left_comboBox_nozzle_dia->GetSelection() >= 0 && m_left_comboBox_nozzle_dia->GetSelection() < NOZZLE_LIST_COUNT) {
1029 nozzle_dia = nozzle_diameter_list[m_left_comboBox_nozzle_dia->GetSelection()];
1030 }
1031 } else if (extruder_id == RIGHT_EXTRUDER_ID) {
1032 if (m_right_comboBox_nozzle_dia->GetSelection() >= 0 && m_right_comboBox_nozzle_dia->GetSelection() < NOZZLE_LIST_COUNT) {
1033 nozzle_dia = nozzle_diameter_list[m_right_comboBox_nozzle_dia->GetSelection()];
1034 }
1035 }
1036 }
1037 else if (m_comboBox_nozzle_dia->GetSelection() >= 0 && m_comboBox_nozzle_dia->GetSelection() < NOZZLE_LIST_COUNT) {
1038 nozzle_dia = nozzle_diameter_list[m_comboBox_nozzle_dia->GetSelection()];
1039 }
1040
1041 return nozzle_dia;
1042}
#define LEFT_EXTRUDER_ID
Definition CalibrationWizardPresetPage.cpp:63
#define NOZZLE_LIST_COUNT
Definition CalibrationWizardPresetPage.cpp:857
float nozzle_diameter_list[NOZZLE_LIST_COUNT]
Definition CalibrationWizardPresetPage.cpp:859

References curr_obj, LEFT_EXTRUDER_ID, m_comboBox_nozzle_dia, m_left_comboBox_nozzle_dia, m_right_comboBox_nozzle_dia, Slic3r::GUI::nozzle_diameter_list, NOZZLE_LIST_COUNT, and RIGHT_EXTRUDER_ID.

Referenced by Slic3r::GUI::CalibrationWizard::cache_preset_info(), is_nozzle_info_synced(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_nozzle_value()

float Slic3r::GUI::CalibrationPresetPage::get_nozzle_value ( )
protected
1984{
1985 double nozzle_value = 0.0;
1986 wxString nozzle_value_str = m_comboBox_nozzle_dia->GetValue();
1987 try {
1988 nozzle_value_str.ToDouble(&nozzle_value);
1989 }
1990 catch (...) {
1991 ;
1992 }
1993
1994 return nozzle_value;
1995}

References m_comboBox_nozzle_dia.

Referenced by get_print_preset(), and update_combobox_filaments().

Here is the caller graph for this function:

◆ get_nozzle_volume_type()

NozzleVolumeType Slic3r::GUI::CalibrationPresetPage::get_nozzle_volume_type ( int extruder_id) const
1045{
1046 if (curr_obj) {
1047 if (curr_obj->is_multi_extruders()) {
1048 if (extruder_id == LEFT_EXTRUDER_ID) {
1049 return NozzleVolumeType(intptr_t(m_left_comboBox_nozzle_volume->GetClientData(m_left_comboBox_nozzle_volume->GetSelection())));
1050 } else if (extruder_id == RIGHT_EXTRUDER_ID) {
1051 return NozzleVolumeType(intptr_t(m_right_comboBox_nozzle_volume->GetClientData(m_right_comboBox_nozzle_volume->GetSelection())));
1052 }
1053 }
1054 else
1055 return NozzleVolumeType(intptr_t(m_comboBox_nozzle_volume->GetClientData(m_comboBox_nozzle_volume->GetSelection())));
1056 }
1058}
NozzleVolumeType
Definition PrintConfig.hpp:618
@ nvtStandard
Definition PrintConfig.hpp:619

References curr_obj, LEFT_EXTRUDER_ID, m_comboBox_nozzle_volume, m_left_comboBox_nozzle_volume, m_right_comboBox_nozzle_volume, Slic3r::nvtStandard, and RIGHT_EXTRUDER_ID.

Referenced by Slic3r::GUI::CalibrationWizard::cache_preset_info(), is_nozzle_info_synced(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_pa_cali_method()

CalibMode Slic3r::GUI::CalibrationPresetPage::get_pa_cali_method ( )
2828{
2830 int selected_mode = m_pa_cali_method_combox->get_selection();
2831 if (selected_mode == PA_LINE) {
2833 }
2834 else if (selected_mode == PA_PATTERN) {
2836 }
2837 }
2839}
static int PA_PATTERN
Definition CalibrationWizardPresetPage.cpp:68
static int PA_LINE
Definition CalibrationWizardPresetPage.cpp:67

References Slic3r::Calib_PA_Line, Slic3r::Calib_PA_Pattern, m_pa_cali_method_combox, Slic3r::GUI::PA_LINE, and Slic3r::GUI::PA_PATTERN.

Referenced by Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_page_status()

CaliPresetPageStatus Slic3r::GUI::CalibrationPresetPage::get_page_status ( )
inline
249{ return m_page_status; }
CaliPresetPageStatus m_page_status
Definition CalibrationWizardPresetPage.hpp:374

References m_page_status.

◆ get_page_type()

CaliPageType Slic3r::GUI::CalibrationWizardPage::get_page_type ( )
inlineinherited
306{ return m_page_type; }

References m_page_type.

Referenced by Slic3r::GUI::CalibrationWizard::on_cali_go_home().

Here is the caller graph for this function:

◆ get_preset_info()

void Slic3r::GUI::CalibrationPresetPage::get_preset_info ( float & nozzle_dia,
BedType & plate_type )
2566{
2567 if (m_comboBox_nozzle_dia->GetSelection() >=0 && m_comboBox_nozzle_dia->GetSelection() < NOZZLE_LIST_COUNT) {
2568 nozzle_dia = nozzle_diameter_list[m_comboBox_nozzle_dia->GetSelection()];
2569 } else {
2570 nozzle_dia = -1.0f;
2571 }
2572
2573 if (m_comboBox_bed_type->GetSelection() >= 0)
2574 plate_type = static_cast<BedType>(m_displayed_bed_types[m_comboBox_bed_type->GetSelection()]);
2575}
std::vector< BedType > m_displayed_bed_types
Definition CalibrationWizardPresetPage.hpp:322
BedType
Definition PrintConfig.hpp:507

References m_comboBox_bed_type, m_comboBox_nozzle_dia, m_displayed_bed_types, Slic3r::GUI::nozzle_diameter_list, and NOZZLE_LIST_COUNT.

Referenced by Slic3r::GUI::PressureAdvanceWizard::on_cali_save(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_prev_page()

CalibrationWizardPage * Slic3r::GUI::CalibrationWizardPage::get_prev_page ( )
inlineinherited
308{ return m_prev_page; }
CalibrationWizardPage * m_prev_page
Definition CalibrationWizardPage.hpp:349

References CalibrationWizardPage(), and m_prev_page.

Here is the call graph for this function:

◆ get_print_preset()

Preset * Slic3r::GUI::CalibrationPresetPage::get_print_preset ( )
2786{
2787 Preset* printer_preset = get_printer_preset(curr_obj, get_nozzle_value());
2788
2789 Preset* print_preset = nullptr;
2790 wxArrayString print_items;
2791
2792 // get default print profile
2793 std::string default_print_profile_name;
2794 if (printer_preset && printer_preset->config.has("default_print_profile")) {
2795 default_print_profile_name = printer_preset->config.opt_string("default_print_profile");
2796 }
2797
2798 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
2799 if (preset_bundle) {
2800 for (auto print_it = preset_bundle->prints.begin(); print_it != preset_bundle->prints.end(); print_it++) {
2801 if (print_it->name == default_print_profile_name) {
2802 print_preset = &(*print_it);
2803 BOOST_LOG_TRIVIAL(trace) << "CaliPresetPage: get_print_preset = " << print_preset->name;
2804 }
2805 }
2806 }
2807
2808 return print_preset;
2809}
Preset * get_printer_preset(MachineObject *obj, float nozzle_value)
Definition CalibrationWizardPresetPage.cpp:2757
float get_nozzle_value()
Definition CalibrationWizardPresetPage.cpp:1983
void trace(unsigned int level, const char *message)
Definition utils.cpp:247
@ Preset
Definition calib.hpp:39

References Slic3r::PresetCollection::begin(), Slic3r::Preset::config, curr_obj, Slic3r::PresetCollection::end(), get_nozzle_value(), get_printer_preset(), Slic3r::ConfigOptionResolver::has(), Slic3r::Preset::name, Slic3r::DynamicConfig::opt_string(), Slic3r::PresetBundle::prints, and Slic3r::trace().

Referenced by get_print_preset_name(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_print_preset_name()

std::string Slic3r::GUI::CalibrationPresetPage::get_print_preset_name ( )
2812{
2813 Preset* print_preset = get_print_preset();
2814 if (print_preset)
2815 return print_preset->name;
2816 return "";
2817}
Preset * get_print_preset()
Definition CalibrationWizardPresetPage.cpp:2785

References get_print_preset(), and Slic3r::Preset::name.

Here is the call graph for this function:

◆ get_printer_preset()

Preset * Slic3r::GUI::CalibrationPresetPage::get_printer_preset ( MachineObject * obj,
float nozzle_value )
2758{
2759 if (!obj) return nullptr;
2760
2761 Preset* printer_preset = nullptr;
2762 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
2763 for (auto printer_it = preset_bundle->printers.begin(); printer_it != preset_bundle->printers.end(); printer_it++) {
2764 // only use system printer preset
2765 if (!printer_it->is_system) continue;
2766
2767 ConfigOption* printer_nozzle_opt = printer_it->config.option("nozzle_diameter");
2768 ConfigOptionFloats *printer_nozzle_vals = nullptr;
2769 if (printer_nozzle_opt)
2770 printer_nozzle_vals = dynamic_cast<ConfigOptionFloats*>(printer_nozzle_opt);
2771 std::string model_id = printer_it->get_current_printer_type(preset_bundle);
2772
2773 std::string printer_type = obj->printer_type;
2774 if (obj->is_support_upgrade_kit && obj->installed_upgrade_kit) { printer_type = "C12"; }
2775 if (model_id.compare(printer_type) == 0
2776 && printer_nozzle_vals
2777 && abs(printer_nozzle_vals->get_at(0) - nozzle_value) < 1e-3) {
2778 printer_preset = &(*printer_it);
2779 }
2780 }
2781
2782 return printer_preset;
2783}
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015

References Slic3r::PresetCollection::begin(), Slic3r::PresetCollection::end(), Slic3r::ConfigOptionVector< double >::get_at(), Slic3r::MachineObject::installed_upgrade_kit, Slic3r::MachineObject::is_support_upgrade_kit, Slic3r::MachineObject::printer_type, and Slic3r::PresetBundle::printers.

Referenced by get_print_preset(), init_selection_values(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), Slic3r::GUI::PressureAdvanceWizard::on_cali_start(), and update_combobox_filaments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_selected_filament_combobox()

std::vector< FilamentComboBox * > Slic3r::GUI::CalibrationPresetPage::get_selected_filament_combobox ( )
2501{
2502 std::vector<FilamentComboBox*> fcb_list;
2503
2504 if (curr_obj && curr_obj->is_multi_extruders()) {
2506 for (auto &fcb : m_main_filament_comboBox_list) {
2507 if (fcb->GetCheckBox()->GetValue()) {
2508 fcb_list.push_back(fcb);
2509 }
2510 }
2511 for (auto &fcb : m_deputy_filament_comboBox_list) {
2512 if (fcb->GetCheckBox()->GetValue()) {
2513 fcb_list.push_back(fcb);
2514 }
2515 }
2517 for (auto &fcb : m_main_filament_comboBox_list) {
2518 if (fcb->GetRadioBox()->GetValue()) {
2519 fcb_list.push_back(fcb);
2520 }
2521 }
2522 for (auto &fcb : m_deputy_filament_comboBox_list) {
2523 if (fcb->GetRadioBox()->GetValue()) {
2524 fcb_list.push_back(fcb);
2525 }
2526 }
2527 }
2528 }
2529 else {
2531 for (auto &fcb : m_filament_comboBox_list) {
2532 if (fcb->GetCheckBox()->GetValue()) {
2533 fcb_list.push_back(fcb);
2534 }
2535 }
2537 for (auto &fcb : m_filament_comboBox_list) {
2538 if (fcb->GetRadioBox()->GetValue()) {
2539 fcb_list.push_back(fcb);
2540 }
2541 }
2542 }
2543 }
2544
2545 return fcb_list;
2546}
@ CALI_MODEL_MULITI
Definition CalibrationWizardPage.hpp:60

References Slic3r::GUI::CALI_MODEL_MULITI, Slic3r::GUI::CALI_MODEL_SINGLE, curr_obj, Slic3r::GUI::CalibrationWizardPage::m_cali_filament_mode, m_deputy_filament_comboBox_list, m_filament_comboBox_list, and m_main_filament_comboBox_list.

Referenced by get_extruder_id_by_tray_id(), get_index_by_tray_id(), and get_selected_filaments().

Here is the caller graph for this function:

◆ get_selected_filaments()

std::map< int, Preset * > Slic3r::GUI::CalibrationPresetPage::get_selected_filaments ( )
2549{
2550 std::map<int, Preset*> out;
2551 std::vector<FilamentComboBox*> fcb_list = get_selected_filament_combobox();
2552
2553 for (int i = 0; i < fcb_list.size(); i++) {
2554 Preset* preset = const_cast<Preset*>(fcb_list[i]->GetComboBox()->get_selected_preset());
2555 // valid tray id
2556 if (fcb_list[i]->get_tray_id() >= 0) {
2557 out.emplace(std::make_pair(fcb_list[i]->get_tray_id(), preset));
2558 }
2559 }
2560
2561
2562 return out;
2563}

References get_selected_filament_combobox().

Referenced by Slic3r::GUI::CalibrationWizard::cache_preset_info(), check_filament_compatible(), get_cali_stage(), Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), Slic3r::GUI::PressureAdvanceWizard::on_cali_start(), and on_recommend_input_value().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_sending_progress_bar()

std::shared_ptr< ProgressIndicator > Slic3r::GUI::CalibrationPresetPage::get_sending_progress_bar ( )
inline
238 {
239 return m_sending_panel->get_sending_progress_bar();
240 }

References m_sending_panel.

Referenced by Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the caller graph for this function:

◆ get_status()

CaliPresetPageStatus Slic3r::GUI::CalibrationPresetPage::get_status ( )
inlineprotected
298{ return m_page_status; }

References m_page_status.

◆ init_selection_values()

void Slic3r::GUI::CalibrationPresetPage::init_selection_values ( )
protected
897{
898 // init nozzle diameter and nozzle volume
899 {
900 m_comboBox_nozzle_dia->Clear();
901 for (int i = 0; i < NOZZLE_LIST_COUNT; i++) {
902 m_comboBox_nozzle_dia->AppendString(wxString::Format("%1.1f mm", nozzle_diameter_list[i]));
903 }
905
907 }
908
909 Preset* cur_printer_preset = get_printer_preset(curr_obj, 0.4);
910
911 m_comboBox_bed_type->Clear();
912 m_displayed_bed_types.clear();
913
914 // init plate type
915 int curr_selection = 0;
916 const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type");
917 if (bed_type_def && bed_type_def->enum_keys_map) {
918 int select_index = 0;
919 int bed_type_value = 0;
920 for (auto item : bed_type_def->enum_labels) {
921 bed_type_value++;
922 if (cur_printer_preset) {
923 const VendorProfile::PrinterModel *pm = PresetUtils::system_printer_model(*cur_printer_preset);
924 if (pm) {
925 bool find = std::find(pm->not_support_bed_types.begin(), pm->not_support_bed_types.end(), item) != pm->not_support_bed_types.end();
926 if (find) {
927 continue;
928 }
929 }
930 }
931
932 if (item == "Textured PEI Plate") {
933 curr_selection = select_index;
934 }
935
936 m_comboBox_bed_type->AppendString(_L(item));
937 m_displayed_bed_types.emplace_back(BedType(bed_type_value));
938 select_index++;
939 }
940 m_comboBox_bed_type->SetSelection(curr_selection);
941 }
942
943 // left
944 {
946 for (int i = 0; i < NOZZLE_LIST_COUNT; i++) {
947 m_left_comboBox_nozzle_dia->AppendString(wxString::Format("%1.1f mm", nozzle_diameter_list[i]));
948 }
950
952 }
953
954 // right
955 {
957 for (int i = 0; i < NOZZLE_LIST_COUNT; i++) {
958 m_right_comboBox_nozzle_dia->AppendString(wxString::Format("%1.1f mm", nozzle_diameter_list[i]));
959 }
961
963 }
964}
#define NOZZLE_LIST_DEFAULT
Definition CalibrationWizardPresetPage.cpp:858
const ConfigOptionDef * get(const t_config_option_key &opt_key) const
Definition Config.hpp:2662
static void fill_nozzle_volume_combo(ComboBox *combo)
Definition CalibrationWizardPresetPage.cpp:872
const VendorProfile::PrinterModel * system_printer_model(const Preset &preset)
Definition Preset.cpp:5081
const PrintConfigDef print_config_def
Definition PrintConfig.cpp:10099
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298

References _L, curr_obj, Slic3r::ConfigOptionDef::enum_keys_map, Slic3r::ConfigOptionDef::enum_labels, Slic3r::GUI::fill_nozzle_volume_combo(), get_printer_preset(), m_comboBox_bed_type, m_comboBox_nozzle_dia, m_comboBox_nozzle_volume, m_displayed_bed_types, m_left_comboBox_nozzle_dia, m_left_comboBox_nozzle_volume, m_right_comboBox_nozzle_dia, m_right_comboBox_nozzle_volume, Slic3r::VendorProfile::PrinterModel::not_support_bed_types, Slic3r::GUI::nozzle_diameter_list, NOZZLE_LIST_COUNT, NOZZLE_LIST_DEFAULT, Slic3r::print_config_def, and Slic3r::PresetUtils::system_printer_model().

Referenced by create_page(), and on_device_connected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init_with_machine()

void Slic3r::GUI::CalibrationPresetPage::init_with_machine ( MachineObject * obj)
2138{
2139 if (!obj) return;
2140
2141 auto get_nozzle_diameter_list_index = [&obj](int extruder_id) -> int {
2142 for (int i = 0; i < NOZZLE_LIST_COUNT; i++) {
2143 if (abs(obj->GetExtderSystem()->GetNozzleDiameter(extruder_id) - nozzle_diameter_list[i]) < 1e-3) {
2144 return i;
2145 }
2146 }
2147 return -1;
2148 };
2149
2150 //set flow ratio calibration type
2151 m_cali_stage_panel->set_flow_ratio_calibration_type(obj->flow_ratio_calibration_type);
2152 // set nozzle value from machine
2153 bool nozzle_is_set = false;
2154 for (int i = 0; i < NOZZLE_LIST_COUNT; i++) {
2155 if (abs(obj->GetExtderSystem()->GetNozzleDiameter(0) - nozzle_diameter_list[i]) < 1e-3) {
2156 if (m_comboBox_nozzle_dia->GetCount() > i) {
2157 m_comboBox_nozzle_dia->SetSelection(i);
2158 nozzle_is_set = true;
2159 }
2160 }
2161 }
2162
2163 if (nozzle_is_set) {
2164 wxCommandEvent event(wxEVT_COMBOBOX);
2165 event.SetEventObject(this);
2166 wxPostEvent(m_comboBox_nozzle_dia, event);
2167 m_comboBox_nozzle_dia->SetToolTip(_L("The nozzle diameter has been synchronized from the printer Settings"));
2168 } else {
2169 m_comboBox_nozzle_dia->SetToolTip(wxEmptyString);
2170 // set default to 0.4
2173 }
2174
2175 if (obj->is_multi_extruders()) {
2176 for (size_t i = 0; i < obj->GetExtderSystem()->GetTotalExtderCount(); ++i) {
2177 if (i == LEFT_EXTRUDER_ID) {
2178 int index = get_nozzle_diameter_list_index(LEFT_EXTRUDER_ID);
2179 if ((index != -1) && m_left_comboBox_nozzle_dia->GetCount() > index) {
2180 m_left_comboBox_nozzle_dia->SetSelection(index);
2181 wxCommandEvent event(wxEVT_COMBOBOX);
2182 event.SetEventObject(this);
2183 wxPostEvent(m_left_comboBox_nozzle_dia, event);
2184 m_left_comboBox_nozzle_dia->SetToolTip(_L("The nozzle diameter has been synchronized from the printer Settings"));
2185 }
2186 else {
2187 m_left_comboBox_nozzle_dia->SetToolTip(wxEmptyString);
2190 }
2191
2192 if (obj->GetExtderSystem()->GetNozzleFlowType(i) != NozzleFlowType::NONE_FLOWTYPE) {
2193 select_nozzle_volume(m_left_comboBox_nozzle_volume, DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(i)));
2194 } else {
2195 m_left_comboBox_nozzle_volume->SetSelection(0);
2196 }
2197 }
2198 else if (i == RIGHT_EXTRUDER_ID) {
2199 int index = get_nozzle_diameter_list_index(RIGHT_EXTRUDER_ID);
2200 if ((index != -1) && m_right_comboBox_nozzle_dia->GetCount() > index) {
2201 m_right_comboBox_nozzle_dia->SetSelection(index);
2202 wxCommandEvent event(wxEVT_COMBOBOX);
2203 event.SetEventObject(this);
2204 wxPostEvent(m_right_comboBox_nozzle_dia, event);
2205 m_right_comboBox_nozzle_dia->SetToolTip(_L("The nozzle diameter has been synchronized from the printer Settings"));
2206 } else {
2207 m_right_comboBox_nozzle_dia->SetToolTip(wxEmptyString);
2210 }
2211
2212 if (obj->GetExtderSystem()->GetNozzleFlowType(i) != NozzleFlowType::NONE_FLOWTYPE) {
2213 select_nozzle_volume(m_right_comboBox_nozzle_volume, DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(i)));
2214 } else {
2215 m_right_comboBox_nozzle_volume->SetSelection(0);
2216 }
2217 }
2218 }
2219
2220 if (!obj->is_main_extruder_on_left() && m_main_extruder_on_left) {
2223
2224 m_main_sizer->GetStaticBox()->SetLabel(_L("Right Nozzle"));
2225 m_deputy_sizer->GetStaticBox()->SetLabel(_L("Left Nozzle"));
2226 m_multi_exturder_ams_sizer->Add(m_deputy_sizer, 1, wxEXPAND | wxALL, 10);
2227 m_multi_exturder_ams_sizer->Add(m_main_sizer, 1, wxEXPAND | wxALL, 10);
2228
2230 }
2231 else if (obj->is_main_extruder_on_left() && !m_main_extruder_on_left) {
2234
2235 m_main_sizer->GetStaticBox()->SetLabel(_L("Left Nozzle"));
2236 m_deputy_sizer->GetStaticBox()->SetLabel(_L("Right Nozzle"));
2237 m_multi_exturder_ams_sizer->Add(m_main_sizer, 1, wxEXPAND | wxALL, 10);
2238 m_multi_exturder_ams_sizer->Add(m_deputy_sizer, 1, wxEXPAND | wxALL, 10);
2239
2241 }
2242
2246 m_filament_list_panel->Hide();
2247 }
2248 else {
2249 if ((obj->GetExtderSystem()->GetTotalExtderCount() > 0) && (obj->GetExtderSystem()->GetNozzleFlowType(0) != NozzleFlowType::NONE_FLOWTYPE))
2250 {
2251 select_nozzle_volume(m_comboBox_nozzle_volume, DevNozzle::ToNozzleVolumeType(obj->GetExtderSystem()->GetNozzleFlowType(0)));
2252 } else {
2253 m_comboBox_nozzle_volume->SetSelection(0);
2254 }
2255
2259 m_filament_list_panel->Show();
2260 }
2261
2262 Layout();
2263
2264 // init filaments for calibration
2265 sync_ams_info(obj);
2266}
static void select_nozzle_volume(ComboBox *combo, NozzleVolumeType volume_type)
Definition CalibrationWizardPresetPage.cpp:863
@ NONE_FLOWTYPE
Definition DevDefs.h:117
static NozzleVolumeType ToNozzleVolumeType(const NozzleFlowType &type)
Definition DevNozzleSystem.cpp:52

References _L, Slic3r::MachineObject::flow_ratio_calibration_type, Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevExtderSystem::GetNozzleDiameter(), Slic3r::DevExtderSystem::GetNozzleFlowType(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::MachineObject::is_main_extruder_on_left(), Slic3r::MachineObject::is_multi_extruders(), LEFT_EXTRUDER_ID, m_cali_stage_panel, m_comboBox_nozzle_dia, m_comboBox_nozzle_volume, m_deputy_sizer, m_filament_list_panel, m_left_comboBox_nozzle_dia, m_left_comboBox_nozzle_volume, m_main_extruder_on_left, m_main_sizer, m_multi_exturder_ams_sizer, m_multi_exutrder_filament_list_panel, m_multi_nozzle_info_panel, m_right_comboBox_nozzle_dia, m_right_comboBox_nozzle_volume, m_single_nozzle_info_panel, Slic3r::NONE_FLOWTYPE, Slic3r::GUI::nozzle_diameter_list, NOZZLE_LIST_COUNT, NOZZLE_LIST_DEFAULT, RIGHT_EXTRUDER_ID, Slic3r::GUI::select_nozzle_volume(), sync_ams_info(), and Slic3r::DevNozzle::ToNozzleVolumeType().

Referenced by on_device_connected().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_filament_in_blacklist()

bool Slic3r::GUI::CalibrationPresetPage::is_filament_in_blacklist ( int tray_id,
Preset * preset,
std::string & error_tips )
protected
1520{
1521 if (!curr_obj)
1522 return true;
1523
1524 int ams_id;
1525 int slot_id;
1526 int out_tray_id;
1527 get_tray_ams_and_slot_id(curr_obj, tray_id, ams_id, slot_id, out_tray_id);
1528
1529 if (wxGetApp().app_config->get("skip_ams_blacklist_check") != "true") {
1530 DevFilaBlacklist::CheckFilamentInfo check_info;
1531 check_info.dev_id = curr_obj->get_dev_id();
1532 check_info.model_id = curr_obj->printer_type;
1533 check_info.fila_id = preset->filament_id;
1534 preset->get_filament_type(check_info.fila_type);
1535 check_info.ams_id = ams_id;
1536 check_info.slot_id = slot_id;
1537 check_info.has_filament_switch = curr_obj->GetFilaSwitch()->IsInstalled();
1538 // fila_name intentionally left empty: the engine recovers it from the selected AMS slot,
1539 // preserving the name-match behavior.
1540
1541 auto vendor = dynamic_cast<ConfigOptionStrings*> (preset->config.option("filament_vendor"));
1542 if (vendor && (vendor->values.size() > 0)) {
1543 check_info.fila_vendor = vendor->values[0];
1544 }
1545
1546 const auto &result = DevFilaBlacklist::check_filaments_in_blacklist(check_info);
1547
1548 if (const auto &prohibition_items = result.get_items_by_action("prohibition"); !prohibition_items.empty()) {
1549 wxString combined_msg;
1550 for (const auto &item : prohibition_items) { combined_msg += item.info_msg + "\n"; }
1551 error_tips = combined_msg.ToUTF8().data();
1552 return false;
1553 }
1554
1555 if (const auto &warning_items = result.get_items_by_action("warning"); !warning_items.empty()) {
1556 wxString combined_msg;
1557 for (const auto &item : warning_items) { combined_msg += item.info_msg + "\n"; }
1558 error_tips = combined_msg.ToUTF8().data();
1559 return true;
1560 }
1561
1562 error_tips = "";
1563 return true;
1564 }
1565 if (devPrinterUtil::IsVirtualSlot(ams_id)) {
1567 std::string filamnt_type;
1568 preset->get_filament_type(filamnt_type);
1569 if (filamnt_type == "TPU") {
1570 error_tips = _u8L("TPU is not supported for Flow Dynamics Auto-Calibration.");
1571 return false;
1572 }
1573 }
1574 }
1575 return true;
1576}
static CheckResult check_filaments_in_blacklist(const CheckFilamentInfo &info)
Definition DevFilaBlackList.cpp:406
CalibrationMethod m_cali_method
Definition CalibrationWizardPage.hpp:340
static bool IsVirtualSlot(int ams_id)
Definition DevDefs.h:165
@ CALI_METHOD_AUTO
Definition CalibrationWizardPage.hpp:65
@ CALI_METHOD_NEW_AUTO
Definition CalibrationWizardPage.hpp:66
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::DevFilaBlacklist::CheckFilamentInfo::ams_id, Slic3r::GUI::CALI_METHOD_AUTO, Slic3r::GUI::CALI_METHOD_NEW_AUTO, Slic3r::Calib_PA_Line, Slic3r::DevFilaBlacklist::check_filaments_in_blacklist(), Slic3r::Preset::config, curr_obj, Slic3r::DevFilaBlacklist::CheckFilamentInfo::dev_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_type, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_vendor, Slic3r::Preset::filament_id, Slic3r::Preset::get_filament_type(), Slic3r::GUI::get_tray_ams_and_slot_id(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::has_filament_switch, Slic3r::devPrinterUtil::IsVirtualSlot(), Slic3r::GUI::CalibrationWizardPage::m_cali_method, Slic3r::GUI::CalibrationWizardPage::m_cali_mode, Slic3r::DevFilaBlacklist::CheckFilamentInfo::model_id, Slic3r::ConfigBase::option(), and Slic3r::DevFilaBlacklist::CheckFilamentInfo::slot_id.

Referenced by is_filaments_compatiable().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_filaments_compatiable() [1/2]

bool Slic3r::GUI::CalibrationPresetPage::is_filaments_compatiable ( const std::map< int, Preset * > & prests)
protected
1512{
1513 std::string incompatiable_filament_name;
1514 std::string error_tips;
1515 int bed_temp = 0;
1516 return is_filaments_compatiable(prests, bed_temp, incompatiable_filament_name, error_tips);
1517}

References is_filaments_compatiable().

Referenced by check_filament_compatible(), is_filaments_compatiable(), and select_default_compatible_filament().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ is_filaments_compatiable() [2/2]

bool Slic3r::GUI::CalibrationPresetPage::is_filaments_compatiable ( const std::map< int, Preset * > & prests,
int & bed_temp,
std::string & incompatiable_filament_name,
std::string & error_tips )
protected
1582{
1583 if (prests.empty()) return true;
1584
1585 bed_temp = 0;
1586 std::vector<std::string> filament_types;
1587 std::vector<int> nozzle_temperatures;
1588 std::vector<int> nozzle_temperature_range_lows;
1589 std::vector<int> nozzle_temperature_range_highs;
1590 for (auto &item : prests) {
1591 const auto& item_preset = item.second;
1592 if (!item_preset)
1593 continue;
1594
1595 // update bed temperature
1597 const ConfigOptionInts *opt_bed_temp_ints = item_preset->config.option<ConfigOptionInts>(get_bed_temp_key(curr_bed_type));
1598 int bed_temp_int = 0;
1599 if (opt_bed_temp_ints) {
1600 bed_temp_int = opt_bed_temp_ints->get_at(0);
1601 }
1602
1603 if (bed_temp_int <= 0) {
1604 if (!item_preset->alias.empty())
1605 incompatiable_filament_name = item_preset->alias;
1606 else
1607 incompatiable_filament_name = item_preset->name;
1608
1609 return false;
1610 } else {
1611 // set for first preset
1612 if (bed_temp == 0)
1613 bed_temp = bed_temp_int;
1614 }
1615 std::string display_filament_type;
1616 filament_types.push_back(item_preset->config.get_filament_type(display_filament_type, 0));
1617
1618 int nozzle_temperature = 0;
1619 int nozzle_temperature_range_low = 0;
1621 if (const auto* opt_nozzle_temp = item_preset->config.option<ConfigOptionInts>("nozzle_temperature"))
1622 nozzle_temperature = opt_nozzle_temp->get_at(0);
1623 if (const auto* opt_nozzle_temp_low = item_preset->config.option<ConfigOptionInts>("nozzle_temperature_range_low"))
1624 nozzle_temperature_range_low = opt_nozzle_temp_low->get_at(0);
1625 if (const auto* opt_nozzle_temp_high = item_preset->config.option<ConfigOptionInts>("nozzle_temperature_range_high"))
1626 nozzle_temperature_range_high = opt_nozzle_temp_high->get_at(0);
1627
1628 nozzle_temperatures.push_back(nozzle_temperature);
1629 nozzle_temperature_range_lows.push_back(nozzle_temperature_range_low);
1630 nozzle_temperature_range_highs.push_back(nozzle_temperature_range_high);
1631
1632 // check is it in the filament blacklist
1633 if (!is_filament_in_blacklist(item.first, item_preset, error_tips))
1634 return false;
1635 }
1636
1637 auto compatibility = Print::check_multi_filaments_compatibility(
1639 nozzle_temperatures,
1640 nozzle_temperature_range_lows,
1641 nozzle_temperature_range_highs);
1642
1644 error_tips = _u8L("Invalid recommended nozzle temperature range. The lower bound must be lower than the upper bound.");
1645 return false;
1646 }
1647
1648 if (compatibility == FilamentCompatibilityType::HighLowMixed) {
1649 error_tips = _u8L("Selected nozzle temperatures are incompatible. For multi-material printing, each filament's nozzle temperature must be within the recommended nozzle temperature range of the other filaments. Otherwise, nozzle clogging or printer damage may occur.");
1650 return false;
1651 }
1652
1653 return true;
1654}
bool is_filament_in_blacklist(int tray_id, Preset *preset, std::string &error_tips)
Definition CalibrationWizardPresetPage.cpp:1519
static FilamentCompatibilityType check_multi_filaments_compatibility(const std::vector< std::string > &filament_types, const std::vector< int > &nozzle_temperatures, const std::vector< int > &nozzle_temperature_range_lows, const std::vector< int > &nozzle_temperature_range_highs)
Definition Print.cpp:1740
static const std::vector< std::string > filament_types
Definition CreatePresetsDialog.cpp:123
static std::string get_bed_temp_key(const BedType type)
Definition PrintConfig.hpp:732
@ InvalidTemperatureRange
Definition Print.hpp:1049
@ HighLowMixed
Definition Print.hpp:1046
zaa_minimize_perimeter_height nozzle_temperature_range_high((ConfigOptionFloats, wipe_distance))((ConfigOptionBool
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:1154
zaa_minimize_perimeter_height curr_bed_type((ConfigOptionInts, cool_plate_temp))((ConfigOptionInts

References _u8L, Slic3r::Print::check_multi_filaments_compatibility(), Slic3r::curr_bed_type(), Slic3r::GUI::filament_types, Slic3r::ConfigOptionVector< int >::get_at(), Slic3r::get_bed_temp_key(), Slic3r::HighLowMixed, Slic3r::InvalidTemperatureRange, is_filament_in_blacklist(), m_comboBox_bed_type, m_displayed_bed_types, and Slic3r::nozzle_temperature_range_high().

Here is the call graph for this function:

◆ is_nozzle_info_synced()

bool Slic3r::GUI::CalibrationPresetPage::is_nozzle_info_synced ( ) const
protected
1708{
1709 if (!curr_obj || !curr_obj->is_info_ready())
1710 return false;
1711
1712
1713 for (const DevExtder& extruder : curr_obj->GetExtderSystem()->GetExtruders()) {
1714 const int extruder_id = extruder.GetExtId();
1715
1716 if (!curr_obj->GetExtderSystem()->NozzleDiameterMatchesOrUnknown(extruder_id, get_nozzle_diameter(extruder_id)))
1717 return false;
1718
1719 if (curr_obj->is_nozzle_flow_type_supported()) {
1720 if (extruder.GetNozzleFlowType() == NozzleFlowType::NONE_FLOWTYPE)
1721 return false;
1722 // Map device flow -> volume type via DevNozzle::ToNozzleVolumeType so U_FLOW resolves to
1723 // nvtTPUHighFlow(3); the naive flow-1 would yield nvtHybrid(2). Identical to flow-1 for S/H flow.
1724 if (int(DevNozzle::ToNozzleVolumeType(extruder.GetNozzleFlowType())) != int(get_nozzle_volume_type(extruder_id)))
1725 return false;
1726 }
1727 }
1728
1729 return true;
1730}
NozzleVolumeType get_nozzle_volume_type(int extruder_id) const
Definition CalibrationWizardPresetPage.cpp:1044
float get_nozzle_diameter(int extruder_id) const
Definition CalibrationWizardPresetPage.cpp:1020

References curr_obj, get_nozzle_diameter(), get_nozzle_volume_type(), Slic3r::NONE_FLOWTYPE, and Slic3r::DevNozzle::ToNozzleVolumeType().

Referenced by update_sync_button_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ msw_rescale()

void Slic3r::GUI::CalibrationPresetPage::msw_rescale ( )
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

566{
568 m_ams_sync_button->msw_rescale();
569 for (auto& comboBox : m_filament_comboBox_list) {
570 comboBox->msw_rescale();
571 }
572
573 for (AMSPreview *ams_item : m_main_ams_preview_list)
574 ams_item->msw_rescale();
575 for (AMSPreview *ams_item : m_deputy_ams_preview_list)
576 ams_item->msw_rescale();
577 for (AMSPreview *ams_item : m_ams_preview_list)
578 ams_item->msw_rescale();
579
580 m_cali_stage_panel->msw_rescale();
581 m_custom_range_panel->msw_rescale();
582}
std::vector< AMSPreview * > m_ams_preview_list
Definition CalibrationWizardPresetPage.hpp:369
std::vector< AMSPreview * > m_main_ams_preview_list
Definition CalibrationWizardPresetPage.hpp:346
std::vector< AMSPreview * > m_deputy_ams_preview_list
Definition CalibrationWizardPresetPage.hpp:347
virtual void msw_rescale()
Definition CalibrationWizardPage.cpp:997

References m_ams_preview_list, m_ams_sync_button, m_cali_stage_panel, m_custom_range_panel, m_deputy_ams_preview_list, m_filament_comboBox_list, m_main_ams_preview_list, and Slic3r::GUI::CalibrationWizardPage::msw_rescale().

Here is the call graph for this function:

◆ need_check_sdcard()

bool Slic3r::GUI::CalibrationPresetPage::need_check_sdcard ( MachineObject * obj)
protected
1853{
1854 if (!obj) return false;
1855
1856 bool need_check = false;
1857 if (obj->get_printer_series() == PrinterSeries::SERIES_X1) {
1859 need_check = true;
1860 }
1862 {
1863 need_check = true;
1864 }
1865 }
1866 else if (obj->get_printer_series() == PrinterSeries::SERIES_P1P) {
1868 need_check = true;
1869 }
1871 need_check = true;
1872 }
1873 }
1874 else {
1875 assert(false);
1876 return false;
1877 }
1878
1879 return need_check;
1880}
@ SERIES_P1P
Definition DevDefs.h:36
@ SERIES_X1
Definition DevDefs.h:35
@ CALI_METHOD_MANUAL
Definition CalibrationWizardPage.hpp:64
@ Calib_Vol_speed_Tower
Definition calib.hpp:31

References Slic3r::GUI::CALI_METHOD_MANUAL, Slic3r::Calib_Flow_Rate, Slic3r::Calib_Vol_speed_Tower, Slic3r::MachineObject::get_printer_series(), Slic3r::GUI::CalibrationWizardPage::m_cali_method, Slic3r::GUI::CalibrationWizardPage::m_cali_mode, SERIES_P1P, and SERIES_X1.

Here is the call graph for this function:

◆ on_cali_cancel_job()

void Slic3r::GUI::CalibrationPresetPage::on_cali_cancel_job ( )
2118{
2119 BOOST_LOG_TRIVIAL(info) << "CalibrationWizard::print_job: enter canceled";
2121 BOOST_LOG_TRIVIAL(info) << "calibration_print_job: canceled";
2122 CalibUtils::print_worker->cancel_all();
2123 CalibUtils::print_worker->wait_for_idle();
2124 }
2125
2126 m_sending_panel->reset();
2127 m_sending_panel->Show(false);
2128 update_print_status_msg(wxEmptyString, false);
2129 Enable_Send_Button(true);
2131 Layout();
2132 Fit();
2133
2135}
static std::unique_ptr< Worker > print_worker
Definition CalibUtils.hpp:46
void update_print_status_msg(wxString msg, bool is_warning)
Definition CalibrationWizardPresetPage.cpp:1307
bool m_stop_update_page_status
Definition CalibrationWizardPresetPage.hpp:375
void Enable_Send_Button(bool enable)
Definition CalibrationWizardPresetPage.cpp:1978

References Slic3r::GUI::CALI_ACTION_CALI, Enable_Send_Button(), Slic3r::GUI::CalibrationWizardPage::m_action_panel, m_sending_panel, m_stop_update_page_status, Slic3r::GUI::CalibUtils::print_worker, and update_print_status_msg().

Referenced by create_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_cali_finished_job()

void Slic3r::GUI::CalibrationPresetPage::on_cali_finished_job ( )
2105{
2106 m_sending_panel->reset();
2107 m_sending_panel->Show(false);
2108 update_print_status_msg(wxEmptyString, false);
2109 Enable_Send_Button(true);
2111 Layout();
2112 Fit();
2113
2115}

References Slic3r::GUI::CALI_ACTION_CALI, Enable_Send_Button(), Slic3r::GUI::CalibrationWizardPage::m_action_panel, m_sending_panel, m_stop_update_page_status, and update_print_status_msg().

Here is the call graph for this function:

◆ on_cali_start_job()

void Slic3r::GUI::CalibrationPresetPage::on_cali_start_job ( )
2093{
2094 m_sending_panel->reset();
2095 m_sending_panel->Show();
2096 Enable_Send_Button(false);
2098 Layout();
2099 Fit();
2100
2102}

References Slic3r::GUI::CALI_ACTION_CALI, Enable_Send_Button(), Slic3r::GUI::CalibrationWizardPage::m_action_panel, m_sending_panel, and m_stop_update_page_status.

Referenced by Slic3r::GUI::FlowRateWizard::on_cali_start(), Slic3r::GUI::MaxVolumetricSpeedWizard::on_cali_start(), and Slic3r::GUI::PressureAdvanceWizard::on_cali_start().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_choose_ams()

void Slic3r::GUI::CalibrationPresetPage::on_choose_ams ( wxCommandEvent & event)
protected
1402{
1404
1405 m_filament_list_panel->Show();
1406 m_ams_sync_button->Show();
1407 Layout();
1408}
void select_default_compatible_filament()
Definition CalibrationWizardPresetPage.cpp:2415

References m_ams_sync_button, m_filament_list_panel, and select_default_compatible_filament().

Here is the call graph for this function:

◆ on_choose_ext_spool()

void Slic3r::GUI::CalibrationPresetPage::on_choose_ext_spool ( wxCommandEvent & event)
protected
1411{
1412 m_filament_list_panel->Hide();
1413 m_ams_sync_button->Hide();
1414 Layout();
1415}

References m_ams_sync_button, and m_filament_list_panel.

◆ on_device_connected()

void Slic3r::GUI::CalibrationPresetPage::on_device_connected ( MachineObject * obj)
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

2008{
2010 init_with_machine(obj);
2012}
void update_combobox_filaments(MachineObject *obj)
Definition CalibrationWizardPresetPage.cpp:1668
void init_with_machine(MachineObject *obj)
Definition CalibrationWizardPresetPage.cpp:2137

References init_selection_values(), init_with_machine(), and update_combobox_filaments().

Referenced by create_selection_panel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_recommend_input_value()

void Slic3r::GUI::CalibrationPresetPage::on_recommend_input_value ( )
protected
1443{
1444 //TODO fix this
1445 std::map<int, Preset *> selected_filaments = get_selected_filaments();
1446 if (selected_filaments.empty())
1447 return;
1448
1450
1451 }
1453 Preset *selected_filament_preset = selected_filaments.begin()->second;
1454 if (selected_filament_preset) {
1455 const ConfigOptionFloatsNullable* flow_ratio_opt = selected_filament_preset->config.option<ConfigOptionFloatsNullable>("filament_flow_ratio");
1456 if (flow_ratio_opt) {
1457 m_cali_stage_panel->set_flow_ratio_value(flow_ratio_opt->get_at(0));
1458 }
1459 }
1460 }
1462 Preset* selected_filament_preset = selected_filaments.begin()->second;
1463 if (selected_filament_preset) {
1465 const ConfigOptionFloats* speed_opt = selected_filament_preset->config.option<ConfigOptionFloats>("filament_max_volumetric_speed");
1466 if (speed_opt) {
1467 double max_volumetric_speed = speed_opt->get_at(0);
1468 wxArrayString values;
1469 values.push_back(wxString::Format("%.2f", max_volumetric_speed - 5));
1470 values.push_back(wxString::Format("%.2f", max_volumetric_speed + 5));
1471 values.push_back(wxString::Format("%.2f", 0.5f));
1472 m_custom_range_panel->set_values(values);
1473 }
1474 }
1475 }
1476 }
1477}

References Slic3r::Calib_Flow_Rate, Slic3r::Calib_PA_Line, Slic3r::Calib_Vol_speed_Tower, Slic3r::Preset::config, Slic3r::ConfigOptionVector< double >::get_at(), get_selected_filaments(), Slic3r::GUI::CalibrationWizardPage::m_cali_mode, m_cali_stage_panel, m_custom_range_panel, and Slic3r::ConfigBase::option().

Referenced by on_select_tray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_reset_page()

virtual void Slic3r::GUI::CalibrationWizardPage::on_reset_page ( )
inlinevirtualinherited

◆ on_select_nozzle()

void Slic3r::GUI::CalibrationPresetPage::on_select_nozzle ( wxCommandEvent & evt)
protected
1387{
1389}

References curr_obj, and update_combobox_filaments().

Referenced by create_selection_panel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_select_nozzle_volume_type()

void Slic3r::GUI::CalibrationPresetPage::on_select_nozzle_volume_type ( wxCommandEvent & evt,
size_t extruder_id )
protected
1392{
1393}

◆ on_select_plate_type()

void Slic3r::GUI::CalibrationPresetPage::on_select_plate_type ( wxCommandEvent & evt)
protected
1396{
1399}
void check_filament_compatible()
Definition CalibrationWizardPresetPage.cpp:1479

References check_filament_compatible(), and select_default_compatible_filament().

Referenced by create_selection_panel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_select_tray()

void Slic3r::GUI::CalibrationPresetPage::on_select_tray ( wxCommandEvent & event)
protected
1418{
1420
1422}
void on_recommend_input_value()
Definition CalibrationWizardPresetPage.cpp:1442

References check_filament_compatible(), and on_recommend_input_value().

Referenced by create_filament_list_panel(), create_multi_extruder_filament_list_panel(), and create_page().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_switch_ams()

void Slic3r::GUI::CalibrationPresetPage::on_switch_ams ( std::string ams_id = "")
protected
1425{
1426 for (auto i = 0; i < m_ams_preview_list.size(); i++) {
1427 AMSPreview *item = m_ams_preview_list[i];
1428 if (item->get_ams_id() == ams_id) {
1429 item->OnSelected();
1430 } else {
1431 item->UnSelected();
1432 }
1433 }
1434
1436
1438
1439 Layout();
1440}

References Slic3r::GUI::AMSPreview::get_ams_id(), m_ams_preview_list, Slic3r::GUI::AMSPreview::OnSelected(), select_default_compatible_filament(), Slic3r::GUI::AMSPreview::UnSelected(), and update_filament_combobox().

Referenced by sync_ams_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ on_sys_color_changed()

void Slic3r::GUI::CalibrationPresetPage::on_sys_color_changed ( )
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

585{
587 m_ams_sync_button->msw_rescale();
588}
virtual void on_sys_color_changed()
Definition CalibrationWizardPage.cpp:1003

References m_ams_sync_button, and Slic3r::GUI::CalibrationWizardPage::on_sys_color_changed().

Here is the call graph for this function:

◆ select_default_compatible_filament()

void Slic3r::GUI::CalibrationPresetPage::select_default_compatible_filament ( )
2416{
2417 if (!curr_obj)
2418 return;
2419
2420 std::string ams_id;
2421 for (AMSPreview* ams_perview : m_ams_preview_list) {
2422 if (ams_perview->IsSelected()) {
2423 ams_id = ams_perview->get_ams_id();
2424 break;
2425 }
2426 }
2427
2428 if (ams_id.empty())
2429 return;
2430
2431 if (!devPrinterUtil::IsVirtualSlot(ams_id)) {
2432 std::map<int, Preset *> selected_filament;
2433 for (size_t i = 0; i < 4; ++i) {
2434 auto &fcb = m_filament_comboBox_list[i];
2435 if (!fcb->GetRadioBox()->IsEnabled())
2436 continue;
2437 int tray_id = fcb->get_tray_id();
2438 Preset* preset = const_cast<Preset *>(fcb->GetComboBox()->get_selected_preset());
2440 selected_filament.clear();
2441 selected_filament[tray_id] = preset;
2442 if (preset && is_filaments_compatiable(selected_filament)) {
2443 fcb->GetRadioBox()->SetValue(true);
2444 wxCommandEvent event(wxEVT_RADIOBUTTON);
2445 event.SetEventObject(this);
2446 wxPostEvent(fcb->GetRadioBox(), event);
2447 Layout();
2448 break;
2449 } else
2450 fcb->GetRadioBox()->SetValue(false);
2452 if (!preset) {
2453 fcb->GetCheckBox()->SetValue(false);
2454 continue;
2455 }
2456 selected_filament.insert(std::make_pair(tray_id, preset));
2457 if (!is_filaments_compatiable(selected_filament)) {
2458 selected_filament.erase(tray_id);
2459 fcb->GetCheckBox()->SetValue(false);
2460 }
2461 else
2462 fcb->GetCheckBox()->SetValue(true);
2463
2464 wxCommandEvent event(wxEVT_CHECKBOX);
2465 event.SetEventObject(this);
2466 wxPostEvent(fcb->GetCheckBox(), event);
2467 Layout();
2468 }
2469 }
2470 }
2471 else {
2472 std::map<int, Preset *> selected_filament;
2473 Preset *preset = const_cast<Preset *>(m_filament_comboBox_list[0]->GetComboBox()->get_selected_preset());
2474 selected_filament[m_filament_comboBox_list[0]->get_tray_id()] = preset;
2475 if (preset && is_filaments_compatiable(selected_filament)) {
2476 m_filament_comboBox_list[0]->GetRadioBox()->SetValue(true);
2477 } else
2478 m_filament_comboBox_list[0]->GetRadioBox()->SetValue(false);
2479
2480 wxCommandEvent event(wxEVT_RADIOBUTTON);
2481 event.SetEventObject(this);
2482 wxPostEvent(m_filament_comboBox_list[0]->GetRadioBox(), event);
2483 Layout();
2484 }
2485
2487}

References Slic3r::GUI::CALI_MODEL_MULITI, Slic3r::GUI::CALI_MODEL_SINGLE, check_filament_compatible(), curr_obj, is_filaments_compatiable(), Slic3r::devPrinterUtil::IsVirtualSlot(), m_ams_preview_list, Slic3r::GUI::CalibrationWizardPage::m_cali_filament_mode, and m_filament_comboBox_list.

Referenced by on_choose_ams(), on_select_plate_type(), on_switch_ams(), and update_combobox_filaments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_cali_filament_mode()

void Slic3r::GUI::CalibrationPresetPage::set_cali_filament_mode ( CalibrationFilamentMode mode)
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

2015{
2017
2018 for (int i = 0; i < m_filament_comboBox_list.size(); i++) {
2019 m_filament_comboBox_list[i]->set_select_mode(mode);
2020 }
2021
2022 if (mode == CALI_MODEL_MULITI) {
2023 m_filament_list_tips->Show();
2024 }
2025 else {
2026 m_filament_list_tips->Hide();
2027 }
2028}
virtual void set_cali_filament_mode(CalibrationFilamentMode mode)
Definition CalibrationWizardPage.hpp:325

References Slic3r::GUI::CALI_MODEL_MULITI, m_filament_comboBox_list, m_filament_list_tips, and Slic3r::GUI::CalibrationWizardPage::set_cali_filament_mode().

Here is the call graph for this function:

◆ set_cali_method()

void Slic3r::GUI::CalibrationPresetPage::set_cali_method ( CalibrationMethod method)
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

2031{
2035 wxArrayString steps;
2036 steps.Add(_L("Preset"));
2037 steps.Add(_L("Calibration1"));
2038 steps.Add(_L("Calibration2"));
2039 steps.Add(_L("Record Factor"));
2040 m_step_panel->set_steps_string(steps);
2041 m_step_panel->set_steps(0);
2043 m_cali_stage_panel->Show();
2044
2046 m_pa_cali_method_combox->Show(false);
2047
2049 m_custom_range_panel->Show(false);
2050 }
2053 m_cali_stage_panel->Show(false);
2054
2057
2059 wxArrayString titles;
2060 titles.push_back(_L("From k Value"));
2061 titles.push_back(_L("To k Value"));
2062 titles.push_back(_L("Step value"));
2063 m_custom_range_panel->set_titles(titles);
2064
2065 wxArrayString values;
2066 values.push_back(wxString::Format(wxT("%.0f"), 0));
2067 values.push_back(wxString::Format(wxT("%.2f"), 0.05));
2068 values.push_back(wxString::Format(wxT("%.3f"), 0.005));
2069 m_custom_range_panel->set_values(values);
2070
2071 m_custom_range_panel->set_unit("");
2072 m_custom_range_panel->Show();
2073 }
2074 }
2075 }
2076 else {
2077 wxArrayString steps;
2078 steps.Add(_L("Preset"));
2079 steps.Add(_L("Calibration"));
2080 steps.Add(_L("Record Factor"));
2081 m_step_panel->set_steps_string(steps);
2082 m_step_panel->set_steps(0);
2084 m_cali_stage_panel->Show(false);
2086 m_custom_range_panel->Show(false);
2088 m_pa_cali_method_combox->Show(false);
2089 }
2090}
virtual void set_cali_method(CalibrationMethod method)
Definition CalibrationWizardPage.hpp:329

References _L, Slic3r::GUI::CALI_METHOD_MANUAL, Slic3r::Calib_Flow_Rate, Slic3r::Calib_PA_Line, Slic3r::Calib_PA_Pattern, Slic3r::GUI::CalibrationWizardPage::m_cali_mode, m_cali_stage_panel, m_custom_range_panel, m_pa_cali_method_combox, m_step_panel, and Slic3r::GUI::CalibrationWizardPage::set_cali_method().

Here is the call graph for this function:

◆ set_next_page()

void Slic3r::GUI::CalibrationWizardPage::set_next_page ( CalibrationWizardPage * next)
inlineinherited
311{ m_next_page = next; }

References CalibrationWizardPage(), and m_next_page.

Referenced by chain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ set_prev_page()

void Slic3r::GUI::CalibrationWizardPage::set_prev_page ( CalibrationWizardPage * prev)
inlineinherited
310{ m_prev_page = prev; }

References CalibrationWizardPage(), and m_prev_page.

Referenced by chain().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ show_status()

void Slic3r::GUI::CalibrationPresetPage::show_status ( CaliPresetPageStatus status)
protected
1883{
1885 return;
1886
1887 if (m_page_status != status)
1888 //BOOST_LOG_TRIVIAL(info) << "CalibrationPresetPage: show_status = " << status << "(" << get_print_status_info(status) << ")";
1889 m_page_status = status;
1890
1891 // other
1893 update_print_status_msg(wxEmptyString, false);
1894 Enable_Send_Button(false);
1895 }
1897 update_print_status_msg(wxEmptyString, false);
1898 Enable_Send_Button(true);
1899 Layout();
1900 Fit();
1901 }
1904 Enable_Send_Button(true);
1905 }
1907 wxString msg_text = _L("No login account, only printers in LAN mode are displayed.");
1908 update_print_status_msg(msg_text, false);
1909 Enable_Send_Button(false);
1910 }
1912 update_print_status_msg(wxEmptyString, true);
1913 Enable_Send_Button(false);
1914 }
1916 wxString msg_text = _L("Connecting to server...");
1917 update_print_status_msg(msg_text, true);
1918 Enable_Send_Button(false);
1919 }
1921 wxString msg_text = _L("Cannot send a print job while the printer is updating firmware.");
1922 update_print_status_msg(msg_text, true);
1923 Enable_Send_Button(false);
1924 }
1926 wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends.");
1927 update_print_status_msg(msg_text, true);
1928 Enable_Send_Button(false);
1929 }
1931 wxString msg_text = _L("The printer is busy with another print job.");
1932 update_print_status_msg(msg_text, true);
1933 Enable_Send_Button(false);
1934 }
1936 wxString msg_text = _L("Storage needs to be inserted before printing via LAN.");
1937 update_print_status_msg(msg_text, true);
1938 Enable_Send_Button(false);
1939 }
1941 wxString msg_text = _L("Storage is not available or is in read-only mode.");
1942 update_print_status_msg(msg_text, true);
1943 Enable_Send_Button(false);
1944 }
1946 wxString msg_text = _L("Storage needs to be inserted before printing.");
1947 update_print_status_msg(msg_text, true);
1948 Enable_Send_Button(false);
1949 }
1951 wxString msg_text = _L("Cannot send the print job to a printer whose firmware must be updated.");
1952 update_print_status_msg(msg_text, true);
1953 Enable_Send_Button(false);
1954 }
1956 wxString msg_text = _L("Cannot send the print job to a printer whose firmware must be updated.");
1957 update_print_status_msg(msg_text, true);
1958 Enable_Send_Button(false);
1959 }
1961 update_print_status_msg(wxEmptyString, false);
1962 Enable_Send_Button(false);
1963 }
1965 wxString msg_text = _L("Connecting to printer...");
1966 update_print_status_msg(msg_text, true);
1967 Enable_Send_Button(false);
1968 }
1970 wxString msg_text = _L("Calibration only supports cases where the left and right nozzle diameters are identical.");
1971 update_print_status_msg(msg_text, true);
1972 Enable_Send_Button(false);
1973 }
1974
1975 Layout();
1976}
static wxString get_pre_state_msg(PrintDialogStatus status)
Definition PrePrintChecker.cpp:100
@ PrintStatusOptionalPrinterModel
Definition PrePrintChecker.hpp:120
@ CaliPresetStatusDifferentNozzleDiameters
Definition CalibrationWizardPresetPage.hpp:179
@ CaliPresetStatusLanModeSDcardNotAvailable
Definition CalibrationWizardPresetPage.hpp:178
@ CaliPresetStatusNeedConsistencyUpgrading
Definition CalibrationWizardPresetPage.hpp:174
@ CaliPresetStatusInPrinting
Definition CalibrationWizardPresetPage.hpp:170
@ CaliPresetStatusLanModeNoSdcard
Definition CalibrationWizardPresetPage.hpp:171
@ CaliPresetStatusNormal
Definition CalibrationWizardPresetPage.hpp:164
@ CaliPresetStatusConnectingServer
Definition CalibrationWizardPresetPage.hpp:167
@ CaliPresetStatusNoUserLogin
Definition CalibrationWizardPresetPage.hpp:165
@ CaliPresetStatusOptionalPrinterModel
Definition CalibrationWizardPresetPage.hpp:180
@ CaliPresetStatusInSystemPrinting
Definition CalibrationWizardPresetPage.hpp:169
@ CaliPresetStatusInConnecting
Definition CalibrationWizardPresetPage.hpp:176
@ CaliPresetStatusNeedForceUpgrading
Definition CalibrationWizardPresetPage.hpp:173
@ CaliPresetStatusFilamentIncompatible
Definition CalibrationWizardPresetPage.hpp:177
@ CaliPresetStatusInit
Definition CalibrationWizardPresetPage.hpp:163
@ CaliPresetStatusInvalidPrinter
Definition CalibrationWizardPresetPage.hpp:166
@ CaliPresetStatusInUpgrading
Definition CalibrationWizardPresetPage.hpp:168
@ CaliPresetStatusNoSdcard
Definition CalibrationWizardPresetPage.hpp:172

References _L, Slic3r::GUI::CaliPresetStatusConnectingServer, Slic3r::GUI::CaliPresetStatusDifferentNozzleDiameters, Slic3r::GUI::CaliPresetStatusFilamentIncompatible, Slic3r::GUI::CaliPresetStatusInConnecting, Slic3r::GUI::CaliPresetStatusInit, Slic3r::GUI::CaliPresetStatusInPrinting, Slic3r::GUI::CaliPresetStatusInSystemPrinting, Slic3r::GUI::CaliPresetStatusInUpgrading, Slic3r::GUI::CaliPresetStatusInvalidPrinter, Slic3r::GUI::CaliPresetStatusLanModeNoSdcard, Slic3r::GUI::CaliPresetStatusLanModeSDcardNotAvailable, Slic3r::GUI::CaliPresetStatusNeedConsistencyUpgrading, Slic3r::GUI::CaliPresetStatusNeedForceUpgrading, Slic3r::GUI::CaliPresetStatusNormal, Slic3r::GUI::CaliPresetStatusNoSdcard, Slic3r::GUI::CaliPresetStatusNoUserLogin, Slic3r::GUI::CaliPresetStatusOptionalPrinterModel, Enable_Send_Button(), Slic3r::GUI::PrePrintChecker::get_pre_state_msg(), m_page_status, m_stop_update_page_status, Slic3r::GUI::PrintStatusOptionalPrinterModel, and update_print_status_msg().

Referenced by update_show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ stripWhiteSpace()

void Slic3r::GUI::CalibrationPresetPage::stripWhiteSpace ( std::string & str)
1334{
1335 if (str == "") { return; }
1336
1337 std::string::iterator cur_it;
1338 cur_it = str.begin();
1339
1340 while (cur_it != str.end()) {
1341 if ((*cur_it) == '\n' || (*cur_it) == ' ') {
1342 cur_it = str.erase(cur_it);
1343 }
1344 else {
1345 cur_it++;
1346 }
1347 }
1348}

Referenced by update_priner_status_msg().

Here is the caller graph for this function:

◆ sync_ams_info()

void Slic3r::GUI::CalibrationPresetPage::sync_ams_info ( MachineObject * obj)
2269{
2270 if (!obj) return;
2271
2272 std::map<int, DynamicPrintConfig> old_full_filament_ams_list = wxGetApp().sidebar().build_filament_ams_list(obj);
2273 std::map<int, DynamicPrintConfig> full_filament_ams_list;
2274 for (auto ams_item : old_full_filament_ams_list) {
2275 int key = ams_item.first & 0x0FFFF;
2276 if (key == VIRTUAL_TRAY_MAIN_ID || key == VIRTUAL_TRAY_DEPUTY_ID) {
2277 ams_item.second.set_key_value("filament_exist", new ConfigOptionBools{true});
2278 }
2279 full_filament_ams_list[key] = std::move(ams_item.second);
2280 }
2281
2282 // sync filament_ams_list from obj ams list
2283 filament_ams_list.clear();
2284 for (auto& ams_item : obj->GetFilaSystem()->GetAmsList()) {
2285 for (auto& tray_item: ams_item.second->GetTrays()) {
2286 int tray_id = -1;
2287 if (!tray_item.second->id.empty()) {
2288 try {
2289 tray_id = stoi(tray_item.second->id) + stoi(ams_item.second->GetAmsId()) * 4;
2290 }
2291 catch (...) {
2292 ;
2293 }
2294 }
2295 auto filament_ams = full_filament_ams_list.find(tray_id);
2296 if (filament_ams != full_filament_ams_list.end()) {
2297 filament_ams_list[tray_id] = filament_ams->second;
2298 }
2299 }
2300 }
2301
2302 // init virtual tray info. With a Filament Track Switch installed the external spools feed
2303 // through the switch, so they can't be calibrated as their own trays.
2304 if (obj->GetFilaSwitch()->IsInstalled()) {
2307 } else {
2308 if (full_filament_ams_list.find(VIRTUAL_TRAY_MAIN_ID) != full_filament_ams_list.end()) {
2310 }
2311
2312 if (full_filament_ams_list.find(VIRTUAL_TRAY_DEPUTY_ID) != full_filament_ams_list.end()) {
2314 }
2315 }
2316
2317 // update filament from panel, display only obj has ams
2318 // update multi ams panel, display only obj has multi ams
2319 if (obj->HasAms()) {
2320 if (obj->is_multi_extruders()) {
2321 // An AMS behind a Filament Track Switch is bound to both extruders and appears in both panels.
2322 bool main_done = false;
2323 bool deputy_done = false;
2324 for (auto &ams_item : obj->GetFilaSystem()->GetAmsList()) {
2325 const auto &extruder_set = ams_item.second->GetBindedExtruderSet();
2326 if (!main_done && extruder_set.count(MAIN_EXTRUDER_ID) != 0) {
2327 update_multi_extruder_filament_combobox(ams_item.second->GetAmsId(), MAIN_EXTRUDER_ID);
2328 main_done = true;
2329 }
2330 if (!deputy_done && extruder_set.count(DEPUTY_EXTRUDER_ID) != 0) {
2331 update_multi_extruder_filament_combobox(ams_item.second->GetAmsId(), DEPUTY_EXTRUDER_ID);
2332 deputy_done = true;
2333 }
2334 }
2335
2336 if (!main_done)
2338
2339 if (!deputy_done)
2341 }
2342 else {
2343 if (obj->GetFilaSystem()->GetAmsList().size() > 1) {
2344 on_switch_ams(obj->GetFilaSystem()->GetAmsList().begin()->first);
2345 } else {
2346 if (!obj->GetFilaSystem()->GetAmsList().empty())
2347 update_filament_combobox(obj->GetFilaSystem()->GetAmsList().begin()->first);
2348 }
2349 }
2350 }
2351 else {
2352 if (obj->is_multi_extruders()) {
2355 } else {
2357 }
2358 }
2359
2361 std::vector<AMSinfo> ams_info;
2362 std::vector<AMSinfo> main_ams_info;
2363 std::vector<AMSinfo> deputy_ams_info;
2364
2365 const auto& ams_list = obj->GetFilaSystem()->GetAmsList();
2366 for (auto ams = ams_list.begin(); ams != ams_list.end(); ams++) {
2367 AMSinfo info;
2368 info.ams_id = ams->first;
2369 if (ams->second->IsExist()
2370 && info.parse_ams_info(obj, ams->second, obj->GetFilaSystem()->IsDetectRemainEnabled(), obj->is_support_ams_humidity)) {
2371 ams_info.push_back(info);
2372 for (int extruder_id : ams->second->GetBindedExtruderSet()) {
2373 if (extruder_id == MAIN_EXTRUDER_ID)
2374 main_ams_info.push_back(info);
2375 else
2376 deputy_ams_info.push_back(info);
2377 }
2378 }
2379 m_ams_id_to_extruder_id_map[stoi(info.ams_id)] = info.nozzle_id;
2380 }
2381 if (obj->is_multi_extruders()) {
2384 }
2385
2386 /* add vt_ams info to ams info list*/
2387 for (const DevAmsTray& vt_tray : obj->vt_slot) {
2388 AMSinfo info;
2389 info.parse_ext_info(obj, vt_tray);
2390 info.ams_type = AMSModel::EXT_AMS;
2391
2392 if (vt_tray.id == std::to_string(VIRTUAL_TRAY_MAIN_ID)) {
2393 ams_info.push_back(info);
2394 main_ams_info.push_back(info);
2395 } else if (vt_tray.id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
2396 deputy_ams_info.push_back(info);
2397 } else {
2398 assert(false);
2399 }
2400 }
2401
2402 /* update ams preview */
2403 auto ams_items_sizer = create_ams_items_sizer(obj, m_multi_ams_panel, m_ams_preview_list, ams_info, MAIN_EXTRUDER_ID);
2404 auto multi_ams_sizer = new wxBoxSizer(wxVERTICAL);
2405 multi_ams_sizer->Add(ams_items_sizer, 0);
2406 multi_ams_sizer->AddSpacer(FromDIP(10));
2407 m_multi_ams_panel->SetSizer(multi_ams_sizer);
2408
2411
2412 Layout();
2413}
#define VIRTUAL_TRAY_DEPUTY_ID
Definition DevDefs.h:90
#define VIRTUAL_TRAY_MAIN_ID
Definition DevDefs.h:89
wxBoxSizer * create_ams_items_sizer(MachineObject *obj, wxPanel *ams_preview_panel, std::vector< AMSPreview * > &ams_preview_list, std::vector< AMSinfo > &ams_info, int nozzle_id)
Definition CalibrationWizardPresetPage.cpp:1075
void on_switch_ams(std::string ams_id="")
Definition CalibrationWizardPresetPage.cpp:1424
static DynamicPrintConfig empty_tray_config()
Definition CalibrationWizardPresetPage.cpp:884
@ EXT_AMS
Definition AMSItem.hpp:58
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:2066

References Slic3r::GUI::AMSinfo::ams_id, Slic3r::GUI::AMSinfo::ams_type, create_ams_items_sizer(), DEPUTY_EXTRUDER_ID, Slic3r::GUI::empty_tray_config(), Slic3r::GUI::EXT_AMS, filament_ams_list, Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::MachineObject::HasAms(), Slic3r::DevAmsTray::id, Slic3r::MachineObject::is_multi_extruders(), Slic3r::MachineObject::is_support_ams_humidity, Slic3r::DevFilaSwitch::IsInstalled(), m_ams_id_to_extruder_id_map, m_ams_preview_list, m_deputy_ams_preview_list, m_deputy_ams_preview_panel, m_main_ams_preview_list, m_main_ams_preview_panel, m_multi_ams_panel, MAIN_EXTRUDER_ID, Slic3r::GUI::AMSinfo::nozzle_id, on_switch_ams(), Slic3r::GUI::AMSinfo::parse_ams_info(), Slic3r::GUI::AMSinfo::parse_ext_info(), update_filament_combobox(), update_multi_extruder_filament_combobox(), VIRTUAL_TRAY_DEPUTY_ID, VIRTUAL_TRAY_MAIN_ID, and Slic3r::MachineObject::vt_slot.

Referenced by create_selection_panel(), init_with_machine(), and update_combobox_filaments().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void Slic3r::GUI::CalibrationPresetPage::update ( MachineObject * obj)
overridevirtual

Reimplemented from Slic3r::GUI::CalibrationWizardPage.

1998{
1999 curr_obj = obj;
2000
2001 //update printer status
2003
2005}
void update_sync_button_status()
Definition CalibrationWizardPresetPage.cpp:1732

References curr_obj, update_show_status(), and update_sync_button_status().

Here is the call graph for this function:

◆ update_combobox_filaments()

void Slic3r::GUI::CalibrationPresetPage::update_combobox_filaments ( MachineObject * obj)
protected
1669{
1670 if (!obj) return;
1671
1672 if (!obj->is_info_ready())
1673 return;
1674
1675 //step 1: update combobox filament list
1676 float nozzle_value = get_nozzle_value();
1677 obj->cali_selected_nozzle_dia = nozzle_value;
1678 if (nozzle_value < 1e-3) {
1679 return;
1680 }
1681
1682 Preset* printer_preset = get_printer_preset(obj, nozzle_value);
1683 if (!printer_preset)
1684 return;
1685
1686 auto opt_extruder_type = printer_preset->config.option<ConfigOptionEnumsGeneric>("extruder_type");
1687 if (opt_extruder_type) {
1688 assert(opt_extruder_type->values.size() <= 2);
1689 for (size_t i = 0; i < opt_extruder_type->values.size(); ++i) {
1690 m_extrder_types[i] = (ExtruderType)(opt_extruder_type->values[i]);
1691 }
1692 }
1693
1694 // sync ams filaments list info
1695 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
1696 if (preset_bundle && printer_preset) {
1697 preset_bundle->set_calibrate_printer(printer_preset->name);
1698 }
1699
1700 //step 2: sync ams info from object by default
1701 sync_ams_info(obj);
1702
1703 //step 3: select the default compatible filament to calibration
1705}
ConfigOptionEnumsGenericTempl< false > ConfigOptionEnumsGeneric
Definition Config.hpp:2311
ExtruderType
Definition PrintConfig.hpp:612

References Slic3r::MachineObject::cali_selected_nozzle_dia, Slic3r::Preset::config, get_nozzle_value(), get_printer_preset(), Slic3r::MachineObject::is_info_ready(), m_extrder_types, Slic3r::Preset::name, Slic3r::ConfigBase::option(), select_default_compatible_filament(), Slic3r::PresetBundle::set_calibrate_printer(), and sync_ams_info().

Referenced by on_device_connected(), and on_select_nozzle().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_filament_combobox()

void Slic3r::GUI::CalibrationPresetPage::update_filament_combobox ( std::string ams_id = "")
protected
2690{
2691 for (auto& fcb : m_filament_comboBox_list) {
2692 fcb->update_from_preset();
2693 fcb->set_select_mode(m_cali_filament_mode);
2694 }
2695
2696 for (auto i = 0; i < m_ams_preview_list.size(); i++) {
2697 AMSPreview *item = m_ams_preview_list[i];
2698 if (item->get_ams_id() == ams_id) {
2699 item->OnSelected();
2700 } else {
2701 item->UnSelected();
2702 }
2703 }
2704
2705 DynamicPrintConfig empty_config;
2706 empty_config.set_key_value("filament_id", new ConfigOptionStrings{ "" });
2707 empty_config.set_key_value("tag_uid", new ConfigOptionStrings{ "" });
2708 empty_config.set_key_value("filament_type", new ConfigOptionStrings{ "" });
2709 empty_config.set_key_value("tray_name", new ConfigOptionStrings{ "" });
2710 empty_config.set_key_value("filament_colour", new ConfigOptionStrings{ "" });
2711 empty_config.set_key_value("filament_exist", new ConfigOptionBools{ false });
2712
2713 if (filament_ams_list.empty())
2714 return;
2715
2716 int ams_id_int = 0;
2717 try {
2718 if (!ams_id.empty())
2719 ams_id_int = std::stoi(ams_id.c_str());
2720
2721 } catch (...) {}
2722
2723 int item_size = 4;
2724 if (ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
2725 item_size = 1;
2726 }
2727
2728 if (ams_id_int >= 128 && ams_id_int < 153) { // N3S
2729 item_size = 1;
2730 }
2731
2732 for (int i = 0; i < 4; i++) {
2733 if (i < item_size)
2734 m_filament_comboBox_list[i]->ShowPanel();
2735 else
2736 m_filament_comboBox_list[i]->HidePanel();
2737
2738 int tray_index = ams_id_int * 4 + i;
2739 if (ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
2740 tray_index = stoi(ams_id);
2741 }
2742
2743 auto it = std::find_if(filament_ams_list.begin(), filament_ams_list.end(), [tray_index](auto& entry) {
2744 return entry.first == tray_index;
2745 });
2746
2747 if (it != filament_ams_list.end()) {
2748 m_filament_comboBox_list[i]->load_tray_from_ams(tray_index, it->second);
2749 }
2750 else {
2751 m_filament_comboBox_list[i]->load_tray_from_ams(tray_index, empty_config);
2752 }
2753 }
2754 Layout();
2755}

References filament_ams_list, Slic3r::GUI::AMSPreview::get_ams_id(), m_ams_preview_list, Slic3r::GUI::CalibrationWizardPage::m_cali_filament_mode, m_filament_comboBox_list, Slic3r::GUI::AMSPreview::OnSelected(), Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::AMSPreview::UnSelected(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by create_ams_items_sizer(), on_switch_ams(), and sync_ams_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_flow_ratio_type()

void Slic3r::GUI::CalibrationPresetPage::update_flow_ratio_type ( FlowRatioCalibrationType type)
inline
201{ curr_obj->flow_ratio_calibration_type = type; }

References curr_obj.

◆ update_multi_extruder_filament_combobox()

void Slic3r::GUI::CalibrationPresetPage::update_multi_extruder_filament_combobox ( const std::string & ams_id,
int nozzle_id )
protected
2594{
2595 if (nozzle_id == 0) {
2596 for (auto &fcb : m_main_filament_comboBox_list) {
2597 fcb->update_from_preset();
2598 fcb->set_select_mode(m_cali_filament_mode);
2599 }
2600 for (auto i = 0; i < m_main_ams_preview_list.size(); i++) {
2601 AMSPreview *item = m_main_ams_preview_list[i];
2602 if (item->get_ams_id() == ams_id) {
2603 item->OnSelected();
2604 } else {
2605 item->UnSelected();
2606 }
2607 }
2608 }
2609 else {
2610 for (auto &fcb : m_deputy_filament_comboBox_list) {
2611 fcb->update_from_preset();
2612 fcb->set_select_mode(m_cali_filament_mode);
2613 }
2614 for (auto i = 0; i < m_deputy_ams_preview_list.size(); i++) {
2615 AMSPreview *item = m_deputy_ams_preview_list[i];
2616 if (item->get_ams_id() == ams_id) {
2617 item->OnSelected();
2618 } else {
2619 item->UnSelected();
2620 }
2621 }
2622 }
2623
2624 DynamicPrintConfig empty_config = empty_tray_config();
2625
2626 if (filament_ams_list.empty()) return;
2627
2628 int ams_id_int = 0;
2629 try {
2630 if (!ams_id.empty())
2631 ams_id_int = std::stoi(ams_id.c_str());
2632
2633 } catch (...) {}
2634
2635 int item_size = 4;
2636 if (ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
2637 item_size = 1;
2638 }
2639
2640 if (ams_id_int >= 128 && ams_id_int < 153) { // N3S
2641 item_size = 1;
2642 }
2643
2644 for (int i = 0; i < 4; i++) {
2645 if (i < item_size) {
2646 if (nozzle_id == 0)
2647 m_main_filament_comboBox_list[i]->ShowPanel();
2648 else
2649 m_deputy_filament_comboBox_list[i]->ShowPanel();
2650 }
2651 else {
2652 if (nozzle_id == 0)
2653 m_main_filament_comboBox_list[i]->HidePanel();
2654 else
2655 m_deputy_filament_comboBox_list[i]->HidePanel();
2656 }
2657
2658 int tray_index = ams_id_int * 4 + i;
2659 if (ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
2660 tray_index = stoi(ams_id);
2661 }
2662
2663 auto it = std::find_if(filament_ams_list.begin(), filament_ams_list.end(), [tray_index](auto &entry) {
2664 return entry.first == tray_index;
2665 });
2666
2667 if (nozzle_id == 0) {
2669 continue;
2670 if (it != filament_ams_list.end()) {
2671 m_main_filament_comboBox_list[i]->load_tray_from_ams(tray_index, it->second);
2672 } else {
2673 m_main_filament_comboBox_list[i]->load_tray_from_ams(tray_index, empty_config);
2674 }
2675 }
2676 else{
2678 continue;
2679 if (it != filament_ams_list.end()) {
2680 m_deputy_filament_comboBox_list[i]->load_tray_from_ams(tray_index, it->second);
2681 } else {
2682 m_deputy_filament_comboBox_list[i]->load_tray_from_ams(tray_index, empty_config);
2683 }
2684 }
2685 }
2686 Layout();
2687}

References Slic3r::GUI::empty_tray_config(), filament_ams_list, Slic3r::GUI::AMSPreview::get_ams_id(), Slic3r::GUI::CalibrationWizardPage::m_cali_filament_mode, m_deputy_ams_preview_list, m_deputy_filament_comboBox_list, m_main_ams_preview_list, m_main_filament_comboBox_list, Slic3r::GUI::AMSPreview::OnSelected(), Slic3r::GUI::AMSPreview::UnSelected(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by create_ams_items_sizer(), and sync_ams_info().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_plate_type_collection()

void Slic3r::GUI::CalibrationPresetPage::update_plate_type_collection ( CalibrationMethod method)
protected
1657{
1658 m_comboBox_bed_type->Clear();
1659 const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type");
1660 if (bed_type_def && bed_type_def->enum_keys_map) {
1661 for (int i = 0; i < bed_type_def->enum_labels.size(); i++) {
1662 m_comboBox_bed_type->AppendString(_L(bed_type_def->enum_labels[i]));
1663 }
1664 m_comboBox_bed_type->SetSelection(0);
1665 }
1666}

References _L, Slic3r::ConfigOptionDef::enum_keys_map, Slic3r::ConfigOptionDef::enum_labels, m_comboBox_bed_type, and Slic3r::print_config_def.

◆ update_priner_status_msg()

void Slic3r::GUI::CalibrationPresetPage::update_priner_status_msg ( wxString msg,
bool is_warning )
1351{
1352 auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B);
1353 m_statictext_printer_msg->SetForegroundColour(colour);
1354
1355 if (msg.empty()) {
1356 if (!m_statictext_printer_msg->GetLabel().empty()) {
1357 m_statictext_printer_msg->SetLabel(wxEmptyString);
1358 m_statictext_printer_msg->Hide();
1359 Layout();
1360 Fit();
1361 }
1362 }
1363 else {
1364 msg = format_text(msg);
1365
1366 auto str_new = msg.ToStdString();
1367 stripWhiteSpace(str_new);
1368
1369 auto str_old = m_statictext_printer_msg->GetLabel().ToStdString();
1370 stripWhiteSpace(str_old);
1371
1372 if (str_new != str_old) {
1373 if (m_statictext_printer_msg->GetLabel() != msg) {
1374 m_statictext_printer_msg->SetLabel(msg);
1375 m_statictext_printer_msg->SetMinSize(wxSize(FromDIP(600), -1));
1376 m_statictext_printer_msg->SetMaxSize(wxSize(FromDIP(600), -1));
1377 m_statictext_printer_msg->Wrap(FromDIP(600));
1379 Layout();
1380 Fit();
1381 }
1382 }
1383 }
1384}
wxString format_text(wxString &m_msg)
Definition CalibrationWizardPresetPage.cpp:1312
void stripWhiteSpace(std::string &str)
Definition CalibrationWizardPresetPage.cpp:1333

References format_text(), Slic3r::GUI::CalibrationWizardPage::m_statictext_printer_msg, and stripWhiteSpace().

Referenced by update_print_status_msg().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_print_error_info()

void Slic3r::GUI::CalibrationPresetPage::update_print_error_info ( int code,
const std::string & msg,
const std::string & extra )
inline
205{ m_sending_panel->update_print_error_info(code, msg, extra); }

References m_sending_panel.

Referenced by Slic3r::GUI::CalibrationPanel::update_print_error_info().

Here is the caller graph for this function:

◆ update_print_status_msg()

void Slic3r::GUI::CalibrationPresetPage::update_print_status_msg ( wxString msg,
bool is_warning )
1308{
1309 update_priner_status_msg(msg, is_warning);
1310}
void update_priner_status_msg(wxString msg, bool is_warning)
Definition CalibrationWizardPresetPage.cpp:1350

References update_priner_status_msg().

Referenced by on_cali_cancel_job(), on_cali_finished_job(), and show_status().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_show_status()

void Slic3r::GUI::CalibrationPresetPage::update_show_status ( )
protected
1752{
1753 NetworkAgent* agent = Slic3r::GUI::wxGetApp().getAgent();
1754 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1755 if (!agent) {return;}
1756 if (!dev) return;
1757
1758 MachineObject* obj_ = dev->get_selected_machine();
1759 if (!obj_) {
1760 if (agent->is_user_login(wxGetApp().get_printer_cloud_provider())) {
1762 }
1763 else {
1765 }
1766 return;
1767 }
1768
1769 if (!obj_->is_lan_mode_printer()) {
1770 if (!agent->is_server_connected(wxGetApp().get_printer_cloud_provider())) {
1772 return;
1773 }
1774 }
1775
1776 if (wxGetApp().app_config) {
1777 if (obj_->upgrade_force_upgrade) {
1779 return;
1780 }
1781
1782 if (obj_->upgrade_consistency_request) {
1784 return;
1785 }
1786 }
1787
1788 bool has_optional_printer_model = DevPrinterConfigUtil::is_optional_printer_model_id(obj_->printer_type);
1789 if (PresetBundle *preset_bundle = wxGetApp().preset_bundle) {
1790 has_optional_printer_model = has_optional_printer_model ||
1792 preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle));
1793 }
1794
1795 if (obj_->is_connecting() || !obj_->is_connected()) {
1797 return;
1798 }
1799 else if (obj_->is_in_upgrading()) {
1801 return;
1802 }
1803 else if (obj_->is_system_printing()) {
1805 return;
1806 }
1807 else if (obj_->is_in_printing()) {
1809 return;
1810 }
1811
1812 //if (obj_->is_multi_extruders()) {
1813 // float diameter = obj_->m_extder_data.extders[0].current_nozzle_diameter;
1814 // bool is_same_diameter = std::all_of(obj_->m_extder_data.extders.begin(), obj_->m_extder_data.extders.end(),
1815 // [diameter](const Extder& extruder) {
1816 // return std::fabs(extruder.current_nozzle_diameter - diameter) < EPSILON;
1817 // });
1818 // if (!is_same_diameter) {
1819 // show_status(CaliPresetPageStatus::CaliPresetStatusDifferentNozzleDiameters);
1820 // return;
1821 // }
1822 //}
1823
1824 // check sdcard when if lan mode printer
1825 if (obj_->is_lan_mode_printer()) {
1826 if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD) {
1828 return;
1829 } else if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_ABNORMAL ||
1830 obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_READONLY) {
1832 return;
1833 }
1834 }
1835 else if (!obj_->GetConfig()->SupportPrintWithoutSD() && (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD))
1836 {
1838 return;
1839 }
1840
1843 return;
1844 }
1845
1846 show_status(has_optional_printer_model ?
1849}
static bool is_optional_printer_model_id(const std::string &model_id)
Definition DevConfigUtil.h:69
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
@ HAS_SDCARD_READONLY
Definition DevStorage.h:21
@ NO_SDCARD
Definition DevStorage.h:18
void show_status(CaliPresetPageStatus status)
Definition CalibrationWizardPresetPage.cpp:1882

References Slic3r::GUI::CaliPresetStatusConnectingServer, Slic3r::GUI::CaliPresetStatusFilamentIncompatible, Slic3r::GUI::CaliPresetStatusInConnecting, Slic3r::GUI::CaliPresetStatusInPrinting, Slic3r::GUI::CaliPresetStatusInSystemPrinting, Slic3r::GUI::CaliPresetStatusInUpgrading, Slic3r::GUI::CaliPresetStatusInvalidPrinter, Slic3r::GUI::CaliPresetStatusLanModeNoSdcard, Slic3r::GUI::CaliPresetStatusLanModeSDcardNotAvailable, Slic3r::GUI::CaliPresetStatusNeedConsistencyUpgrading, Slic3r::GUI::CaliPresetStatusNeedForceUpgrading, Slic3r::GUI::CaliPresetStatusNormal, Slic3r::GUI::CaliPresetStatusNoSdcard, Slic3r::GUI::CaliPresetStatusNoUserLogin, Slic3r::GUI::CaliPresetStatusOptionalPrinterModel, Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetConfig(), Slic3r::MachineObject::GetStorage(), Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, Slic3r::MachineObject::is_connected(), Slic3r::MachineObject::is_connecting(), Slic3r::MachineObject::is_in_printing(), Slic3r::MachineObject::is_in_upgrading(), Slic3r::MachineObject::is_lan_mode_printer(), Slic3r::DevPrinterConfigUtil::is_optional_printer_model_id(), Slic3r::NetworkAgent::is_server_connected(), Slic3r::MachineObject::is_system_printing(), Slic3r::NetworkAgent::is_user_login(), m_has_filament_incompatible, Slic3r::DevStorage::NO_SDCARD, Slic3r::MachineObject::printer_type, show_status(), Slic3r::DevConfig::SupportPrintWithoutSD(), Slic3r::MachineObject::upgrade_consistency_request, and Slic3r::MachineObject::upgrade_force_upgrade.

Referenced by check_filament_compatible(), and update().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_sync_button_status()

void Slic3r::GUI::CalibrationPresetPage::update_sync_button_status ( )
protected
1733{
1734 auto set_status = [this](bool synced) {
1735 StateColor synced_colour(std::pair<wxColour, int>(wxColour("#CECECE"), StateColor::Normal));
1736 StateColor not_synced_colour(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Normal));
1737 if (synced) {
1738 m_btn_sync->SetBorderColor(synced_colour);
1739 m_btn_sync->SetIcon("ams_nozzle_sync");
1740 m_sync_button_text->SetLabel(_L("AMS and nozzle information are synced"));
1741 } else {
1742 m_btn_sync->SetBorderColor(not_synced_colour);
1743 m_btn_sync->SetIcon("printer_sync");
1744 m_sync_button_text->SetLabel(_L("Sync AMS and nozzle information"));
1745 }
1746 };
1747
1748 set_status(is_nozzle_info_synced());
1749}
bool is_nozzle_info_synced() const
Definition CalibrationWizardPresetPage.cpp:1707

References _L, is_nozzle_info_synced(), m_btn_sync, m_sync_button_text, and StateColor::Normal.

Referenced by update().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ curr_obj

◆ filament_ams_list

std::map<int, DynamicPrintConfig> Slic3r::GUI::CalibrationPresetPage::filament_ams_list
protected

◆ m_action_panel

◆ m_ams_id_to_extruder_id_map

std::unordered_map<int, int> Slic3r::GUI::CalibrationPresetPage::m_ams_id_to_extruder_id_map
protected

◆ m_ams_preview_list

std::vector<AMSPreview*> Slic3r::GUI::CalibrationPresetPage::m_ams_preview_list
protected

◆ m_ams_sync_button

ScalableButton* Slic3r::GUI::CalibrationPresetPage::m_ams_sync_button
protected

◆ m_btn_sync

Button* Slic3r::GUI::CalibrationPresetPage::m_btn_sync {nullptr}
protected
329{nullptr};

Referenced by create_selection_panel(), and update_sync_button_status().

◆ m_cali_filament_mode

◆ m_cali_method

◆ m_cali_mode

◆ m_cali_stage_panel

CaliPresetCaliStagePanel* Slic3r::GUI::CalibrationPresetPage::m_cali_stage_panel { nullptr }
protected

◆ m_comboBox_bed_type

◆ m_comboBox_nozzle_dia

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_comboBox_nozzle_dia
protected

◆ m_comboBox_nozzle_volume

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_comboBox_nozzle_volume
protected

◆ m_comboBox_process

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_comboBox_process
protected

◆ m_custom_range_panel

◆ m_deputy_ams_items_sizer

wxBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_deputy_ams_items_sizer {nullptr}
protected
344{nullptr};

Referenced by create_multi_extruder_filament_list_panel().

◆ m_deputy_ams_preview_list

std::vector<AMSPreview *> Slic3r::GUI::CalibrationPresetPage::m_deputy_ams_preview_list
protected

◆ m_deputy_ams_preview_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_deputy_ams_preview_panel {nullptr}
protected

◆ m_deputy_filament_comboBox_list

◆ m_deputy_sizer

wxStaticBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_deputy_sizer
protected

◆ m_displayed_bed_types

std::vector<BedType> Slic3r::GUI::CalibrationPresetPage::m_displayed_bed_types
protected

◆ m_extrder_types

std::vector<ExtruderType> Slic3r::GUI::CalibrationPresetPage::m_extrder_types
protected

◆ m_extruder_nozzle_types

std::vector<NozzleVolumeType> Slic3r::GUI::CalibrationPresetPage::m_extruder_nozzle_types
protected

Referenced by CalibrationPresetPage().

◆ m_filament_comboBox_list

◆ m_filament_from_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_filament_from_panel { nullptr }
protected
304{ nullptr };

Referenced by create_selection_panel().

◆ m_filament_list_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_filament_list_panel { nullptr }
protected

◆ m_filament_list_tips

Label* Slic3r::GUI::CalibrationPresetPage::m_filament_list_tips { nullptr }
protected

◆ m_has_filament_incompatible

bool Slic3r::GUI::CalibrationPresetPage::m_has_filament_incompatible { false }
protected
378{ false };

Referenced by check_filament_compatible(), and update_show_status().

◆ m_left_comboBox_nozzle_dia

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_left_comboBox_nozzle_dia
protected

◆ m_left_comboBox_nozzle_volume

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_left_comboBox_nozzle_volume
protected

◆ m_left_nozzle_volume_type_sizer

wxStaticBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_left_nozzle_volume_type_sizer
protected

Referenced by create_selection_panel().

◆ m_main_ams_items_sizer

wxBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_main_ams_items_sizer {nullptr}
protected
343{nullptr};

Referenced by create_multi_extruder_filament_list_panel().

◆ m_main_ams_preview_list

std::vector<AMSPreview *> Slic3r::GUI::CalibrationPresetPage::m_main_ams_preview_list
protected

◆ m_main_ams_preview_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_main_ams_preview_panel {nullptr}
protected

◆ m_main_extruder_on_left

bool Slic3r::GUI::CalibrationPresetPage::m_main_extruder_on_left {true}
protected

◆ m_main_filament_comboBox_list

FilamentComboBoxList Slic3r::GUI::CalibrationPresetPage::m_main_filament_comboBox_list
protected

◆ m_main_sizer

wxStaticBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_main_sizer
protected

◆ m_multi_ams_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_multi_ams_panel { nullptr }
protected
306{ nullptr };

Referenced by create_filament_list_panel(), and sync_ams_info().

◆ m_multi_extruder_ams_panel_sizer

wxBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_multi_extruder_ams_panel_sizer
protected

◆ m_multi_exturder_ams_sizer

wxBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_multi_exturder_ams_sizer
protected

◆ m_multi_exutrder_filament_list_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_multi_exutrder_filament_list_panel {nullptr}
protected

◆ m_multi_nozzle_info_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_multi_nozzle_info_panel {nullptr}
protected
333{nullptr};

Referenced by create_selection_panel(), and init_with_machine().

◆ m_next_page

CalibrationWizardPage* Slic3r::GUI::CalibrationWizardPage::m_next_page {nullptr}
privateinherited
350{nullptr};

Referenced by get_next_page(), and set_next_page().

◆ m_nozzle_diameter_tips

Label* Slic3r::GUI::CalibrationPresetPage::m_nozzle_diameter_tips {nullptr}
protected
320{nullptr};

Referenced by create_selection_panel().

◆ m_pa_cali_method_combox

CaliComboBox* Slic3r::GUI::CalibrationPresetPage::m_pa_cali_method_combox {nullptr}
protected
301{nullptr};

Referenced by create_page(), get_pa_cali_method(), and set_cali_method().

◆ m_page_caption

◆ m_page_status

CaliPresetPageStatus Slic3r::GUI::CalibrationPresetPage::m_page_status { CaliPresetPageStatus::CaliPresetStatusInit }
protected

◆ m_page_type

◆ m_parent

wxWindow* Slic3r::GUI::CalibrationWizardPage::m_parent { nullptr }
protectedinherited
343{ nullptr };

Referenced by CalibrationWizardPage().

◆ m_prev_page

CalibrationWizardPage* Slic3r::GUI::CalibrationWizardPage::m_prev_page {nullptr}
privateinherited
349{nullptr};

Referenced by get_prev_page(), and set_prev_page().

◆ m_right_comboBox_nozzle_dia

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_right_comboBox_nozzle_dia
protected

◆ m_right_comboBox_nozzle_volume

ComboBox* Slic3r::GUI::CalibrationPresetPage::m_right_comboBox_nozzle_volume
protected

◆ m_right_nozzle_volume_type_sizer

wxStaticBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_right_nozzle_volume_type_sizer
protected

Referenced by create_selection_panel().

◆ m_selection_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_selection_panel { nullptr }
protected
303{ nullptr };

Referenced by create_page().

◆ m_sending_panel

CaliPageSendingPanel* Slic3r::GUI::CalibrationPresetPage::m_sending_panel { nullptr }
protected

◆ m_show_custom_range

bool Slic3r::GUI::CalibrationPresetPage::m_show_custom_range { false }
protected
377{ false };

Referenced by CalibrationPresetPage().

◆ m_single_nozzle_info_panel

wxPanel* Slic3r::GUI::CalibrationPresetPage::m_single_nozzle_info_panel {nullptr}
protected
332{nullptr};

Referenced by create_selection_panel(), and init_with_machine().

◆ m_statictext_printer_msg

Label* Slic3r::GUI::CalibrationWizardPage::m_statictext_printer_msg { nullptr }
protectedinherited

◆ m_step_panel

CaliPageStepGuide* Slic3r::GUI::CalibrationPresetPage::m_step_panel { nullptr }
protected
300{ nullptr };

Referenced by create_page(), and set_cali_method().

◆ m_stop_update_page_status

bool Slic3r::GUI::CalibrationPresetPage::m_stop_update_page_status { false }
protected

◆ m_sync_button_text

Label* Slic3r::GUI::CalibrationPresetPage::m_sync_button_text
protected

◆ m_tips_panel

CaliPresetTipsPanel* Slic3r::GUI::CalibrationPresetPage::m_tips_panel { nullptr }
protected
310{ nullptr };

Referenced by check_filament_compatible(), and create_page().

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::CalibrationPresetPage::m_top_sizer
protected

◆ m_warning_panel

CaliPresetWarningPanel* Slic3r::GUI::CalibrationPresetPage::m_warning_panel { nullptr }
protected
308{ nullptr };

Referenced by check_filament_compatible(), and create_page().


The documentation for this class was generated from the following files: