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

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

Inheritance diagram for Slic3r::GUI::SelectMachineDialog:
Collaboration diagram for Slic3r::GUI::SelectMachineDialog:

Public Member Functions

 SelectMachineDialog (Plater *plater=nullptr)
 ~SelectMachineDialog ()
void init_bind ()
void init_timer ()
void show_print_failed_info (bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
void check_fcous_state (wxWindow *window)
void popup_filament_backup ()
void update_select_layout (MachineObject *obj)
void prepare_mode (bool refresh_button=true)
void sending_mode ()
void finish_mode ()
void sync_ams_mapping_result (std::vector< FilamentInfo > &result)
void prepare (int print_plate_idx)
void show_status (PrintDialogStatus status, std::vector< wxString > params=std::vector< wxString >(), wxString wiki_url=wxEmptyString)
void sys_color_changed ()
void reset_timeout ()
void update_user_printer ()
void reset_ams_material ()
void update_show_status (MachineObject *obj_=nullptr)
void UpdateStatusCheckWarning_ExtensionTool (MachineObject *obj_)
void update_ams_check (MachineObject *obj)
void update_filament_change_count ()
void on_rename_click (wxMouseEvent &event)
void on_rename_enter ()
void update_printer_combobox (wxCommandEvent &event)
void on_cancel (wxCloseEvent &event)
void show_errors (wxString &info)
void on_ok_btn (wxCommandEvent &event)
void Enable_Auto_Refill (bool enable)
void on_send_print ()
void clear_ip_address_config (wxCommandEvent &e)
void on_refresh (wxCommandEvent &event)
void on_set_finish_mapping (wxCommandEvent &evt)
void on_print_job_cancel (wxCommandEvent &evt)
void set_default ()
void change_materialitem_tip (bool no_ams_only_ext)
void reset_and_sync_ams_list ()
void clone_thumbnail_data ()
void record_edge_pixels_data ()
wxColour adjust_color_for_render (const wxColour &color)
void final_deal_edge_pixels_data (ThumbnailData &data)
void updata_thumbnail_data_after_connected_printer ()
void unify_deal_thumbnail_data (ThumbnailData &input_data, ThumbnailData &no_light_data)
void change_default_normal (int old_filament_id, wxColour temp_ams_color)
void set_default_normal (const ThumbnailData &)
void set_default_from_sdcard ()
void update_page_turn_state (bool show)
void on_timer (wxTimerEvent &event)
void on_selection_changed (wxCommandEvent &event)
void Enable_Refresh_Button (bool en)
void Enable_Send_Button (bool en)
void on_dpi_changed (const wxRect &suggested_rect) override
void update_user_machine_list ()
void update_print_status_msg ()
void update_print_error_info (int code, std::string msg, std::string extra)
bool has_timelapse_warning (wxString &msg)
bool has_timelapse_warning ()
bool can_support_pa_auto_cali ()
bool is_same_printer_model ()
bool is_blocking_printing (MachineObject *obj_)
bool is_nozzle_hrc_matched (const DevExtder *extruder, std::string &filament_type) const
bool check_sdcard_for_timelpase (MachineObject *obj)
bool is_timeout ()
int update_print_required_data (Slic3r::DynamicPrintConfig config, Slic3r::Model model, Slic3r::PlateDataPtrs plate_data_list, std::string file_name, std::string file_path)
void set_print_type (PrintFromType type)
bool Show (bool show) override
void show_init ()
bool do_ams_mapping (MachineObject *obj_, bool use_ams)
bool get_ams_mapping_result (std::string &mapping_array_str, std::string &mapping_array_str2, std::string &ams_mapping_info) const
bool build_nozzles_info (std::string &nozzles_info)
bool can_hybrid_mapping (MachineObject *obj_) const
ShowType get_filament_mapping_show_type (MachineObject *obj_, int fila_logic_id) const
void update_material_item_pos (MachineObject *obj_)
void auto_supply_with_ext (std::vector< DevAmsTray > slots)
int convert_filament_map_nozzle_id_to_task_nozzle_id (int nozzle_id) const
std::map< int, DevNozzle > get_mapped_nozzles (int fila_id) const
wxString get_mapped_nozzle_str (int fila_id) const
bool CheckErrorRackStatus (MachineObject *obj_)
void CheckWarningRackStatus (MachineObject *obj_)
bool CheckErrorExtruderNozzleWithSlicing (MachineObject *obj_)
bool CheckWarningFilamentCrossExtruder (MachineObject *obj_)
bool CheckWarningSmartNozzleBlobAuto (MachineObject *obj_)
void on_reselect_dialog_btn_clicked (wxMouseEvent &)
void update_best_pos_dialog (wxCommandEvent &evt)
void refresh_save_time (MachineObject *obj)
std::optional< float > get_filament_change_gap_time (MachineObject *obj_) const
std::map< int, DevFilaSwitch::SwitchPos > get_filament_suggest_pos (MachineObject *obj_) const
std::optional< DevFilaSwitch::SwitchPos > get_filament_suggest_pos (MachineObject *obj_, int fila_logic_id) const
bool is_at_suggested_pos (MachineObject *obj_, int fila_logic_id) const
wxString FormatTime (float totalSeconds)
std::optional< FilamentInfo > get_mapped_filament_info (int fila_logic_id) const
bool is_used_filament (int fila_logic_id) const
bool CheckErrorSyncNozzleMappingResultV1 (MachineObject *obj_)
bool CheckErrorSyncNozzleMappingResultV0 (MachineObject *obj_)
void clear_nozzle_mapping ()
bool use_dynamic_nozzle_map () const
bool slicing_with_fila_switch () const
bool CheckErrorDynamicSwitchNozzle (MachineObject *obj_)
void on_flow_cali_option_changed ()
void on_pa_value_option_changed ()
void update_pa_value_option (MachineObject *obj)
bool is_ams_drying (MachineObject *obj)
bool is_selected_ams_drying (MachineObject *obj)
PrintFromType get_print_type ()
wxString format_steel_name (NozzleType type)
PrintDialogStatus get_status ()
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Static Public Member Functions

static void init_machine_bed_types ()

Public Attributes

wxString m_nozzle_diameter_mismatch_msg
wxString m_nozzle_diameter_ack_msg

Static Public Attributes

static std::vector< wxString > MACHINE_BED_TYPE_STRING
static std::vector< std::string > MachineBedTypeString

Protected Member Functions

virtual void on_sys_color_changed ()

Protected Attributes

PrintFromType m_print_type {FROM_NORMAL}
AmsMapingPopup m_mapping_popup { nullptr }
AmsMapingTipPopup m_mapping_tip_popup { nullptr }
AmsTutorialPopup m_mapping_tutorial_popup { nullptr }
MaterialHash m_materialList
Plater * m_plater {nullptr}
wxPanel * m_options_other {nullptr}
wxGridSizer * m_sizer_options {nullptr}
wxBoxSizer * m_sizer_thumbnail { nullptr }
wxBoxSizer * m_basicl_sizer { nullptr }
wxBoxSizer * rename_sizer_v { nullptr }
wxBoxSizer * rename_sizer_h { nullptr }
wxBoxSizer * m_sizer_autorefill { nullptr }
wxBoxSizer * m_mapping_sugs_sizer { nullptr }
wxBoxSizer * m_change_filament_times_sizer { nullptr }
wxBoxSizer * m_warn_when_drying_sizer { nullptr }
Button * m_button_ensure { nullptr }
wxStaticBitmap * m_rename_button {nullptr}
wxStaticBitmap * m_staticbitmap { nullptr }
wxStaticBitmap * m_bitmap_last_plate { nullptr }
wxStaticBitmap * m_bitmap_next_plate { nullptr }
wxStaticBitmap * img_amsmapping_tip {nullptr}
ThumbnailPanel * m_thumbnailPanel { nullptr }
wxPanel * m_panel_status { nullptr }
wxPanel * m_basic_panel
wxPanel * m_rename_normal_panel {nullptr}
wxPanel * m_panel_sending {nullptr}
wxPanel * m_panel_prepare {nullptr}
wxPanel * m_panel_finish {nullptr}
wxScrolledWindow * m_scroll_area {nullptr}
wxPanel * m_line_top { nullptr }
Label * m_link_edit_nozzle { nullptr }
Label * m_st_txt_error_code {nullptr}
Label * m_st_txt_error_desc {nullptr}
Label * m_st_txt_extra_info {nullptr}
Label * m_ams_backup_tip {nullptr}
HyperLink * m_link_network_state { nullptr }
wxSimplebook * m_rename_switch_panel {nullptr}
wxSimplebook * m_simplebook {nullptr}
wxStaticText * m_rename_text {nullptr}
Label * m_stext_time { nullptr }
Label * m_stext_weight { nullptr }
Label * m_saveTimeText { nullptr }
PrinterMsgPanel * m_statictext_ams_msg {nullptr}
Label * m_txt_change_filament_times { nullptr }
CheckBox * m_check_ext_change_assist { nullptr }
Label * m_label_ext_change_assist { nullptr }
Label * m_txt_warn_when_drying { nullptr }
PrinterInfoBox * m_printer_box { nullptr}
PrinterMsgPanel * m_text_printer_msg {nullptr}
Label * m_text_printer_msg_tips { nullptr }
wxStaticText * m_staticText_bed_title { nullptr }
wxStaticText * m_stext_sending { nullptr }
wxStaticText * m_statictext_finish {nullptr}
TextInput * m_rename_input {nullptr}
wxTimer * m_refresh_timer { nullptr }
std::shared_ptr< PrintJob > m_print_job
wxScrolledWindow * m_sw_print_failed_info {nullptr}
ScalableBitmap * rename_editable {nullptr}
ScalableBitmap * rename_editable_light {nullptr}
wxStaticBitmap * timeimg {nullptr}
ScalableBitmap * print_time {nullptr}
wxStaticBitmap * weightimg {nullptr}
ScalableBitmap * print_weight {nullptr}
ScalableBitmap * ams_mapping_help_icon {nullptr}
wxStaticBitmap * img_ams_backup {nullptr}
ThumbnailData m_cur_input_thumbnail_data
ThumbnailData m_cur_no_light_thumbnail_data
ThumbnailData m_preview_thumbnail_data
std::vector< wxColour > m_preview_colors_in_thumbnail
std::vector< wxColour > m_cur_colors_in_thumbnail
std::vector< bool > m_edge_pixels
StaticBox * m_filament_panel
StaticBox * m_filament_left_panel
StaticBox * m_filament_right_panel
wxBoxSizer * m_filament_panel_sizer
wxBoxSizer * m_filament_panel_left_sizer
wxBoxSizer * m_filament_panel_right_sizer
wxBoxSizer * m_sizer_filament_2extruder
wxGridSizer * m_sizer_ams_mapping { nullptr }
wxGridSizer * m_sizer_ams_mapping_left { nullptr }
wxGridSizer * m_sizer_ams_mapping_right { nullptr }
PrePrintChecker m_pre_print_checker
ReselectMachineDialog * m_best_pos_dialog { nullptr }

Private Member Functions

void EnableEditing (bool enable)
void update_scroll_area_size ()
void update_option_opts (MachineObject *obj)
void update_options_layout ()
void update_timelapse_folder_btn_icon ()
void show_timelapse_folder_popup ()
void check_timelapse_storage_warning (MachineObject *obj)
void start_timelapse_storage_check (MachineObject *obj)
void on_timelapse_storage_check_timer (wxTimerEvent &event)
void on_timelapse_storage_check_result ()
void show_timelapse_storage_dialog (MachineObject *obj)
void navigate_to_timelapse_page ()
void load_option_vals (MachineObject *obj)
void save_option_vals ()
void save_option_vals (MachineObject *obj)
bool is_enable_external_change_assist (std::vector< FilamentInfo > &ams_mapping_result)
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

int m_current_filament_id {0}
int m_print_plate_idx {0}
int m_print_plate_total {0}
int m_timeout_count {0}
int m_print_error_code {0}
bool m_is_in_sending_mode { false }
bool m_ams_mapping_res { false }
bool m_ams_mapping_valid { false }
bool m_export_3mf_cancel { false }
bool m_is_canceled { false }
bool m_is_rename_mode { false }
bool m_check_flag {false}
bool m_ext_change_assist { false }
PrintPageMode m_print_page_mode {PrintPageMode::PrintPageModePrepare}
std::string m_print_error_msg
std::string m_print_error_extra
std::string m_printer_last_select
std::string m_print_info
wxString m_current_project_name
PrintDialogStatus m_print_status { PrintStatusInit }
wxColour m_colour_def_color {wxColour(255, 255, 255)}
wxColour m_colour_bold_color {wxColour(38, 46, 48)}
StateColor m_btn_bg_enable
std::unordered_map< std::string, PrintOption * > m_checkbox_list
std::list< PrintOption * > m_checkbox_list_order
std::shared_ptr< int > m_token = std::make_shared<int>(0)
wxString m_ams_tooltip
std::vector< wxString > m_bedtype_list
std::vector< MachineObject * > m_list
std::vector< FilamentInfo > m_filaments
std::vector< FilamentInfo > m_ams_mapping_result
std::unordered_map< int, int > m_nozzle_mapping_result
std::vector< int > m_filaments_map
std::shared_ptr< BBLStatusBarPrint > m_status_bar
std::unique_ptr< Worker > m_worker
Slic3r::DynamicPrintConfig m_required_data_config
Slic3r::Model m_required_data_model
Slic3r::PlateDataPtrs m_required_data_plate_data_list
std::string m_required_data_file_name
std::string m_required_data_file_path
std::string m_timelapse_storage
ScalableButton * m_timelapse_folder_btn { nullptr }
PopupWindow * m_timelapse_storage_popup { nullptr }
wxTimer * m_timelapse_check_timer { nullptr }
int m_timelapse_check_timeout_ms { 5000 }
int m_timelapse_check_elapsed_ms { 0 }
int m_timelapse_check_interval_ms { 100 }
int m_timelapse_total_layer { 0 }
std::vector< POItem > ops_auto
std::vector< POItem > ops_no_auto
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description

Constructor & Destructor Documentation

◆ SelectMachineDialog()

Slic3r::GUI::SelectMachineDialog::SelectMachineDialog ( Plater * plater = nullptr)
201 : DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Send print job"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
203 , m_mapping_popup(AmsMapingPopup(this))
204 , m_mapping_tip_popup(AmsMapingTipPopup(this))
205 , m_mapping_tutorial_popup(AmsTutorialPopup(this))
206{
207 m_mapping_popup.EnableExtMappingFilaTypeCheck(false);
208
210#ifdef __WINDOWS__
211 SetDoubleBuffered(true);
212#endif //__WINDOWS__
213
214
215 if (wxGetApp().app_config->get("language") == "zh_CN") {
216 ops_auto.push_back(POItem{"auto", _L("Auto")});
217 ops_auto.push_back(POItem{"on", _L("On")});
218 ops_auto.push_back(POItem{"off", _L("Off")});
219
220 ops_no_auto.push_back(POItem{"on", _L("On")});
221 ops_no_auto.push_back(POItem{"off", _L("Off")});
222 } else {
223 ops_auto.push_back(POItem{"auto", "Auto"});
224 ops_auto.push_back(POItem{"on", "On"});
225 ops_auto.push_back(POItem{"off", "Off"});
226
227 ops_no_auto.push_back(POItem{"on", "On"});
228 ops_no_auto.push_back(POItem{"off", "Off"});
229 }
230
231 // bind
232 Bind(wxEVT_CLOSE_WINDOW, &SelectMachineDialog::on_cancel, this);
233
234 for (int i = 0; i < BED_TYPE_COUNT; i++) { m_bedtype_list.push_back(MACHINE_BED_TYPE_STRING[i]); }
235
236 // font
237 SetFont(wxGetApp().normal_font());
238
239 Freeze();
240 SetBackgroundColour(m_colour_def_color);
241
242 wxBoxSizer* m_scroll_sizer = new wxBoxSizer(wxVERTICAL);
243 m_scroll_area = new wxScrolledWindow(this);
244 m_scroll_area->SetScrollRate(0, FromDIP(20));
245 m_scroll_area->SetBackgroundColour(m_colour_def_color);
246 m_scroll_area->SetMinSize(wxSize(FromDIP(700), FromDIP(600)));
247 m_scroll_area->SetMaxSize(wxSize(FromDIP(700), FromDIP(600)));
248
249 m_line_top = new wxPanel(m_scroll_area, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
250 m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
251
252 /*mode switch*/
253 /*auto m_sizer_mode_switch = new wxBoxSizer(wxHORIZONTAL);
254 m_mode_print = new SendModeSwitchButton(scroll_area, _L_CONTEXT("Print", "Verb"), true);
255 m_mode_send = new SendModeSwitchButton(scroll_area,_L("Save to printer"), false);
256 m_sizer_mode_switch->Add(m_mode_print, 0, wxALIGN_CENTER, 0);
257 m_sizer_mode_switch->Add(0, 0, 0, wxLEFT, FromDIP(8));
258 m_sizer_mode_switch->Add(m_mode_send,0, wxALIGN_CENTER, 0);
259
260 m_mode_print->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
261 m_mode_print->setSelected(true);
262 m_mode_send->setSelected(false);
263 e.Skip();
264 });
265
266 m_mode_send->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
267 m_mode_print->setSelected(false);
268 m_mode_send->setSelected(true);
269 e.Skip();
270 });*/
271
272 m_basic_panel = new wxPanel(m_scroll_area, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
273 m_basic_panel->SetBackgroundColour(*wxWHITE);
274 m_basicl_sizer = new wxBoxSizer(wxHORIZONTAL);
275
276 /*basic info*/
277 /*thumbnail*/
278 auto m_sizer_thumbnail_area = new wxBoxSizer(wxHORIZONTAL);
279
280 auto m_panel_image = new wxPanel(m_basic_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
281 m_panel_image->SetBackgroundColour(m_colour_def_color);
282 m_sizer_thumbnail = new wxBoxSizer(wxHORIZONTAL);
283 m_thumbnailPanel = new ThumbnailPanel(m_panel_image);
284 m_thumbnailPanel->SetSize(wxSize(FromDIP(198), FromDIP(198)));
285 m_thumbnailPanel->SetMinSize(wxSize(FromDIP(198), FromDIP(198)));
286 m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(198), FromDIP(198)));
287 m_thumbnailPanel->SetBackgroundColour(*wxWHITE);
288 m_sizer_thumbnail->Add(m_thumbnailPanel, 0, wxALIGN_CENTER, 0);
289 m_panel_image->SetSizer(m_sizer_thumbnail);
290 m_panel_image->Layout();
291
292 m_sizer_thumbnail_area->Add(m_panel_image, 0, wxALIGN_CENTER, 0);
293 m_sizer_thumbnail_area->Layout();
294
295 /*basic info right*/
296 auto sizer_basic_right_info = new wxBoxSizer(wxVERTICAL);
297
298 /*rename*/
299 auto sizer_rename = new wxBoxSizer(wxHORIZONTAL);
300
301 m_rename_switch_panel = new wxSimplebook(m_basic_panel);
302 m_rename_switch_panel->SetBackgroundColour(*wxWHITE);
303 m_rename_switch_panel->SetSize(wxSize(FromDIP(360), FromDIP(25)));
304 m_rename_switch_panel->SetMinSize(wxSize(FromDIP(360), FromDIP(25)));
305 m_rename_switch_panel->SetMaxSize(wxSize(FromDIP(360), FromDIP(25)));
306
307 m_rename_normal_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
308 m_rename_normal_panel->SetBackgroundColour(*wxWHITE);
309 rename_sizer_v = new wxBoxSizer(wxVERTICAL);
310 rename_sizer_h = new wxBoxSizer(wxHORIZONTAL);
311
312 m_rename_text = new wxStaticText(m_rename_normal_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
314 m_rename_text->SetBackgroundColour(*wxWHITE);
315 m_rename_text->SetMaxSize(wxSize(FromDIP(340), -1));
316 rename_editable = new ScalableBitmap(m_scroll_area, "rename_edit", FromDIP(13)); // ORCA Match edit icon and its size
317 rename_editable_light = new ScalableBitmap(m_scroll_area, "rename_edit", FromDIP(13)); // ORCA Match edit icon and its size
318 m_rename_button = new wxStaticBitmap(m_rename_normal_panel, wxID_ANY, rename_editable->bmp(), wxDefaultPosition, wxSize(FromDIP(20), FromDIP(20)), 0);
319 m_rename_button->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
320 m_rename_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
321
322 rename_sizer_h->Add(m_rename_text, 0, wxALIGN_CENTER, 0); // ORCA align text with icon
323 rename_sizer_h->Add(m_rename_button, 0, wxALIGN_CENTER| wxLEFT, FromDIP(3)); // ORCA add gap between text and icon
324 rename_sizer_v->Add(rename_sizer_h, 1, wxTOP, 0);
325
327 m_rename_normal_panel->Layout();
329
330 auto m_rename_edit_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
331 m_rename_edit_panel->SetBackgroundColour(*wxWHITE);
332 auto rename_edit_sizer_v = new wxBoxSizer(wxVERTICAL);
333
334 m_rename_input = new ::TextInput(m_rename_edit_panel, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
335 m_rename_input->GetTextCtrl()->SetFont(::Label::Body_13);
336 m_rename_input->SetSize(wxSize(FromDIP(360), FromDIP(24)));
337 m_rename_input->SetMinSize(wxSize(FromDIP(360), FromDIP(24)));
338 m_rename_input->SetMaxSize(wxSize(FromDIP(360), FromDIP(24)));
339 m_rename_input->Bind(wxEVT_TEXT_ENTER, [this](auto& e) {on_rename_enter();});
340 m_rename_input->Bind(wxEVT_KILL_FOCUS, [this](auto& e) {
341 if (!m_rename_input->HasFocus() && !m_rename_text->HasFocus())
343 else
344 e.Skip(); });
345 rename_edit_sizer_v->Add(m_rename_input, 1, wxALIGN_CENTER, 0);
346
347
348 m_rename_edit_panel->SetSizer(rename_edit_sizer_v);
349 m_rename_edit_panel->Layout();
350 rename_edit_sizer_v->Fit(m_rename_edit_panel);
351
352 m_rename_button->Bind(wxEVT_LEFT_DOWN, &SelectMachineDialog::on_rename_click, this);
353 m_rename_switch_panel->AddPage(m_rename_normal_panel, wxEmptyString, true);
354 m_rename_switch_panel->AddPage(m_rename_edit_panel, wxEmptyString, false);
355
356 Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) {
357 if (e.GetKeyCode() == WXK_ESCAPE) {
358 if (m_rename_switch_panel->GetSelection() == 0) {
359 e.Skip();
360 }
361 else {
362 m_rename_switch_panel->SetSelection(0);
364 m_rename_normal_panel->Layout();
365 }
366 }
367 else {
368 e.Skip();
369 }
370 });
371
372
373 /*weight & time*/
374 wxBoxSizer *m_sizer_basic_weight_time = new wxBoxSizer(wxHORIZONTAL);
375
376 print_time = new ScalableBitmap(m_scroll_area, "print-time", 18);
377 timeimg = new wxStaticBitmap(m_basic_panel, wxID_ANY, print_time->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
378 m_stext_time = new Label(m_basic_panel, wxEmptyString);
380
381 print_weight = new ScalableBitmap(m_scroll_area, "print-weight", 18);
382 weightimg = new wxStaticBitmap(m_basic_panel, wxID_ANY, print_weight->bmp(), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
383 m_stext_weight = new Label(m_basic_panel, wxEmptyString);
385
386 m_sizer_basic_weight_time->Add(timeimg, 0, wxALIGN_CENTER, 0);
387 m_sizer_basic_weight_time->Add(m_stext_time, 0, wxALIGN_CENTER|wxLEFT, FromDIP(6));
388 m_sizer_basic_weight_time->AddSpacer(FromDIP(30));
389 m_sizer_basic_weight_time->Add(weightimg, 0, wxALIGN_CENTER, 0);
390 m_sizer_basic_weight_time->Add(m_stext_weight, 0, wxALIGN_CENTER|wxLEFT, FromDIP(6));
391
392 /*last & next page*/
393 auto last_plate_sizer = new wxBoxSizer(wxVERTICAL);
394 m_bitmap_last_plate = new wxStaticBitmap(m_basic_panel, wxID_ANY, create_scaled_bitmap("go_last_plate", m_scroll_area, 25), wxDefaultPosition, wxSize(FromDIP(25), FromDIP(25)), 0);
395 m_bitmap_last_plate->Hide();
396 last_plate_sizer->Add(m_bitmap_last_plate, 0, wxALIGN_CENTER, 0);
397
398 auto next_plate_sizer = new wxBoxSizer(wxVERTICAL);
399 m_bitmap_next_plate = new wxStaticBitmap(m_basic_panel, wxID_ANY, create_scaled_bitmap("go_next_plate", m_scroll_area, 25), wxDefaultPosition, wxSize(FromDIP(25), FromDIP(25)), 0);
400 m_bitmap_next_plate->Hide();
401 next_plate_sizer->Add(m_bitmap_next_plate, 0, wxALIGN_CENTER, 0);
402
403 sizer_rename->Add(m_rename_switch_panel, 0, wxALIGN_CENTER, 0);
404 sizer_rename->Add(0, 0, 0, wxEXPAND, 0);
405 sizer_rename->Add(m_bitmap_last_plate, 0, wxALIGN_CENTER, 0);
406 sizer_rename->Add(m_bitmap_next_plate, 0, wxALIGN_CENTER, 0);
407
408 m_printer_box = new PrinterInfoBox(m_basic_panel, this);
409
410
411 m_text_printer_msg = new PrinterMsgPanel(m_basic_panel);
412 m_text_printer_msg->SetMinSize(wxSize(FromDIP(420), -1));
413 m_text_printer_msg->SetMaxSize(wxSize(FromDIP(420), -1));
414 m_text_printer_msg->SetBackgroundColour(m_colour_def_color);
416 m_text_printer_msg->Hide();
417
419 m_text_printer_msg_tips->SetMinSize(wxSize(FromDIP(420), FromDIP(24)));
420 m_text_printer_msg_tips->SetMaxSize(wxSize(FromDIP(420), FromDIP(24)));
422 m_text_printer_msg_tips->SetForegroundColour(wxColour(0x6B, 0x6B, 0x6B));
424 m_text_printer_msg_tips->GetAlignment();
425
426 // Orca: best-position "recommended arrangement saves X" clickable tip. Hidden unless the
427 // printer has a filament switcher and a better arrangement exists; click opens the best-position popup.
428 m_saveTimeText = new Label(m_basic_panel, wxEmptyString);
429 m_saveTimeText->SetForegroundColour(wxColour("#FF6F00"));
431 m_saveTimeText->Hide();
433 m_saveTimeText->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent&) { m_saveTimeText->SetCursor(wxCURSOR_HAND); });
434 m_saveTimeText->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent&) { m_saveTimeText->SetCursor(wxCURSOR_DEFAULT); });
435 Bind(wxEVT_REFRESH_DATA, &SelectMachineDialog::update_best_pos_dialog, this);
436
437 sizer_basic_right_info->Add(sizer_rename, 0, wxTOP, 0);
438 sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(5));
439 sizer_basic_right_info->Add(m_sizer_basic_weight_time, 0, wxTOP, 0);
440 sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(10));
441 sizer_basic_right_info->Add(m_printer_box, 0, wxTOP, 0);
442 sizer_basic_right_info->Add(0, 0, 0, wxTOP, FromDIP(4));
443 sizer_basic_right_info->Add(m_text_printer_msg, 0, wxLEFT, 0);
444 sizer_basic_right_info->AddSpacer(FromDIP(10));
445 sizer_basic_right_info->Add(m_text_printer_msg_tips, 0, wxLEFT, 0);
446 sizer_basic_right_info->Add(m_saveTimeText, 0, wxTOP, 0);
447
448
449 m_basicl_sizer->Add(m_sizer_thumbnail_area, 0, wxLEFT, 0);
450 m_basicl_sizer->Add(0, 0, 0, wxLEFT, FromDIP(8));
451 m_basicl_sizer->Add(sizer_basic_right_info, 0, wxLEFT, 0);
452
453 m_basic_panel->SetSizer(m_basicl_sizer);
454 m_basic_panel->Layout();
455
456
457 /*filaments info*/
458 wxBoxSizer* sizer_split_filament = new wxBoxSizer(wxHORIZONTAL);
459
460 auto m_stext_filament_title = new Label(m_scroll_area, _L("Filament"));
461 m_stext_filament_title->SetFont(::Label::Head_13);
462 m_stext_filament_title->SetForegroundColour(0x909090);
463
464 auto m_split_line_filament = new wxPanel(m_scroll_area, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
465 m_split_line_filament->SetBackgroundColour(0xeeeeee);
466 m_split_line_filament->SetMinSize(wxSize(-1, 1));
467 m_split_line_filament->SetMaxSize(wxSize(-1, 1));
468
469 m_sizer_autorefill = new wxBoxSizer(wxHORIZONTAL);
470 m_ams_backup_tip = new Label(m_scroll_area, _L("Auto Refill"));
472 m_ams_backup_tip->SetForegroundColour(wxColour("#009688"));
473 m_ams_backup_tip->SetBackgroundColour(*wxWHITE);
474 img_ams_backup = new wxStaticBitmap(m_scroll_area, wxID_ANY, create_scaled_bitmap("automatic_material_renewal", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)), 0);
475 img_ams_backup->SetBackgroundColour(*wxWHITE);
476
477 m_sizer_autorefill->Add(0, 0, 1, wxEXPAND, 0);
478 m_sizer_autorefill->Add(img_ams_backup, 0, wxALL, FromDIP(3));
479 m_sizer_autorefill->Add(m_ams_backup_tip, 0, wxTOP, FromDIP(5));
480
481 m_ams_backup_tip->Hide();
482 img_ams_backup->Hide();
483
484 m_ams_backup_tip->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
485 img_ams_backup->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
486
487 m_ams_backup_tip->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
488 img_ams_backup->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
489
490 m_ams_backup_tip->Bind(wxEVT_LEFT_DOWN, [this](auto& e) { if (!m_is_in_sending_mode) { popup_filament_backup(); on_rename_enter(); } });
491 img_ams_backup->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {if (!m_is_in_sending_mode) popup_filament_backup(); on_rename_enter(); });
492
493 sizer_split_filament->Add(0, 0, 0, wxEXPAND, 0);
494 sizer_split_filament->Add(m_stext_filament_title, 0, wxALIGN_CENTER, 0);
495 sizer_split_filament->Add(m_split_line_filament, 1, wxALIGN_CENTER_VERTICAL, 0);
496 sizer_split_filament->Add(m_sizer_autorefill, 0, wxALIGN_CENTER, 0);
497 /*filament area*/
498 /*1 extruder*/
499 m_filament_panel = new StaticBox(m_scroll_area);
500 m_filament_panel->SetBackgroundColour(wxColour("#F8F8F8"));
501 m_filament_panel->SetBorderWidth(0);
502 m_filament_panel->SetMinSize(wxSize(FromDIP(637), -1));
503 m_filament_panel->SetMaxSize(wxSize(FromDIP(637), -1));
504 m_filament_panel_sizer = new wxBoxSizer(wxVERTICAL);
505
506 m_sizer_ams_mapping = new wxGridSizer(0, 10, FromDIP(7), FromDIP(7));
507 m_filament_panel_sizer->Add(m_sizer_ams_mapping, 0, wxEXPAND|wxALL, FromDIP(10));
509 m_filament_panel->Layout();
510 m_filament_panel->Fit();
511
512 /*left & right extruder*/
513 m_sizer_filament_2extruder = new wxBoxSizer(wxHORIZONTAL);
514
515 m_filament_left_panel = new StaticBox(m_scroll_area);
516 m_filament_left_panel->SetBackgroundColour(wxColour("#F8F8F8"));
517 m_filament_left_panel->SetBorderWidth(0);
518 m_filament_left_panel->SetMinSize(wxSize(FromDIP(315), -1));
519 m_filament_left_panel->SetMaxSize(wxSize(FromDIP(315), -1));
520
521 m_filament_panel_left_sizer = new wxBoxSizer(wxVERTICAL);
522 auto left_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
523 auto left_recommend_title1 = new Label(m_filament_left_panel, _L("Left Nozzle"));
524 left_recommend_title1->SetFont(::Label::Head_13);
525 left_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
526 left_recommend_title_sizer->Add(left_recommend_title1, 0, wxALIGN_CENTER, 0);
527
528 m_sizer_ams_mapping_left = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
529 m_filament_panel_left_sizer->Add(left_recommend_title_sizer, 0, wxLEFT|wxRIGHT|wxTOP, FromDIP(10));
530 m_filament_panel_left_sizer->Add(m_sizer_ams_mapping_left, 0, wxEXPAND|wxALL, FromDIP(10));
532 m_filament_left_panel->Layout();
533
534 m_filament_right_panel = new StaticBox(m_scroll_area);
535 m_filament_right_panel->SetBorderWidth(0);
536 m_filament_right_panel->SetBackgroundColour(wxColour("#F8F8F8"));
537 m_filament_right_panel->SetMinSize(wxSize(FromDIP(315), -1));
538 m_filament_right_panel->SetMaxSize(wxSize(FromDIP(315), -1));
539
540 m_filament_panel_right_sizer = new wxBoxSizer(wxVERTICAL);
541 auto right_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
542 auto right_recommend_title1 = new Label(m_filament_right_panel, _L("Right Nozzle"));
543 right_recommend_title1->SetFont(::Label::Head_13);
544 right_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
545 right_recommend_title_sizer->Add(right_recommend_title1, 0, wxALIGN_CENTER, 0);
546
547 m_sizer_ams_mapping_right = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
548 m_filament_panel_right_sizer->Add(right_recommend_title_sizer, 0, wxLEFT|wxRIGHT|wxTOP, FromDIP(10));
549 m_filament_panel_right_sizer->Add(m_sizer_ams_mapping_right, 0, wxEXPAND|wxALL, FromDIP(10));
551 m_filament_right_panel->Layout();
552
554 m_sizer_filament_2extruder->Add( 0, 0, 1, wxEXPAND, 0);
557
558 m_filament_panel->Hide();
559
560 m_statictext_ams_msg = new PrinterMsgPanel(m_scroll_area);
561 m_statictext_ams_msg->SetMinSize(wxSize(FromDIP(655), -1));
562 m_statictext_ams_msg->SetMaxSize(wxSize(FromDIP(655), -1));
563 m_statictext_ams_msg->SetBackgroundColour(m_colour_def_color);
565 m_statictext_ams_msg->Hide();
566
567 /*ams mapping suggestions*/
568
569 m_link_edit_nozzle = new Label(m_scroll_area, wxEmptyString);
571 m_link_edit_nozzle->SetForegroundColour("#009688");
572 m_link_edit_nozzle->SetBackgroundColour(*wxWHITE);
573 m_link_edit_nozzle->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { SetCursor(wxCURSOR_HAND); });
574 m_link_edit_nozzle->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { SetCursor(wxCURSOR_ARROW); });
575 m_link_edit_nozzle->SetLabel(_L("Not satisfied with the grouping of filaments? Regroup and slice ->"));
576
577 m_link_edit_nozzle->Bind(wxEVT_LEFT_DOWN, [this](auto &e) {
578
580 return;
581 }
582
585
586 EndModal(wxID_CLOSE);
587 Plater * plater = wxGetApp().plater();
588 wxCommandEvent evt(EVT_OPEN_FILAMENT_MAP_SETTINGS_DIALOG);
589 evt.SetEventObject(plater);
590 evt.SetInt(1); // 1 means from gcode viewer
591 wxPostEvent(plater, evt);
592 });
593
594 m_check_ext_change_assist = new CheckBox(m_scroll_area, wxID_ANY);
595 m_check_ext_change_assist->SetValue(false);
596 m_check_ext_change_assist->SetBackgroundColour(*wxWHITE);
597 m_check_ext_change_assist->SetToolTip(_L("Manually change external spool during printing for multi-color printing"));
599 m_label_ext_change_assist = new Label(m_scroll_area, _L("Multi-color with external"));
602 m_label_ext_change_assist->SetMaxSize(wxSize(FromDIP(200), -1));
604 m_label_ext_change_assist->SetBackgroundColour(*wxWHITE);
605 m_label_ext_change_assist->SetToolTip(_L("Manually change external spool during printing for multi-color printing"));
606
607 wxSizer* suggestion_sizer = new wxBoxSizer(wxHORIZONTAL);
608 suggestion_sizer->Add(m_link_edit_nozzle, 0, wxLEFT, 0);
609 suggestion_sizer->Add(0, 0, 1, wxEXPAND, 0);
610 suggestion_sizer->Add(m_check_ext_change_assist, 0, wxRIGHT, FromDIP(10));
611 suggestion_sizer->Add(m_label_ext_change_assist, 0, wxRIGHT, 0);
612
613 m_mapping_sugs_sizer = new wxBoxSizer(wxHORIZONTAL);
614 //auto m_img_mapping_sugs = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("warning", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
615 auto m_txt_mapping_sugs = new Label(m_scroll_area, wxEmptyString);
616 m_txt_mapping_sugs->SetFont(::Label::Body_13);
617 m_txt_mapping_sugs->SetForegroundColour(wxColour(0xFF, 0x6F, 0x00));
618 m_txt_mapping_sugs->SetMinSize(wxSize(FromDIP(580), -1));
619 m_txt_mapping_sugs->SetMaxSize(wxSize(FromDIP(580), -1));
620 m_txt_mapping_sugs->SetBackgroundColour(*wxWHITE);
621 m_txt_mapping_sugs->SetLabel(_L("Your filament grouping method in the sliced file is not optimal."));
622 //m_mapping_sugs_sizer->Add(m_img_mapping_sugs, 0, wxALIGN_CENTER, 0);
623 m_mapping_sugs_sizer->Add(m_txt_mapping_sugs, 0, wxALIGN_CENTER, 0);
624
625 m_change_filament_times_sizer = new wxBoxSizer(wxHORIZONTAL);
626 //auto m_img_change_filament_times = new wxStaticBitmap(this, wxID_ANY, create_scaled_bitmap("warning", this, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
627 m_txt_change_filament_times = new Label(m_scroll_area, wxEmptyString);
629 m_txt_change_filament_times->SetMinSize(wxSize(FromDIP(580), -1));
630 m_txt_change_filament_times->SetMaxSize(wxSize(FromDIP(580), -1));
631 m_txt_change_filament_times->SetForegroundColour(wxColour(0xFF, 0x6F, 0x00));
632 m_txt_change_filament_times->SetBackgroundColour(*wxWHITE);
633 m_txt_change_filament_times->SetLabel(wxEmptyString);
634 //m_change_filament_times_sizer->Add(m_img_change_filament_times, 0, wxTOP, FromDIP(2));
636
637 m_warn_when_drying_sizer = new wxBoxSizer(wxHORIZONTAL);
638 m_txt_warn_when_drying = new Label(m_scroll_area, wxEmptyString);
640 m_txt_warn_when_drying->SetForegroundColour(wxColour("#F09A17"));
641 m_txt_warn_when_drying->SetBackgroundColour(*wxWHITE);
642 m_txt_warn_when_drying->SetLabel(_L("To ensure print quality, the drying temperature will be lowered during printing."));
643 m_warn_when_drying_sizer->Add(m_txt_warn_when_drying, 0, wxTOP, FromDIP(2));
644
645 /*Advanced Options*/
646 wxBoxSizer* sizer_split_options = new wxBoxSizer(wxHORIZONTAL);
647 auto m_split_options_line = new wxPanel(m_scroll_area, wxID_ANY);
648 m_split_options_line->SetBackgroundColour(0xEEEEEE);
649 m_split_options_line->SetSize(wxSize(-1, FromDIP(1)));
650 m_split_options_line->SetMinSize(wxSize(-1, FromDIP(1)));
651 m_split_options_line->SetMaxSize(wxSize(-1, FromDIP(1)));
652 sizer_split_options->Add(0, 0, 0, wxEXPAND, 0);
653 sizer_split_options->Add(m_split_options_line, 1, wxALIGN_CENTER, 0);
654
655 m_options_other = new wxPanel(m_scroll_area);
656 m_options_other->SetBackgroundColour(*wxWHITE);
657
658 auto option_timelapse = new PrintOption(m_options_other, _L("Timelapse"), wxEmptyString, ops_no_auto, "timelapse");
659
660 // timelapse storage location folder button (shown only when is_support_internal_timelapse)
661 m_timelapse_folder_btn = new ScalableButton(m_options_other, wxID_ANY, "folder-closed", wxEmptyString,
662 wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true);
663 m_timelapse_folder_btn->SetBackgroundColour(*wxWHITE);
664 m_timelapse_folder_btn->SetToolTip(_L("Select timelapse storage location"));
666 m_timelapse_folder_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) {
668 });
669 m_timelapse_folder_btn->Bind(wxEVT_ENTER_WINDOW, [this](wxMouseEvent& e) {
670 // hover: only switch if popup is not open (popup open = active state)
672 m_timelapse_folder_btn->SetBitmap(create_scaled_bitmap("folder-closed-hover", m_timelapse_folder_btn, 16));
673 e.Skip();
674 });
675 m_timelapse_folder_btn->Bind(wxEVT_LEAVE_WINDOW, [this](wxMouseEvent& e) {
676 // restore normal (popup open state is handled separately)
679 e.Skip();
680 });
681 option_timelapse->insert_extra_widget(m_timelapse_folder_btn);
682
683 auto option_auto_bed_level = new PrintOption(
684 m_options_other, _L("Auto Bed Leveling"),
685 _L("This checks the flatness of heatbed. Leveling makes extruded height uniform.\n*Automatic mode: Run a leveling check(about 10 seconds). Skip if surface is fine."),
686 ops_auto, "bed_leveling");
687
688 auto option_flow_dynamics_cali =
689 new PrintOption(m_options_other, _L("Flow Dynamics Calibration"),
690 _L("This process determines the dynamic flow values to improve overall print quality.\n*Automatic mode: Skip if the filament was calibrated recently."),
691 ops_auto, "flow_cali");
692
693 auto option_nozzle_offset_cali_cali = new PrintOption(
695 _L("Nozzle Offset Calibration"),
696 _L("Calibrate nozzle offsets to enhance print quality.\n*Automatic mode: Check for calibration before printing. Skip if unnecessary."),
697 ops_auto, "nozzle_offset_cali"
698 );
699
700 // Orca: PA-profile-sharing toggle (extrude_cali_manual_mode). On = nozzles/filaments of the
701 // same type share one PA profile; shown only for pa_mode printers with Flow Dynamics Cali off.
702 auto option_pa_value = new PrintOption(
704 _L("Shared PA Profile"),
705 _L("Nozzles and filaments of the same type share the same PA profile."),
706 ops_no_auto, "pa_value"
707 );
708
709 m_sizer_options = new wxGridSizer(0, 2, FromDIP(5), FromDIP(10));
710 m_sizer_options->Add(option_timelapse, 0, wxEXPAND);
711 m_sizer_options->Add(option_auto_bed_level, 0, wxEXPAND);
712 m_sizer_options->Add(option_flow_dynamics_cali, 0, wxEXPAND);
713 m_sizer_options->Add(option_nozzle_offset_cali_cali, 0, wxEXPAND);
714
715 m_checkbox_list_order.push_back(option_timelapse);
716 m_checkbox_list_order.push_back(option_auto_bed_level);
717 m_checkbox_list_order.push_back(option_flow_dynamics_cali);
718 m_checkbox_list_order.push_back(option_nozzle_offset_cali_cali);
719 m_checkbox_list_order.push_back(option_pa_value);
720
722 m_options_other->Layout();
723 m_options_other->Fit();
724
725 m_checkbox_list["timelapse"] = option_timelapse;
726 m_checkbox_list["bed_leveling"] = option_auto_bed_level;
727 m_checkbox_list["flow_cali"] = option_flow_dynamics_cali;
728 m_checkbox_list["nozzle_offset_cali"] = option_nozzle_offset_cali_cali;
729 m_checkbox_list["pa_value"] = option_pa_value;
730 for (auto print_opt : m_checkbox_list_order) {
731 print_opt->Bind(EVT_SWITCH_PRINT_OPTION, [this, print_opt](auto &e) {
733 // Flow calibration feeds the printer-side rack nozzle mapping; re-request it on change.
734 if (print_opt == m_checkbox_list["flow_cali"]) on_flow_cali_option_changed();
735 else if (print_opt == m_checkbox_list["pa_value"]) on_pa_value_option_changed();
736 });
737 }
738
739 option_auto_bed_level->Hide();
740 option_flow_dynamics_cali->Hide();
741 option_nozzle_offset_cali_cali->Hide();
742 option_pa_value->Hide();
743
744 m_simplebook = new wxSimplebook(this, wxID_ANY, wxDefaultPosition, SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2, 0);
747
748 // perpare mode
749 m_panel_prepare = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
750 m_panel_prepare->SetBackgroundColour(m_colour_def_color);
751 wxBoxSizer *m_sizer_prepare = new wxBoxSizer(wxHORIZONTAL);
752 wxBoxSizer *m_sizer_pcont = new wxBoxSizer(wxVERTICAL);
753
754 m_button_ensure = new Button(m_panel_prepare, _L("Send"));
756 m_button_ensure->Bind(wxEVT_BUTTON, &SelectMachineDialog::on_ok_btn, this);
757
758 m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
759 m_sizer_pcont->Add(m_button_ensure, 0,wxALIGN_CENTER, 0);
760
761 m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(12));
762 m_sizer_prepare->Add(m_sizer_pcont, 0, wxALIGN_CENTER, 0);
763
764 m_panel_prepare->SetSizer(m_sizer_prepare);
765 m_panel_prepare->Layout();
766 m_simplebook->AddPage(m_panel_prepare, wxEmptyString, true);
767
768 // sending mode
769 m_status_bar = std::make_shared<BBLStatusBarPrint>(m_simplebook);
770 m_panel_sending = m_status_bar->get_panel();
771 m_simplebook->AddPage(m_panel_sending, wxEmptyString, false);
772
773 m_worker = std::make_unique<PlaterWorker<BoostThreadWorker>>(this, m_status_bar, "send_worker");
774
775 // finish mode
776 m_panel_finish = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
777 m_panel_finish->SetBackgroundColour(wxColour(135, 206, 250));
778 wxBoxSizer *m_sizer_finish = new wxBoxSizer(wxHORIZONTAL);
779 wxBoxSizer *m_sizer_finish_v = new wxBoxSizer(wxVERTICAL);
780 wxBoxSizer *m_sizer_finish_h = new wxBoxSizer(wxHORIZONTAL);
781
782 auto imgsize = FromDIP(25);
783 auto completedimg = new wxStaticBitmap(m_panel_finish, wxID_ANY, create_scaled_bitmap("completed", m_panel_finish, 25), wxDefaultPosition, wxSize(imgsize, imgsize), 0);
784 m_sizer_finish_h->Add(completedimg, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
785
786 m_statictext_finish = new wxStaticText(m_panel_finish, wxID_ANY, _L("Send complete"), wxDefaultPosition, wxDefaultSize, 0);
787 m_statictext_finish->Wrap(-1);
788 m_statictext_finish->SetForegroundColour(wxColour(0, 150, 136));
789 m_sizer_finish_h->Add(m_statictext_finish, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
790
791 m_sizer_finish_v->Add(m_sizer_finish_h, 1, wxALIGN_CENTER, 0);
792
793 m_sizer_finish->Add(m_sizer_finish_v, 1, wxALIGN_CENTER, 0);
794
795 m_panel_finish->SetSizer(m_sizer_finish);
796 m_panel_finish->Layout();
797 m_sizer_finish->Fit(m_panel_finish);
798 m_simplebook->AddPage(m_panel_finish, wxEmptyString, false);
799
800 //show bind failed info
801 m_sw_print_failed_info = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxSize(SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2.x, FromDIP(125)), wxVSCROLL);
802 m_sw_print_failed_info->SetBackgroundColour(*wxWHITE);
803 m_sw_print_failed_info->SetScrollRate(0, FromDIP(20));
804 m_sw_print_failed_info->SetMinSize(wxSize(SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2.x, FromDIP(125)));
805 m_sw_print_failed_info->SetMaxSize(wxSize(SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2.x, FromDIP(125)));
806
807 wxBoxSizer* sizer_print_failed_info = new wxBoxSizer(wxVERTICAL);
808 m_sw_print_failed_info->SetSizer(sizer_print_failed_info);
809
810
811 wxBoxSizer* sizer_error_code = new wxBoxSizer(wxHORIZONTAL);
812 wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL);
813 wxBoxSizer* sizer_extra_info = new wxBoxSizer(wxHORIZONTAL);
814
815 auto st_title_error_code = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error code"));
816 auto st_title_error_code_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY,": ");
817 m_st_txt_error_code = new Label(m_sw_print_failed_info, wxEmptyString);
818 st_title_error_code->SetForegroundColour(0x909090);
819 st_title_error_code_doc->SetForegroundColour(0x909090);
820 m_st_txt_error_code->SetForegroundColour(0x909090);
821 st_title_error_code->SetFont(::Label::Body_13);
822 st_title_error_code_doc->SetFont(::Label::Body_13);
824 st_title_error_code->SetMinSize(wxSize(FromDIP(74), -1));
825 st_title_error_code->SetMaxSize(wxSize(FromDIP(74), -1));
826 m_st_txt_error_code->SetMinSize(wxSize(FromDIP(500), -1));
827 m_st_txt_error_code->SetMaxSize(wxSize(FromDIP(500), -1));
828 sizer_error_code->Add(st_title_error_code, 0, wxALL, 0);
829 sizer_error_code->Add(st_title_error_code_doc, 0, wxALL, 0);
830 sizer_error_code->Add(m_st_txt_error_code, 0, wxALL, 0);
831
832
833 auto st_title_error_desc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error desc"));
834 auto st_title_error_desc_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY,": ");
835 m_st_txt_error_desc = new Label(m_sw_print_failed_info, wxEmptyString);
836 st_title_error_desc->SetForegroundColour(0x909090);
837 st_title_error_desc_doc->SetForegroundColour(0x909090);
838 m_st_txt_error_desc->SetForegroundColour(0x909090);
839 st_title_error_desc->SetFont(::Label::Body_13);
840 st_title_error_desc_doc->SetFont(::Label::Body_13);
842 st_title_error_desc->SetMinSize(wxSize(FromDIP(74), -1));
843 st_title_error_desc->SetMaxSize(wxSize(FromDIP(74), -1));
844 m_st_txt_error_desc->SetMinSize(wxSize(FromDIP(500), -1));
845 m_st_txt_error_desc->SetMaxSize(wxSize(FromDIP(500), -1));
846 sizer_error_desc->Add(st_title_error_desc, 0, wxALL, 0);
847 sizer_error_desc->Add(st_title_error_desc_doc, 0, wxALL, 0);
848 sizer_error_desc->Add(m_st_txt_error_desc, 0, wxALL, 0);
849
850 auto st_title_extra_info = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Extra info"));
851 auto st_title_extra_info_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
852 m_st_txt_extra_info = new Label(m_sw_print_failed_info, wxEmptyString);
853 st_title_extra_info->SetForegroundColour(0x909090);
854 st_title_extra_info_doc->SetForegroundColour(0x909090);
855 m_st_txt_extra_info->SetForegroundColour(0x909090);
856 st_title_extra_info->SetFont(::Label::Body_13);
857 st_title_extra_info_doc->SetFont(::Label::Body_13);
859 st_title_extra_info->SetMinSize(wxSize(FromDIP(74), -1));
860 st_title_extra_info->SetMaxSize(wxSize(FromDIP(74), -1));
861 m_st_txt_extra_info->SetMinSize(wxSize(FromDIP(500), -1));
862 m_st_txt_extra_info->SetMaxSize(wxSize(FromDIP(500), -1));
863 sizer_extra_info->Add(st_title_extra_info, 0, wxALL, 0);
864 sizer_extra_info->Add(st_title_extra_info_doc, 0, wxALL, 0);
865 sizer_extra_info->Add(m_st_txt_extra_info, 0, wxALL, 0);
866
867 // ORCA standardized HyperLink
868 m_link_network_state = new HyperLink(m_sw_print_failed_info, _L("Check the status of current system services"), wxGetApp().link_to_network_check());
870
871 sizer_print_failed_info->Add(m_link_network_state, 0, wxLEFT, 5);
872 sizer_print_failed_info->Add(sizer_error_code, 0, wxLEFT, 5);
873 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
874 sizer_print_failed_info->Add(sizer_error_desc, 0, wxLEFT, 5);
875 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
876 sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
877
878 m_scroll_sizer->Add(m_line_top, 0, wxEXPAND, 0);
879 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(11));
880 //m_sizer_main->Add(m_sizer_mode_switch, 0, wxALIGN_CENTER, 0);
881 //m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(15));
882 m_scroll_sizer->AddStretchSpacer();
883 m_scroll_sizer->Add(m_basic_panel, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
884 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(14));
885 m_scroll_sizer->Add(sizer_split_filament, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
886 m_scroll_sizer->Add(m_filament_panel, 0, wxALIGN_CENTER|wxLEFT|wxRIGHT, FromDIP(15));
887 m_scroll_sizer->Add(m_sizer_filament_2extruder, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
888 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(6));
889 m_scroll_sizer->Add(m_statictext_ams_msg, 0, wxLEFT|wxRIGHT, FromDIP(15));
890 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(10));
891 m_scroll_sizer->Add(m_mapping_sugs_sizer, 0, wxLEFT|wxRIGHT, FromDIP(15));
892 m_scroll_sizer->Add(m_change_filament_times_sizer, 0,wxLEFT|wxRIGHT, FromDIP(15));
893 // m_scroll_sizer->Add(m_link_edit_nozzle, 0, wxLEFT|wxRIGHT, FromDIP(15));
894 m_scroll_sizer->Add(suggestion_sizer, 0, wxLEFT|wxRIGHT|wxEXPAND, FromDIP(15));
895 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(10));
896 m_scroll_sizer->Add(m_warn_when_drying_sizer, 0, wxLEFT|wxRIGHT, FromDIP(15));
897 m_scroll_sizer->Add(sizer_split_options, 1, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
898 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(10));
899 m_scroll_sizer->Add(m_options_other, 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(15));
900 m_scroll_sizer->Add(0, 0, 0, wxTOP, FromDIP(30));
901
903
904 m_scroll_area->SetSizer(m_scroll_sizer);
905
906 wxBoxSizer *sizer_main = new wxBoxSizer(wxVERTICAL);
907 sizer_main->Add(m_scroll_area, 1, wxEXPAND, 0);
908 sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER, 0);
909 sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
910 sizer_main->Add(m_sw_print_failed_info, 0, wxALIGN_CENTER, 0);
911 sizer_main->Add(0, 0, 0, wxTOP, FromDIP(18));
912
913 SetSizer(sizer_main);
914 Layout();
915 Fit();
916 Thaw();
917
918 init_bind();
919 init_timer();
920 Centre(wxBOTH);
921 wxGetApp().UpdateDlgDarkUI(this);
922}
@ Confirm
Definition Button.hpp:25
@ Choice
Definition Button.hpp:33
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
#define SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2
Definition SelectMachine.hpp:131
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_13
Definition Label.hpp:46
static wxFont Head_14
Definition Label.hpp:45
static wxFont Body_12
Definition Label.hpp:55
const wxFont & normal_font() const
Definition GUI_Utils.hpp:205
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305
void on_rename_enter()
Definition SelectMachine.cpp:4105
ScalableBitmap * print_time
Definition SelectMachine.hpp:439
wxBoxSizer * rename_sizer_h
Definition SelectMachine.hpp:385
void on_reselect_dialog_btn_clicked(wxMouseEvent &)
Definition SelectMachine.cpp:2253
wxBoxSizer * m_sizer_thumbnail
Definition SelectMachine.hpp:381
Label * m_saveTimeText
Definition SelectMachine.hpp:418
ScalableBitmap * rename_editable
Definition SelectMachine.hpp:436
Label * m_txt_warn_when_drying
Definition SelectMachine.hpp:424
Label * m_link_edit_nozzle
Definition SelectMachine.hpp:407
std::list< PrintOption * > m_checkbox_list_order
Definition SelectMachine.hpp:339
bool m_export_3mf_cancel
Definition SelectMachine.hpp:322
wxBoxSizer * m_sizer_autorefill
Definition SelectMachine.hpp:386
wxBoxSizer * m_filament_panel_left_sizer
Definition SelectMachine.hpp:456
StaticBox * m_filament_panel
Definition SelectMachine.hpp:451
AmsMapingTipPopup m_mapping_tip_popup
Definition SelectMachine.hpp:375
Label * m_text_printer_msg_tips
Definition SelectMachine.hpp:428
void save_option_vals()
Definition SelectMachine.cpp:3228
wxStaticBitmap * weightimg
Definition SelectMachine.hpp:440
void show_print_failed_info(bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
Definition SelectMachine.cpp:978
Label * m_st_txt_extra_info
Definition SelectMachine.hpp:410
AmsTutorialPopup m_mapping_tutorial_popup
Definition SelectMachine.hpp:376
Label * m_stext_weight
Definition SelectMachine.hpp:417
Label * m_txt_change_filament_times
Definition SelectMachine.hpp:420
Label * m_st_txt_error_desc
Definition SelectMachine.hpp:409
wxPanel * m_rename_normal_panel
Definition SelectMachine.hpp:399
wxStaticBitmap * timeimg
Definition SelectMachine.hpp:438
void show_timelapse_folder_popup()
Definition SelectMachine.cpp:3265
void on_cancel(wxCloseEvent &event)
Definition SelectMachine.cpp:2599
wxString m_current_project_name
Definition SelectMachine.hpp:332
ScalableBitmap * print_weight
Definition SelectMachine.hpp:441
static std::vector< wxString > MACHINE_BED_TYPE_STRING
Definition SelectMachine.hpp:468
void on_flow_cali_option_changed()
Definition SelectMachine.cpp:1753
wxPanel * m_panel_prepare
Definition SelectMachine.hpp:401
static void init_machine_bed_types()
Definition SelectMachine.cpp:186
StaticBox * m_filament_right_panel
Definition SelectMachine.hpp:453
std::vector< POItem > ops_no_auto
Definition SelectMachine.hpp:370
wxBoxSizer * rename_sizer_v
Definition SelectMachine.hpp:384
PrinterInfoBox * m_printer_box
Definition SelectMachine.hpp:426
wxPanel * m_options_other
Definition SelectMachine.hpp:379
wxSimplebook * m_rename_switch_panel
Definition SelectMachine.hpp:413
wxBoxSizer * m_basicl_sizer
Definition SelectMachine.hpp:383
CheckBox * m_check_ext_change_assist
Definition SelectMachine.hpp:421
wxStaticText * m_statictext_finish
Definition SelectMachine.hpp:431
wxColour m_colour_def_color
Definition SelectMachine.hpp:334
wxGridSizer * m_sizer_ams_mapping_right
Definition SelectMachine.hpp:462
wxPanel * m_basic_panel
Definition SelectMachine.hpp:398
wxScrolledWindow * m_sw_print_failed_info
Definition SelectMachine.hpp:435
AmsMapingPopup m_mapping_popup
Definition SelectMachine.hpp:374
Label * m_label_ext_change_assist
Definition SelectMachine.hpp:422
ScalableButton * m_timelapse_folder_btn
Definition SelectMachine.hpp:360
wxGridSizer * m_sizer_ams_mapping
Definition SelectMachine.hpp:460
wxGridSizer * m_sizer_ams_mapping_left
Definition SelectMachine.hpp:461
std::unordered_map< std::string, PrintOption * > m_checkbox_list
Definition SelectMachine.hpp:338
wxBoxSizer * m_change_filament_times_sizer
Definition SelectMachine.hpp:388
TextInput * m_rename_input
Definition SelectMachine.hpp:432
ScalableBitmap * rename_editable_light
Definition SelectMachine.hpp:437
Label * m_ams_backup_tip
Definition SelectMachine.hpp:411
Button * m_button_ensure
Definition SelectMachine.hpp:390
void on_pa_value_option_changed()
Definition SelectMachine.cpp:1774
wxScrolledWindow * m_scroll_area
Definition SelectMachine.hpp:404
wxStaticBitmap * m_rename_button
Definition SelectMachine.hpp:391
void update_timelapse_folder_btn_icon()
Definition SelectMachine.cpp:3257
void on_rename_click(wxMouseEvent &event)
Definition SelectMachine.cpp:4096
std::shared_ptr< BBLStatusBarPrint > m_status_bar
Definition SelectMachine.hpp:349
StaticBox * m_filament_left_panel
Definition SelectMachine.hpp:452
Label * m_stext_time
Definition SelectMachine.hpp:416
PrinterMsgPanel * m_text_printer_msg
Definition SelectMachine.hpp:427
wxBoxSizer * m_mapping_sugs_sizer
Definition SelectMachine.hpp:387
wxBoxSizer * m_filament_panel_right_sizer
Definition SelectMachine.hpp:457
wxPanel * m_panel_sending
Definition SelectMachine.hpp:400
wxTimer * m_timelapse_check_timer
Definition SelectMachine.hpp:363
std::vector< wxString > m_bedtype_list
Definition SelectMachine.hpp:343
void init_timer()
Definition SelectMachine.cpp:2593
void init_bind()
Definition SelectMachine.cpp:924
wxPanel * m_panel_finish
Definition SelectMachine.hpp:402
std::unique_ptr< Worker > m_worker
Definition SelectMachine.hpp:350
wxSimplebook * m_simplebook
Definition SelectMachine.hpp:414
wxStaticBitmap * m_bitmap_next_plate
Definition SelectMachine.hpp:394
Plater * m_plater
Definition SelectMachine.hpp:378
void update_best_pos_dialog(wxCommandEvent &evt)
Definition SelectMachine.cpp:2279
wxStaticBitmap * img_ams_backup
Definition SelectMachine.hpp:443
std::vector< POItem > ops_auto
Definition SelectMachine.hpp:369
wxPanel * m_line_top
Definition SelectMachine.hpp:406
wxBoxSizer * m_filament_panel_sizer
Definition SelectMachine.hpp:455
HyperLink * m_link_network_state
Definition SelectMachine.hpp:412
wxBoxSizer * m_sizer_filament_2extruder
Definition SelectMachine.hpp:458
wxStaticText * m_rename_text
Definition SelectMachine.hpp:415
wxGridSizer * m_sizer_options
Definition SelectMachine.hpp:380
void popup_filament_backup()
Definition SelectMachine.cpp:1019
wxBoxSizer * m_warn_when_drying_sizer
Definition SelectMachine.hpp:389
Label * m_st_txt_error_code
Definition SelectMachine.hpp:408
void on_ok_btn(wxCommandEvent &event)
Definition SelectMachine.cpp:2738
PopupWindow * m_timelapse_storage_popup
Definition SelectMachine.hpp:361
wxStaticBitmap * m_bitmap_last_plate
Definition SelectMachine.hpp:393
PrinterMsgPanel * m_statictext_ams_msg
Definition SelectMachine.hpp:419
bool m_is_in_sending_mode
Definition SelectMachine.hpp:319
ThumbnailPanel * m_thumbnailPanel
Definition SelectMachine.hpp:396
wxMouseEvent
Definition CameraPopup.cpp:47
static Plater * plater()
Definition GUI_Factories.cpp:400
@ Plater
Definition Shortcuts.hpp:21
@ BED_TYPE_COUNT
Definition ProjectTask.hpp:28
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References _L, Slic3r::BED_TYPE_COUNT, Label::Body_12, Label::Body_13, Choice, Confirm, create_scaled_bitmap(), Slic3r::GUI::DPIDialog::EndModal(), Label::Head_13, Label::Head_14, img_ams_backup, init_bind(), init_machine_bed_types(), init_timer(), m_ams_backup_tip, m_basic_panel, m_basicl_sizer, m_bedtype_list, m_bitmap_last_plate, m_bitmap_next_plate, m_button_ensure, m_change_filament_times_sizer, m_check_ext_change_assist, m_checkbox_list, m_checkbox_list_order, m_colour_def_color, m_current_project_name, m_export_3mf_cancel, m_filament_left_panel, m_filament_panel, m_filament_panel_left_sizer, m_filament_panel_right_sizer, m_filament_panel_sizer, m_filament_right_panel, m_is_in_sending_mode, m_label_ext_change_assist, m_line_top, m_link_edit_nozzle, m_link_network_state, m_mapping_popup, m_mapping_sugs_sizer, m_mapping_tip_popup, m_mapping_tutorial_popup, m_options_other, m_panel_finish, m_panel_prepare, m_panel_sending, m_plater, m_printer_box, m_rename_button, m_rename_input, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, m_saveTimeText, m_scroll_area, m_simplebook, m_sizer_ams_mapping, m_sizer_ams_mapping_left, m_sizer_ams_mapping_right, m_sizer_autorefill, m_sizer_filament_2extruder, m_sizer_options, m_sizer_thumbnail, m_st_txt_error_code, m_st_txt_error_desc, m_st_txt_extra_info, m_statictext_ams_msg, m_statictext_finish, m_status_bar, m_stext_time, m_stext_weight, m_sw_print_failed_info, m_text_printer_msg, m_text_printer_msg_tips, m_thumbnailPanel, m_timelapse_check_timer, m_timelapse_folder_btn, m_timelapse_storage_popup, m_txt_change_filament_times, m_txt_warn_when_drying, m_warn_when_drying_sizer, m_worker, MACHINE_BED_TYPE_STRING, Slic3r::GUI::DPIAware< wxDialog >::normal_font(), on_cancel(), on_flow_cali_option_changed(), on_ok_btn(), on_pa_value_option_changed(), on_rename_click(), on_rename_enter(), on_reselect_dialog_btn_clicked(), ops_auto, ops_no_auto, Slic3r::GUI::plater(), popup_filament_backup(), print_time, print_weight, rename_editable, rename_editable_light, rename_sizer_h, rename_sizer_v, save_option_vals(), SELECT_MACHINE_DIALOG_SIMBOOK_SIZE2, show_print_failed_info(), show_timelapse_folder_popup(), timeimg, update_best_pos_dialog(), update_timelapse_folder_btn_icon(), weightimg, Slic3r::GUI::wxMouseEvent, and wxStaticText.

Here is the call graph for this function:

◆ ~SelectMachineDialog()

Slic3r::GUI::SelectMachineDialog::~SelectMachineDialog ( )
6447{
6448 delete m_refresh_timer;
6452}
wxTimer * m_refresh_timer
Definition SelectMachine.hpp:433

References m_refresh_timer, and m_timelapse_check_timer.

Member Function Documentation

◆ adjust_color_for_render()

wxColour Slic3r::GUI::SelectMachineDialog::adjust_color_for_render ( const wxColour & color)
5926{
5927 ColorRGBA _temp_color_color(color.Red() / 255.0f, color.Green() / 255.0f, color.Blue() / 255.0f, color.Alpha() / 255.0f);
5928 auto _temp_color_color_ = adjust_color_for_rendering(_temp_color_color);
5929 wxColour render_color((int) (_temp_color_color_[0] * 255.0f), (int) (_temp_color_color_[1] * 255.0f), (int) (_temp_color_color_[2] * 255.0f),
5930 (int) (_temp_color_color_[3] * 255.0f));
5931 return render_color;
5932}
Slic3r::ColorRGBA adjust_color_for_rendering(const Slic3r::ColorRGBA &colors)
Definition 3DScene.cpp:112

References adjust_color_for_rendering().

Referenced by change_default_normal(), and record_edge_pixels_data().

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

◆ auto_supply_with_ext()

void Slic3r::GUI::SelectMachineDialog::auto_supply_with_ext ( std::vector< DevAmsTray > slots)
1537 {
1538 if (slots.size() <= 0) return;
1539
1540 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1541 auto it = m_ams_mapping_result[i];
1542 if (it.ams_id == "") {
1543 DevAmsTray slot("");
1544 if (m_filaments_map[it.id] == 1 && slots.size() > 1) slot = slots[1];
1545 else if (m_filaments_map[it.id] == 2) slot = slots[0];
1546 if (slot.id.empty()) continue;
1547 m_ams_mapping_result[i].ams_id = slot.id;
1548 m_ams_mapping_result[i].color = slot.color;
1549 m_ams_mapping_result[i].type = slot.m_fila_type;
1550 m_ams_mapping_result[i].colors = slot.cols;
1551 m_ams_mapping_result[i].tray_id = atoi(slot.id.c_str());
1552 m_ams_mapping_result[i].slot_id = "0";
1553 }
1554 }
1555}
std::vector< int > m_filaments_map
Definition SelectMachine.hpp:348
std::vector< FilamentInfo > m_ams_mapping_result
Definition SelectMachine.hpp:346

References Slic3r::DevAmsTray::color, Slic3r::DevAmsTray::cols, Slic3r::DevAmsTray::id, m_ams_mapping_result, Slic3r::DevAmsTray::m_fila_type, and m_filaments_map.

◆ build_nozzles_info()

bool Slic3r::GUI::SelectMachineDialog::build_nozzles_info ( std::string & nozzles_info)
1460{
1461 /* init nozzles info */
1462 json nozzle_info_json = json::array();
1463 nozzles_info = nozzle_info_json.dump();
1464
1465 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
1466 if (!preset_bundle)
1467 return false;
1468 auto opt_nozzle_diameters = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionFloats>("nozzle_diameter");
1469 if (opt_nozzle_diameters == nullptr) {
1470 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, opt_nozzle_diameters is nullptr";
1471 return false;
1472 }
1473 auto opt_nozzle_volume_type = preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
1474 if (opt_nozzle_volume_type == nullptr) {
1475 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, opt_nozzle_volume_type is nullptr";
1476 return false;
1477 }
1478 json nozzle_item;
1479 /* only o1d two nozzles has build_nozzles info now */
1480 if (opt_nozzle_diameters->size() != 2) {
1481 return false;
1482 }
1483 for (size_t i = 0; i < opt_nozzle_diameters->size(); i++) {
1484 if (i == (size_t)ConfigNozzleIdx::NOZZLE_LEFT) {
1485 nozzle_item["id"] = CloudTaskNozzleId::NOZZLE_LEFT;
1486 }
1487 else if (i == (size_t)ConfigNozzleIdx::NOZZLE_RIGHT) {
1488 nozzle_item["id"] = CloudTaskNozzleId::NOZZLE_RIGHT;
1489 }
1490 else {
1491 /* unknown ConfigNozzleIdx */
1492 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, unknown ConfigNozzleIdx = " << i;
1493 assert(false);
1494 continue;
1495 }
1496 nozzle_item["type"] = nullptr;
1497 if (i >= 0 && i < opt_nozzle_volume_type->size()) {
1498 nozzle_item["flowSize"] = get_nozzle_volume_type_cloud_string((NozzleVolumeType)opt_nozzle_volume_type->get_at(i));
1499 }
1500 if (i >= 0 && i < opt_nozzle_diameters->size()) {
1501 nozzle_item["diameter"] = opt_nozzle_diameters->get_at(i);
1502 }
1503 nozzle_info_json.push_back(nozzle_item);
1504 }
1505 nozzles_info = nozzle_info_json.dump();
1506 return true;
1507}
@ NOZZLE_LEFT
Definition SelectMachine.hpp:117
@ NOZZLE_RIGHT
Definition SelectMachine.hpp:118
std::string get_nozzle_volume_type_cloud_string(NozzleVolumeType nozzle_volume_type)
Definition SelectMachine.cpp:157
@ NOZZLE_LEFT
Definition SelectMachine.hpp:106
@ NOZZLE_RIGHT
Definition SelectMachine.hpp:105
NozzleVolumeType
Definition PrintConfig.hpp:618
ConfigOptionEnumsGenericTempl< false > ConfigOptionEnumsGeneric
Definition Config.hpp:2311
nlohmann::json json
Definition AssembleList.cpp:42
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015

References Slic3r::Preset::config, Slic3r::PresetCollection::get_edited_preset(), Slic3r::GUI::get_nozzle_volume_type_cloud_string(), Slic3r::GUI::NOZZLE_LEFT, Slic3r::GUI::NOZZLE_RIGHT, Slic3r::ConfigBase::option(), Slic3r::PresetBundle::printers, and Slic3r::PresetBundle::project_config.

Referenced by on_send_print().

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

◆ can_hybrid_mapping()

bool Slic3r::GUI::SelectMachineDialog::can_hybrid_mapping ( MachineObject * obj_) const
1509 {
1510 return obj_ && obj_->GetFilaSwitch()->IsInstalled();
1511}

References Slic3r::MachineObject::GetFilaSwitch(), and Slic3r::DevFilaSwitch::IsInstalled().

Referenced by get_filament_mapping_show_type().

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

◆ can_support_pa_auto_cali()

bool Slic3r::GUI::SelectMachineDialog::can_support_pa_auto_cali ( )
5339{
5340 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
5341 if (!dev)
5342 return true;
5343 MachineObject *obj = dev->get_selected_machine();
5344 if (!obj)
5345 return true;
5346
5347 std::vector<std::string> unsupport_auto_cali_filaments = DevPrinterConfigUtil::get_unsupport_auto_cali_filaments(obj->printer_type);
5348 if (!unsupport_auto_cali_filaments.empty()) {
5349 auto* agent = wxGetApp().getAgent();
5350 auto iter = std::find_if(m_filaments.begin(), m_filaments.end(),
5351 [&unsupport_auto_cali_filaments, agent](const FilamentInfo &item) {
5352 // item.filament_id is our OF id; the printer config list holds the printer's own.
5353 const std::string printer_filament_id = agent ? agent->from_orca_filament_id(item.filament_id) : item.filament_id;
5354 auto iter = std::find(unsupport_auto_cali_filaments.begin(), unsupport_auto_cali_filaments.end(), printer_filament_id);
5355 return iter != unsupport_auto_cali_filaments.end();
5356 });
5357
5358 return iter == m_filaments.end();
5359 }
5360 return true;
5361}
static std::vector< std::string > get_unsupport_auto_cali_filaments(std::string type_str)
Definition DevConfigUtil.h:118
std::vector< FilamentInfo > m_filaments
Definition SelectMachine.hpp:345

References Slic3r::DeviceManager::get_selected_machine(), Slic3r::DevPrinterConfigUtil::get_unsupport_auto_cali_filaments(), m_filaments, and Slic3r::MachineObject::printer_type.

Referenced by update_option_opts(), and update_show_status().

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

◆ change_default_normal()

void Slic3r::GUI::SelectMachineDialog::change_default_normal ( int old_filament_id,
wxColour temp_ams_color )
6034{
6035 if (m_cur_colors_in_thumbnail.size() == 0) {
6036 BOOST_LOG_TRIVIAL(error) << "SelectMachineDialog::change_default_normal:error:m_cur_colors_in_thumbnail.size() == 0";
6037 return;
6038 }
6039 if (old_filament_id >= 0) {
6040 if (old_filament_id < m_cur_colors_in_thumbnail.size()) {
6041 m_cur_colors_in_thumbnail[old_filament_id] = temp_ams_color;
6042 }
6043 else {
6044 BOOST_LOG_TRIVIAL(error) << "SelectMachineDialog::change_default_normal:error:old_filament_id > m_cur_colors_in_thumbnail.size()";
6045 return;
6046 }
6047 }
6048 // Recompute mixed slot colors after physical slot color change
6049 const auto& cfg = wxGetApp().preset_bundle->project_config;
6051
6052 ThumbnailData& data = m_cur_input_thumbnail_data;
6053 ThumbnailData& no_light_data = m_cur_no_light_thumbnail_data;
6054 if (data.width > 0 && data.height > 0 && data.width == no_light_data.width && data.height == no_light_data.height) {
6055 for (unsigned int r = 0; r < data.height; ++r) {
6056 unsigned int rr = (data.height - 1 - r) * data.width;
6057 for (unsigned int c = 0; c < data.width; ++c) {
6058 unsigned char *no_light_px = (unsigned char *) no_light_data.pixels.data() + 4 * (rr + c);
6059 unsigned char *origin_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
6060 unsigned char *new_px = (unsigned char *) m_preview_thumbnail_data.pixels.data() + 4 * (rr + c);
6061 if (origin_px[3] > 0 && m_edge_pixels[r * data.width + c] == false) {
6062 auto filament_id = 255 - no_light_px[3];
6063 if (filament_id >= m_cur_colors_in_thumbnail.size()) {
6064 continue;
6065 }
6066 wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id];
6067 wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop);
6068 //change color
6069 new_px[3] = ams_color.Alpha(); //origin_px[3]; // alpha
6070 int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2];
6071 int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2];
6072 unsigned char i = 0;
6073 if (origin_rgb >= no_light_px_rgb) {//Brighten up
6074 unsigned char cur_single_color = ams_color.Red();
6075 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
6076 i++;
6077 cur_single_color = ams_color.Green();
6078 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
6079 i++;
6080 cur_single_color = ams_color.Blue();
6081 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
6082 } else {//Dimming
6083 float ratio = origin_rgb / (float) no_light_px_rgb;
6084 unsigned char cur_single_color = ams_color.Red();
6085 new_px[i] = std::clamp((int)(cur_single_color * ratio), 0, 255);
6086 i++;
6087 cur_single_color = ams_color.Green();
6088 new_px[i] = std::clamp((int) (cur_single_color * ratio), 0, 255);
6089 i++;
6090 cur_single_color = ams_color.Blue();
6091 new_px[i] = std::clamp((int) (cur_single_color * ratio), 0, 255);
6092 }
6093 }
6094 }
6095 }
6096 }
6097 else {
6098 BOOST_LOG_TRIVIAL(error) << "SelectMachineDialog::change_defa:no_light_data is empty,error";
6099 }
6100}
ThumbnailData m_preview_thumbnail_data
Definition SelectMachine.hpp:446
std::vector< wxColour > m_cur_colors_in_thumbnail
Definition SelectMachine.hpp:448
ThumbnailData m_cur_input_thumbnail_data
Definition SelectMachine.hpp:444
ThumbnailData m_cur_no_light_thumbnail_data
Definition SelectMachine.hpp:445
wxColour adjust_color_for_render(const wxColour &color)
Definition SelectMachine.cpp:5925
std::vector< bool > m_edge_pixels
Definition SelectMachine.hpp:449
void recompute_mixed_slot_colors(std::vector< wxColour > &colors, const Slic3r::DynamicPrintConfig &cfg)
Definition FilamentBitmapUtils.cpp:432

References adjust_color_for_render(), Slic3r::ThumbnailData::height, m_cur_colors_in_thumbnail, m_cur_input_thumbnail_data, m_cur_no_light_thumbnail_data, m_edge_pixels, m_preview_thumbnail_data, Slic3r::ThumbnailData::pixels, Slic3r::GUI::recompute_mixed_slot_colors(), and Slic3r::ThumbnailData::width.

Referenced by on_set_finish_mapping(), and unify_deal_thumbnail_data().

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

◆ change_materialitem_tip()

void Slic3r::GUI::SelectMachineDialog::change_materialitem_tip ( bool no_ams_only_ext)
5510{
5511 MaterialHash::iterator iter = m_materialList.begin();
5512 while (iter != m_materialList.end()) {
5513 int id = iter->first;
5514 Material *item = iter->second;
5515 if (item) {
5516 if (no_ams_only_ext && item->item->m_ams_name == _L("Ext")) {
5517 item->item->SetToolTip(wxEmptyString);
5518 }
5519 else {
5520 wxString tip_text;
5521 if (item->item->m_match) {
5522 tip_text = _L("Upper half area: Original\nLower half area: Filament in AMS\nAnd you can click it to modify");
5523 } else {
5524 tip_text = _L("Unable to automatically match to suitable filament. Please click to manually match.");
5525 }
5526
5527 if (item->item->GetToolTipText() != tip_text) {
5528 item->item->SetToolTip(tip_text);
5529 }
5530 }
5531 }
5532 iter++;
5533 }
5534}
MaterialHash m_materialList
Definition SelectMachine.hpp:377

References _L, Slic3r::GUI::Material::item, Slic3r::GUI::MaterialItem::m_ams_name, Slic3r::GUI::MaterialItem::m_match, and m_materialList.

Referenced by on_timer(), and update_ams_check().

Here is the caller graph for this function:

◆ check_fcous_state()

void Slic3r::GUI::SelectMachineDialog::check_fcous_state ( wxWindow * window)
1011{
1012 if (window == m_rename_input || window == m_rename_input->GetTextCtrl()) { on_rename_enter(); }
1013 auto children = window->GetChildren();
1014 for (auto child : children) {
1015 check_fcous_state(child);
1016 }
1017}
void check_fcous_state(wxWindow *window)
Definition SelectMachine.cpp:1010

References check_fcous_state(), m_rename_input, and on_rename_enter().

Referenced by check_fcous_state(), and init_bind().

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

◆ check_sdcard_for_timelpase()

bool Slic3r::GUI::SelectMachineDialog::check_sdcard_for_timelpase ( MachineObject * obj)
1995{
1996 if (!obj) return false;
1997
1998 // must set to a status if return true
1999 if (m_checkbox_list["timelapse"]->IsShown() && m_checkbox_list["timelapse"]->getValue() == "on")
2000 {
2001 if (obj->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD && !obj->m_has_timelapse_kit && !obj->is_support_internal_timelapse) {
2003 return true;
2004 }
2005 }
2006
2007 return false;
2008}
@ NO_SDCARD
Definition DevStorage.h:18
void show_status(PrintDialogStatus status, std::vector< wxString > params=std::vector< wxString >(), wxString wiki_url=wxEmptyString)
Definition SelectMachine.cpp:2303
@ PrintStatusTimelapseNoSdcard
Definition PrePrintChecker.hpp:108

References Slic3r::DevStorage::get_sdcard_state(), Slic3r::MachineObject::GetStorage(), Slic3r::MachineObject::is_support_internal_timelapse, m_checkbox_list, Slic3r::MachineObject::m_has_timelapse_kit, Slic3r::DevStorage::NO_SDCARD, Slic3r::GUI::PrintStatusTimelapseNoSdcard, and show_status().

Referenced by update_show_status().

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

◆ check_timelapse_storage_warning()

void Slic3r::GUI::SelectMachineDialog::check_timelapse_storage_warning ( MachineObject * obj)
private
3359{
3360 if (!obj || !obj->is_support_internal_timelapse) return;
3361 if (!m_checkbox_list["timelapse"]->IsShown()) return;
3362 if (m_checkbox_list["timelapse"]->getValue() != "on") return;
3363 if (m_timelapse_storage.empty()) return;
3364
3365 if (obj->is_timelapse_storage_low(m_timelapse_storage)) {
3366 wxString storage_name = (m_timelapse_storage == "internal") ? _L("Internal") : _L("External");
3367 wxString msg = wxString::Format(
3368 _L("%s space less than 20MB. Timelapse may not save properly. You can turn it off or"),
3369 storage_name);
3370 // show_status sets button state; then directly add with link callback
3372 m_pre_print_checker.add_with_link(
3374 msg,
3375 _L("Clean up files"),
3376 [this]() { navigate_to_timelapse_page(); });
3377 }
3378}
void navigate_to_timelapse_page()
Definition SelectMachine.cpp:3546
PrePrintChecker m_pre_print_checker
Definition SelectMachine.hpp:464
std::string m_timelapse_storage
Definition SelectMachine.hpp:359
@ PrintStatusTimelapseStorageLow
Definition PrePrintChecker.hpp:110

References _L, Slic3r::MachineObject::is_support_internal_timelapse, Slic3r::MachineObject::is_timelapse_storage_low(), m_checkbox_list, m_pre_print_checker, m_timelapse_storage, navigate_to_timelapse_page(), Slic3r::GUI::PrintStatusTimelapseStorageLow, and show_status().

Referenced by show_timelapse_folder_popup(), and update_show_status().

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

◆ CheckErrorDynamicSwitchNozzle()

bool Slic3r::GUI::SelectMachineDialog::CheckErrorDynamicSwitchNozzle ( MachineObject * obj_)
1703{
1704 if (!obj_)
1705 return false;
1706
1707 // Advisory only (does not block Send): the file was sliced for a switch state that doesn't
1708 // match the installed hardware, so grouping/flush may be suboptimal. Only on firmware that
1709 // reports it can check this.
1710 if (obj_->is_support_check_track_switch_match_slice_printer && slicing_with_fila_switch() != obj_->GetFilaSwitch()->IsInstalled()) {
1712 {_L("The Filament Track Switch installed on the printer does not match the slicing file. Please re-slice to avoid print quality issues.")});
1713 }
1714
1715 // The blocking checks below only matter for dynamic nozzle mapping, which requires a switch.
1717 return true;
1718
1719 if (!obj_->GetFilaSwitch()->IsInstalled()) {
1720 show_status(PrintDialogStatus::PrintStatusFilaSwitcherError, {_L("This print requires a Filament Track Switch. Please install it first.")});
1721 return false;
1722 }
1723
1724 if (!obj_->GetFilaSwitch()->IsReady()) {
1725 show_status(PrintDialogStatus::PrintStatusFilaSwitcherError, {_L("The Filament Track Switch has not been setup. Please setup it first.")});
1726 return false;
1727 }
1728
1729 return true;
1730}
bool slicing_with_fila_switch() const
Definition SelectMachine.cpp:1680
bool use_dynamic_nozzle_map() const
Definition SelectMachine.cpp:1661
@ PrintStatusFilaSwitcherSlicingNotMatch
Definition PrePrintChecker.hpp:114
@ PrintStatusFilaSwitcherError
Definition PrePrintChecker.hpp:87

References _L, Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::is_support_check_track_switch_match_slice_printer, Slic3r::DevFilaSwitch::IsInstalled(), Slic3r::DevFilaSwitch::IsReady(), Slic3r::GUI::PrintStatusFilaSwitcherError, Slic3r::GUI::PrintStatusFilaSwitcherSlicingNotMatch, show_status(), slicing_with_fila_switch(), and use_dynamic_nozzle_map().

Referenced by update_show_status().

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

◆ CheckErrorExtruderNozzleWithSlicing()

bool Slic3r::GUI::SelectMachineDialog::CheckErrorExtruderNozzleWithSlicing ( MachineObject * obj_)
4599{
4600 if (!obj_) {
4601 return false;
4602 }
4603
4604 const auto& ext_sys = obj_->GetExtderSystem();
4605 const auto& nozzle_sys = obj_->GetNozzleSystem();
4606 if (m_print_type == FROM_NORMAL) {
4607 const auto& slicing_ext_nozzles = s_get_slicing_extuder_nozzles();
4608 for (auto slicing_ext_nozzle : slicing_ext_nozzles) {
4609 int slicing_ext_idx = slicing_ext_nozzle.first;
4610 auto slicing_ext = slicing_ext_nozzle.second;
4611 auto installed_ext_nozzle = nozzle_sys->GetExtNozzle(slicing_ext_idx);
4612
4613 // No need to check the right extruder's mounted nozzle when using a nozzle rack: the
4614 // extruder swaps nozzles during the print, so the inventory (mounted + rack) must hold
4615 // a matching nozzle instead.
4616 if (slicing_ext_idx == MAIN_EXTRUDER_ID && nozzle_sys->GetNozzleRack()->IsSupported()) {
4617 if (nozzle_sys->CollectNozzles(MAIN_EXTRUDER_ID, slicing_ext.nozzle_flow_type, slicing_ext.nozzle_diameter).empty()) {
4618 wxString slicing_nozzle_str = DevNozzle::GetNozzleFlowTypeStr(slicing_ext.nozzle_flow_type);
4619 if (slicing_ext.nozzle_diameter > 0.0f)
4620 slicing_nozzle_str += wxString::Format(" %.1fmm", slicing_ext.nozzle_diameter);
4621 wxString msg = wxString::Format(_L("The printer has no nozzle matching the slicing file (%s)."), slicing_nozzle_str);
4622 msg += " ";
4623 if (nozzle_sys->GetNozzleRack()->GetCaliStatus() != DevNozzleRack::Rack_CALI_OK)
4624 msg += _L("Please complete the hotend rack setup and try again.");
4625 else if (nozzle_sys->HasUnknownNozzles() || nozzle_sys->HasUnreliableNozzles())
4626 msg += _L("Please refresh the nozzle information and try again.");
4627 else
4628 msg += _L("Please install a matching nozzle in the hotend rack, or set the corresponding printer preset while slicing.");
4629
4631 return false;
4632 }
4633
4634 // A nozzle swap needs a free rack slot to stow the mounted nozzle first.
4635 if (nozzle_sys->IsRackMaximumInstalled()) {
4637 { _L("The toolhead and hotend rack are full. Please remove at least one hotend before printing.") });
4638 return false;
4639 }
4640
4641 continue;
4642 }
4643
4644 // check nozzle data valid
4645 {
4646 // Commented out the following as ntUndefine and 0.0f are default values
4647 // (signifying that the value is not given) that should PASS, not fail
4648 // if (installed_ext_nozzle.GetNozzleType() == NozzleType::ntUndefine ||
4649 // installed_ext_nozzle.GetNozzleDiameter() <= 0.0f) {
4650 // show_status(PrintDialogStatus::PrintStatusNozzleDataInvalid);
4651 // return false;
4652 // }
4653
4654 if (obj_->is_nozzle_flow_type_supported() &&
4655 installed_ext_nozzle.GetNozzleFlowType() == NozzleFlowType::NONE_FLOWTYPE) {
4657 return false;
4658 }
4659 }
4660
4661 // check nozzle flow type
4662 {
4663 if (obj_->is_nozzle_flow_type_supported() && slicing_ext.nozzle_flow_type != installed_ext_nozzle.GetNozzleFlowType()) {
4664 const wxString& pos = _get_nozzle_name(ext_sys->GetTotalExtderCount(), slicing_ext_idx);
4665 const wxString& installed_nozzle_str = installed_ext_nozzle.GetNozzleFlowTypeStr();
4666 const wxString& slicing_nozzle_str = DevNozzle::GetNozzleFlowTypeStr(slicing_ext.nozzle_flow_type);
4667 wxString error_message = wxString::Format(_L("The nozzle flow setting of %s(%s) doesn't match with the slicing file(%s). "
4668 "Please make sure the nozzle installed matches with settings in printer, "
4669 "then set the corresponding printer preset while slicing."),
4670 pos, installed_nozzle_str, slicing_nozzle_str);
4671
4672 std::vector<wxString> params{ error_message };
4673 params.emplace_back(_L("Tips: If you changed your nozzle of your printer lately, please go to 'Device -> Printer parts' to change your nozzle setting."));
4675 return false;
4676 }
4677 }
4678
4679 // check nozzle diameter
4680 {
4681 // 0.0f is default when there is no nozzle diameter is given.
4682 // In nozzle_diameter == 0.0f case, it passes and does not require a comparison
4683 if (installed_ext_nozzle.GetNozzleDiameter() > 0.0f &&
4684 slicing_ext.nozzle_diameter != installed_ext_nozzle.GetNozzleDiameter()) {
4685 std::vector<wxString> msg_params;
4686 if (ext_sys->GetTotalExtderCount() == 2) {
4687 const wxString& mismatch_nozzle_str = _get_nozzle_name(ext_sys->GetTotalExtderCount(), slicing_ext_idx);
4688 const wxString& nozzle_message = wxString::Format(_L("The %s diameter(%.1fmm) of current printer doesn't match with the slicing file (%.1fmm). "
4689 "Please make sure the nozzle installed matches with settings in printer, then set the "
4690 "corresponding printer preset when slicing."),
4691 mismatch_nozzle_str, installed_ext_nozzle.GetNozzleDiameter(), slicing_ext.nozzle_diameter);
4692 msg_params.emplace_back(nozzle_message);
4693 } else {
4694 const wxString& nozzle_message = wxString::Format(_L("The current nozzle diameter (%.1fmm) doesn't match with the slicing file (%.1fmm). "
4695 "Please make sure the nozzle installed matches with settings in printer, then set the "
4696 "corresponding printer preset when slicing."),
4697 installed_ext_nozzle.GetNozzleDiameter(), slicing_ext.nozzle_diameter);
4698 msg_params.emplace_back(nozzle_message);
4699 }
4700
4701 msg_params.emplace_back(_L("Tips: If you changed your nozzle of your printer lately, please go to 'Device -> Printer parts' to change your nozzle setting."));
4702
4703 // Orca: non-blocking. A diameter that differs from the one the printer
4704 // remembers is legitimate with a non-standard nozzle, so the print is held back
4705 // only by the acknowledgement checkbox shown in the message board, not by a
4706 // disabled Send outright. Keep checking the remaining extruders.
4707 m_nozzle_diameter_mismatch_msg = msg_params.front();
4709 continue;
4710 }
4711 }
4712 }
4713 }
4714
4715 return true;
4716}
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101
@ Rack_CALI_OK
Definition DevNozzleRack.h:55
PrintFromType m_print_type
Definition SelectMachine.hpp:373
wxString m_nozzle_diameter_mismatch_msg
Definition SelectMachine.hpp:574
static std::unordered_multimap< int, NozzleDef > s_get_slicing_extuder_nozzles()
Definition SelectMachine.cpp:4414
@ PrintStatusNozzleMatchInvalid
Definition PrePrintChecker.hpp:69
@ PrintStatusNozzleDataInvalid
Definition PrePrintChecker.hpp:70
@ PrintStatusNozzleRackMaximumInstalled
Definition PrePrintChecker.hpp:73
@ PrintStatusNozzleNoMatchedHotends
Definition PrePrintChecker.hpp:72
@ PrintStatusNozzleDiameterMismatch
Definition PrePrintChecker.hpp:119
static wxString _get_nozzle_name(int total_ext_count, int ext_id)
Definition SelectMachine.cpp:4397
@ FROM_NORMAL
Definition DevDefs.h:173
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
@ NONE_FLOWTYPE
Definition DevDefs.h:117
wxString GetNozzleFlowTypeStr() const
Definition DevNozzleSystem.h:72

References Slic3r::GUI::_get_nozzle_name(), _L, Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevNozzle::GetNozzleFlowTypeStr(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::MachineObject::is_nozzle_flow_type_supported(), m_nozzle_diameter_mismatch_msg, m_print_type, MAIN_EXTRUDER_ID, Slic3r::NONE_FLOWTYPE, Slic3r::GUI::PrintStatusNozzleDataInvalid, Slic3r::GUI::PrintStatusNozzleDiameterMismatch, Slic3r::GUI::PrintStatusNozzleMatchInvalid, Slic3r::GUI::PrintStatusNozzleNoMatchedHotends, Slic3r::GUI::PrintStatusNozzleRackMaximumInstalled, Slic3r::DevNozzleRack::Rack_CALI_OK, Slic3r::GUI::s_get_slicing_extuder_nozzles(), and show_status().

Referenced by update_show_status().

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

◆ CheckErrorRackStatus()

bool Slic3r::GUI::SelectMachineDialog::CheckErrorRackStatus ( MachineObject * obj_)
4503{
4504 if (!obj_) {
4505 return true;
4506 }
4507
4508 auto rack = obj_->GetNozzleSystem()->GetNozzleRack();
4509 if (!rack->IsSupported()) {
4510 return true;
4511 }
4512
4513 if (rack->GetReadingCount() > 0) {
4514 const wxString& msg = wxString::Format(_L("Refreshing information of hotends(%d/%d)."), rack->GetReadingIdx(), rack->GetReadingCount());
4515 show_status(PrintDialogStatus::PrintStatusRackReading, { msg + " " + _L("Please wait a moment...") });
4516 return false;
4517 }
4518
4519 return true;
4520}
@ PrintStatusRackReading
Definition PrePrintChecker.hpp:86

References _L, Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::GUI::PrintStatusRackReading, and show_status().

Referenced by update_show_status().

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

◆ CheckErrorSyncNozzleMappingResultV0()

bool Slic3r::GUI::SelectMachineDialog::CheckErrorSyncNozzleMappingResultV0 ( MachineObject * obj_)
1857{
1858 if (!obj_)
1859 return true;
1860
1861 if (!(obj_->GetNozzleSystem() && obj_->GetNozzleSystem()->GetNozzleRack()->IsSupported()))
1862 return true; // no need to check if the printer has no nozzle rack
1863
1865 return true; // there is no slicing data when printing from sdcard
1866
1868 return true; // handled by the V1 path
1869
1870 auto nozzle_group_res = DevUtilBackend::GetNozzleGroupResult(m_plater);
1871 if (nozzle_group_res && nozzle_group_res->get_used_nozzles_in_extruder(LOGIC_R_EXTRUDER_ID).empty())
1872 return true; // no right-extruder nozzles used in slicing -> nothing to map
1873
1874 const auto& obj_nozzle_mapping_ptr = obj_->get_nozzle_mapping_result();
1875 if (!obj_nozzle_mapping_ptr->HasResult()) {
1876 if (time(nullptr) - s_nozzle_mapping_last_request_time > 10) { // avoid too many requests
1877 // Orca: PA-profile-sharing value from the send-dialog toggle (On = share -> 0, Off -> 1).
1878 // Only pa_mode-capable printers honor the toggle; others keep the prior default (1) so this
1879 // feature changes nothing for them (matches the print-command gate in on_send_print).
1880 const int pa_value = obj_->is_support_pa_mode ? ((m_checkbox_list["pa_value"]->getValue() == "on") ? 0 : 1) : 1;
1881 int rtn = obj_nozzle_mapping_ptr->CtrlGetAutoNozzleMappingV0(m_plater, m_ams_mapping_result, m_checkbox_list["flow_cali"]->getValueInt(), pa_value);
1882 if (rtn == 0) {
1883 s_nozzle_mapping_last_request_time = time(nullptr);
1884 } else {
1885 const auto& err_msg = wxString::Format(_L("Failed to send nozzle auto-mapping request to printer { code: %d }. "
1886 "Please try to refresh the printer information. "
1887 "If it still does not recover, you can try to rebind the printer and check the network connection."), rtn);
1889 return false;
1890 }
1891 }
1892
1893 show_status(PrintDialogStatus::PrintStatusRackNozzleMappingWaiting, {_L("The printer is calculating nozzle mapping.") + " " + _L("Please wait a moment...")});
1894 return false;
1895 }
1896
1897 if (obj_nozzle_mapping_ptr->GetResultStr() == "failed") {
1898 const auto& err_msg = wxString::Format(_L("Failed to receive nozzle auto-mapping table from printer { msg: %s }. Please refresh the printer information."), obj_nozzle_mapping_ptr->GetMqttReason());
1900 return false;
1901 }
1902
1903 if (obj_nozzle_mapping_ptr->GetResultStr() == "fail") {
1904 const wxString& err_msg = wxString::Format(_L("The printer failed to build the nozzle auto-mapping table { code: %d }. Please refresh nozzle information."), obj_nozzle_mapping_ptr->GetErrno());
1906 return false;
1907 }
1908
1909 const auto& mapping_map = obj_->get_nozzle_mapping_result()->GetNozzleMappingMap();
1910 if (!mapping_map.empty()) {
1911 if (m_nozzle_mapping_result != mapping_map) {
1912 m_nozzle_mapping_result = mapping_map;
1914 }
1915
1916 float flush_waste_base = obj_->get_nozzle_mapping_result()->GetFlushWeightBase();
1917 float flush_waste_current = obj_->get_nozzle_mapping_result()->GetFlushWeightCurrent();
1918 if ((flush_waste_base != -1) && (flush_waste_current != -1) && flush_waste_current > flush_waste_base) {
1919 const wxString& warning_msg = wxString::Format(_L("The current nozzle mapping may produce an extra %0.2f g of waste."), flush_waste_current - flush_waste_base);
1921 }
1922 return true;
1923 }
1924
1925 const wxString& err_msg = wxString::Format(_L("Failed to receive nozzle auto-mapping table from printer { msg: %s }. Please refresh the printer information."), "empty table");
1927 return true;
1928}
#define LOGIC_R_EXTRUDER_ID
Definition DevDefs.h:109
static std::shared_ptr< MultiNozzleUtils::NozzleGroupResultBase > GetNozzleGroupResult(Slic3r::GUI::Plater *plater)
Definition DevUtilBackend.cpp:41
std::unordered_map< int, int > m_nozzle_mapping_result
Definition SelectMachine.hpp:347
void sync_ams_mapping_result(std::vector< FilamentInfo > &result)
Definition SelectMachine.cpp:1116
static int s_nozzle_mapping_last_request_time
Definition SelectMachine.cpp:182
@ PrintStatusRackNozzleMappingError
Definition PrePrintChecker.hpp:85
@ PrintStatusRackNozzleMappingWaiting
Definition PrePrintChecker.hpp:84
@ PrintStatusRackNozzleMappingWarning
Definition PrePrintChecker.hpp:113

References _L, Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::get_nozzle_mapping_result(), Slic3r::DevUtilBackend::GetNozzleGroupResult(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::MachineObject::is_support_pa_mode, LOGIC_R_EXTRUDER_ID, m_ams_mapping_result, m_checkbox_list, m_nozzle_mapping_result, m_plater, m_print_type, Slic3r::GUI::PrintStatusRackNozzleMappingError, Slic3r::GUI::PrintStatusRackNozzleMappingWaiting, Slic3r::GUI::PrintStatusRackNozzleMappingWarning, Slic3r::GUI::s_nozzle_mapping_last_request_time, show_status(), sync_ams_mapping_result(), and use_dynamic_nozzle_map().

Referenced by update_show_status().

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

◆ CheckErrorSyncNozzleMappingResultV1()

bool Slic3r::GUI::SelectMachineDialog::CheckErrorSyncNozzleMappingResultV1 ( MachineObject * obj_)
1790{
1792 return true; // there is no slicing data when printing from sdcard
1793
1794 if (!obj_)
1795 return true;
1796
1797 if (!(obj_->GetNozzleSystem() && obj_->GetNozzleSystem()->GetNozzleRack()->IsSupported()))
1798 return true; // no need to check if the printer has no nozzle rack
1799
1801 return true;
1802
1803 const auto& obj_nozzle_mapping_ptr = obj_->get_nozzle_mapping_result();
1804 if (!obj_nozzle_mapping_ptr->HasResult()) {
1805 if (time(nullptr) - s_nozzle_mapping_last_request_time > 10) { // avoid too many requests
1806 int rtn = obj_nozzle_mapping_ptr->CtrlGetAutoNozzleMappingV1(m_plater);
1807 if (rtn == 0) {
1808 s_nozzle_mapping_last_request_time = time(nullptr);
1809 } else {
1810 const auto& err_msg = wxString::Format(_L("Failed to send nozzle auto-mapping request to printer { code: %d }. "
1811 "Please try to refresh the printer information. "
1812 "If it still does not recover, you can try to rebind the printer and check the network connection."), rtn);
1814 return false;
1815 }
1816 }
1817
1818 show_status(PrintDialogStatus::PrintStatusRackNozzleMappingWaiting, {_L("The printer is calculating nozzle mapping.") + " " + _L("Please wait a moment...")});
1819 return false;
1820 }
1821
1822 if (obj_nozzle_mapping_ptr->GetResultStr() == "failed") {
1823 const auto& err_msg = wxString::Format(_L("Failed to receive nozzle auto-mapping table from printer { msg: %s }. Please refresh the printer information."), obj_nozzle_mapping_ptr->GetMqttReason());
1825 return false;
1826 }
1827
1828 if (obj_nozzle_mapping_ptr->GetResultStr() == "fail") {
1829 const wxString& err_msg = wxString::Format(_L("The printer failed to build the nozzle auto-mapping table { code: %d }. Please refresh nozzle information."), obj_nozzle_mapping_ptr->GetErrno());
1831 return false;
1832 }
1833
1834 const auto& mapping_map = obj_->get_nozzle_mapping_result()->GetNozzleMappingMap();
1835 if (!mapping_map.empty()) {
1836 if (m_nozzle_mapping_result != mapping_map) {
1837 m_nozzle_mapping_result = mapping_map;
1839 }
1840
1841 float flush_waste_base = obj_->get_nozzle_mapping_result()->GetFlushWeightBase();
1842 float flush_waste_current = obj_->get_nozzle_mapping_result()->GetFlushWeightCurrent();
1843 if ((flush_waste_base != -1) && (flush_waste_current != -1) && flush_waste_current > flush_waste_base) {
1844 const wxString& warning_msg = wxString::Format(_L("The current nozzle mapping may produce an extra %0.2f g of waste."), flush_waste_current - flush_waste_base);
1846 }
1847 return true;
1848 }
1849
1850 const wxString& err_msg = wxString::Format(_L("Failed to receive nozzle auto-mapping table from printer { msg: %s }. Please refresh the printer information."), "empty table");
1852 return true;
1853}

References _L, Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::get_nozzle_mapping_result(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), m_ams_mapping_result, m_nozzle_mapping_result, m_plater, m_print_type, Slic3r::GUI::PrintStatusRackNozzleMappingError, Slic3r::GUI::PrintStatusRackNozzleMappingWaiting, Slic3r::GUI::PrintStatusRackNozzleMappingWarning, Slic3r::GUI::s_nozzle_mapping_last_request_time, show_status(), sync_ams_mapping_result(), and use_dynamic_nozzle_map().

Referenced by update_show_status().

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

◆ CheckWarningFilamentCrossExtruder()

bool Slic3r::GUI::SelectMachineDialog::CheckWarningFilamentCrossExtruder ( MachineObject * obj_)
2011{
2012 if (!obj_ || m_print_type != PrintFromType::FROM_NORMAL) return true;
2013 if (obj_->GetExtderSystem()->GetTotalExtderCount() != 2) return true;
2014
2015 for (const auto& fila : m_ams_mapping_result) {
2016 std::set<int> used_extruder_ids;
2017 for (const auto& [pos_id, nozzle] : get_mapped_nozzles(fila.id)) {
2018 if (!nozzle.IsEmpty()) { used_extruder_ids.insert(nozzle.GetExtruderId()); }
2019 }
2020 if (used_extruder_ids.size() >= 2) { return false; }
2021 }
2022
2023 return true;
2024}
std::map< int, DevNozzle > get_mapped_nozzles(int fila_id) const
Definition SelectMachine.cpp:1576

References Slic3r::GUI::FROM_NORMAL, get_mapped_nozzles(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevExtderSystem::GetTotalExtderCount(), m_ams_mapping_result, and m_print_type.

Referenced by update_show_status().

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

◆ CheckWarningRackStatus()

void Slic3r::GUI::SelectMachineDialog::CheckWarningRackStatus ( MachineObject * obj_)
4523{
4524 if (!obj_) {
4525 return;
4526 }
4527
4528 const auto& nozzle_sys = obj_->GetNozzleSystem();
4529 const auto& rack = nozzle_sys->GetNozzleRack();
4530 if (!rack->IsSupported()) {
4531 return;
4532 }
4533
4534 auto nozzle_group_res = DevUtilBackend::GetNozzleGroupResult(m_plater);
4535 if (!nozzle_group_res) {
4536 return;
4537 }
4538
4539 if (m_print_type != FROM_NORMAL) {
4540 return;// there are no slicing data when print from sdcard
4541 }
4542
4543 const auto& nozzle_vec = nozzle_group_res->get_used_nozzles_in_extruder(LOGIC_R_EXTRUDER_ID);
4544 if (nozzle_vec.empty()) {
4545 return;// no need to check if no right nozzles used in slicing
4546 }
4547
4548 std::unordered_map<NozzleDef, int> need_nozzle_map;
4549 for (const auto& slicing_nozzle : nozzle_vec) {
4550 try {
4551 NozzleDef data;
4552 data.nozzle_diameter = std::stof(slicing_nozzle.diameter);
4553 data.nozzle_flow_type = DevNozzle::ToNozzleFlowType(slicing_nozzle.volume_type);
4554 need_nozzle_map[data]++;
4555 } catch (const std::exception& e) {
4556 assert(0);
4557 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "exception: " << e.what();
4558 }
4559 }
4560
4561 for (const auto& need_nozzle : need_nozzle_map) {
4562 const auto& nozzle_info = need_nozzle.first;
4563 const auto& installed_nozzles = nozzle_sys->CollectNozzles(MAIN_EXTRUDER_ID, nozzle_info.nozzle_flow_type, nozzle_info.nozzle_diameter);
4564 int installed_count = installed_nozzles.size();
4565 int installed_reliable_count = 0;
4566 for (const auto& nozzle : installed_nozzles) {
4567 if (nozzle.IsInfoReliable()) {
4568 installed_reliable_count++;
4569 }
4570 }
4571
4572 // check if enough nozzles installed
4573 if (need_nozzle.second > installed_count) {
4574 wxString msg = _L("There are not enough available hotends currently.");
4575 msg += " ";
4576 if (rack->GetCaliStatus() != DevNozzleRack::Rack_CALI_OK) {
4577 msg += _L("Please complete the hotend rack setup and try again.");
4578 } else if (nozzle_sys->HasUnknownNozzles()) {
4579 msg += _L("Please refresh the nozzle information and try again.");
4580 } else {
4581 msg += _L("Please re-slice to avoid filament waste.");
4582 }
4583
4585 break;
4586 }
4587
4588 // check if unreliable nozzle maybe used
4589 if (need_nozzle.second > installed_reliable_count && nozzle_sys->HasUnreliableNozzles()) {
4590 // Orca: text-only warning; this message board has no refresh / don't-show-again buttons.
4592 { _L("The reported hotend information may be unreliable.") + " " + _L("Please refresh the nozzle information and try again.") });
4593 }
4594 }
4595}
@ PrintStatusRackNozzleNumUnmeetWarning
Definition PrePrintChecker.hpp:115
@ PrintStatusHasUnreliableNozzleWarning
Definition PrePrintChecker.hpp:116
float nozzle_diameter
Definition DevDefs.h:182
Slic3r::NozzleFlowType nozzle_flow_type
Definition DevDefs.h:183
static NozzleFlowType ToNozzleFlowType(const NozzleVolumeType &type)
Definition DevNozzleSystem.cpp:41

References _L, Slic3r::GUI::FROM_NORMAL, Slic3r::DevUtilBackend::GetNozzleGroupResult(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), LOGIC_R_EXTRUDER_ID, m_plater, m_print_type, MAIN_EXTRUDER_ID, NozzleDef::nozzle_diameter, NozzleDef::nozzle_flow_type, Slic3r::GUI::PrintStatusHasUnreliableNozzleWarning, Slic3r::GUI::PrintStatusRackNozzleNumUnmeetWarning, Slic3r::DevNozzleRack::Rack_CALI_OK, show_status(), and Slic3r::DevNozzle::ToNozzleFlowType().

Referenced by update_show_status().

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

◆ CheckWarningSmartNozzleBlobAuto()

bool Slic3r::GUI::SelectMachineDialog::CheckWarningSmartNozzleBlobAuto ( MachineObject * obj_)
2029{
2030 if (!obj_ || m_print_type != PrintFromType::FROM_NORMAL) return true;
2031
2032 // Only relevant when the printer firmware supports the smart wrap detection feature.
2033 auto* opts = obj_->GetPrintOptions();
2034 if (!opts) return true;
2035 const auto* opt = opts->GetDetectionOption(PrintOptionEnum::Smart_Nozzle_Blob_Detection);
2036 if (!opt || !opt->is_support_detect) return true;
2037
2038 // Already in Auto (cfg == 2): nothing to recommend.
2039 if (opt->current_detect_value == 2) return true;
2040
2041 // Need at least one stringing-prone filament in the sliced project for any nozzle on the current
2042 // printer config; iterating the diameters covers single- and dual-extruder printers.
2043 if (!wxGetApp().preset_bundle) return true;
2044 const auto& full_config = wxGetApp().preset_bundle->full_config();
2045 const auto* opt_nozzle_diameters = full_config.option<ConfigOptionFloats>("nozzle_diameter");
2046 if (!opt_nozzle_diameters || opt_nozzle_diameters->values.empty()) return true;
2047
2048 for (const auto& fila : m_filaments) {
2049 if (fila.filament_id.empty()) continue;
2050 for (double d : opt_nozzle_diameters->values) {
2051 if (Slic3r::is_stringing_prone_filament(fila.filament_id, static_cast<float>(d)))
2052 return false;
2053 }
2054 }
2055 return true;
2056}
@ Smart_Nozzle_Blob_Detection
Definition DevPrintOptions.h:29
bool is_stringing_prone_filament(const std::string &filament_id, float nozzle_diameter)
Definition DeviceManager.cpp:168

References Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::GetPrintOptions(), Slic3r::is_stringing_prone_filament(), m_filaments, m_print_type, and Slic3r::Smart_Nozzle_Blob_Detection.

Referenced by update_show_status().

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

◆ clear_ip_address_config()

void Slic3r::GUI::SelectMachineDialog::clear_ip_address_config ( wxCommandEvent & e)
3824{
3825 prepare_mode();
3826}
void prepare_mode(bool refresh_button=true)
Definition SelectMachine.cpp:1051

References prepare_mode().

Referenced by init_bind().

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

◆ clear_nozzle_mapping()

void Slic3r::GUI::SelectMachineDialog::clear_nozzle_mapping ( )
1733{
1735 // Orca: no BBS get_current_machine(); use the selected device (same accessor get_mapped_nozzles uses).
1736 DeviceManager* dev = wxGetApp().getDeviceManager();
1737 if (MachineObject* obj_ = dev ? dev->get_selected_machine() : nullptr)
1738 obj_->get_nozzle_mapping_result()->Clear();
1739}

References Slic3r::DeviceManager::get_selected_machine(), and m_nozzle_mapping_result.

Referenced by on_flow_cali_option_changed(), on_pa_value_option_changed(), and on_selection_changed().

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

◆ clone_thumbnail_data()

void Slic3r::GUI::SelectMachineDialog::clone_thumbnail_data ( )
5835 {
5836 //record preview_colors
5837 MaterialHash::iterator iter = m_materialList.begin();
5838 if (m_preview_colors_in_thumbnail.size() != m_materialList.size()) {
5840 }
5841 while (iter != m_materialList.end()) {
5842 Material * item = iter->second;
5843 MaterialItem *m = item->item;
5844 // Orca: key the preview colours by filament slot, as m_cur_colors_in_thumbnail and
5845 // SyncAmsInfoDialog already do, so recompute_mixed_slot_colors() below can look a mixed
5846 // slot's component colours up by id (BBS keys this array by list position).
5847 if (item->id >= m_preview_colors_in_thumbnail.size()) {
5848 m_preview_colors_in_thumbnail.resize(item->id + 1);
5849 }
5850 m_preview_colors_in_thumbnail[item->id] = m->m_material_coloul;
5851 if (item->id < m_cur_colors_in_thumbnail.size()) {
5852 m_cur_colors_in_thumbnail[item->id] = m->m_ams_coloul;
5853 }
5854 else {//exist empty or unrecognized type ams in machine
5855 m_cur_colors_in_thumbnail.resize(item->id + 1);
5856 m_cur_colors_in_thumbnail[item->id] = m->m_ams_coloul;
5857 }
5858 iter++;
5859 }
5860
5861 // Expand color arrays to cover mixed (virtual) slots and compute their blended colors
5862 const auto& cfg = wxGetApp().preset_bundle->project_config;
5863 size_t total = 0;
5864 if (auto* opt = cfg.option<ConfigOptionBools>("filament_is_mixed"))
5865 total = opt->values.size();
5866 size_t target = std::max(total, m_cur_colors_in_thumbnail.size());
5867 if (m_cur_colors_in_thumbnail.size() < target)
5868 m_cur_colors_in_thumbnail.resize(target);
5869 if (m_preview_colors_in_thumbnail.size() < target)
5870 m_preview_colors_in_thumbnail.resize(target);
5873
5874 //copy data
5875 auto &data = m_cur_input_thumbnail_data;
5877 m_preview_thumbnail_data.set(data.width, data.height);
5878 if (data.width > 0 && data.height > 0) {
5879 for (unsigned int r = 0; r < data.height; ++r) {
5880 unsigned int rr = (data.height - 1 - r) * data.width;
5881 for (unsigned int c = 0; c < data.width; ++c) {
5882 unsigned char *origin_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
5883 unsigned char *new_px = (unsigned char *) m_preview_thumbnail_data.pixels.data() + 4 * (rr + c);
5884 for (size_t i = 0; i < 4; i++) {
5885 new_px[i] = origin_px[i];
5886 }
5887 }
5888 }
5889 }
5890 //record_edge_pixels_data
5892}
std::vector< wxColour > m_preview_colors_in_thumbnail
Definition SelectMachine.hpp:447
void record_edge_pixels_data()
Definition SelectMachine.cpp:5894
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:2066

References Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, Slic3r::GUI::MaterialItem::m_ams_coloul, m_cur_colors_in_thumbnail, m_cur_input_thumbnail_data, Slic3r::GUI::MaterialItem::m_material_coloul, m_materialList, m_preview_colors_in_thumbnail, m_preview_thumbnail_data, Slic3r::GUI::recompute_mixed_slot_colors(), and record_edge_pixels_data().

Referenced by unify_deal_thumbnail_data().

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

◆ convert_filament_map_nozzle_id_to_task_nozzle_id()

int Slic3r::GUI::SelectMachineDialog::convert_filament_map_nozzle_id_to_task_nozzle_id ( int nozzle_id) const
1558{
1559 if (nozzle_id == (int)FilamentMapNozzleId::NOZZLE_LEFT) {
1561 }
1562 else if (nozzle_id == (int)FilamentMapNozzleId::NOZZLE_RIGHT) {
1564 }
1565 else {
1566 /* unsupported nozzle id */
1567 assert(false);
1568 return nozzle_id;
1569 }
1570}
@ NOZZLE_LEFT
Definition SelectMachine.hpp:111
@ NOZZLE_RIGHT
Definition SelectMachine.hpp:112

References Slic3r::GUI::NOZZLE_LEFT, and Slic3r::GUI::NOZZLE_RIGHT.

Referenced by get_ams_mapping_result().

Here is the caller graph for this function:

◆ do_ams_mapping()

bool Slic3r::GUI::SelectMachineDialog::do_ams_mapping ( MachineObject * obj_,
bool use_ams )

can_hybrid_mapping(obj_get_extder_data())

1205{
1206 if (!obj_) return false;
1207 if (!obj_->HasAms()) { use_ams = false;} /*STUDIO-11971*/
1208 obj_->get_ams_colors(m_cur_colors_in_thumbnail);
1209 // try color and type mapping
1210
1211 const auto& full_config = wxGetApp().preset_bundle->full_config();
1212 const auto& project_config = wxGetApp().preset_bundle->project_config;
1213 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
1214
1215 if (m_print_type == FROM_NORMAL) {
1216 m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
1217 }
1218
1219 int filament_result = 0;
1220 std::vector<bool> map_opt; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1221 // Orca: only do the per-physical-extruder left/right split when the device actually reports
1222 // 2+ extruders. A non-BBL multi-nozzle printer (e.g. Snapmaker U1) reports a single extruder
1223 // with one filament pool, so it maps as a single surface via the else branch below.
1224 if (nozzle_nums > 1 && obj_->GetExtderSystem()->GetTotalExtderCount() > 1){
1225 //get nozzle property, the extders are same?
1226 if (true){
1227 std::vector<FilamentInfo> m_ams_mapping_result_left, m_ams_mapping_result_right;
1228 std::vector<FilamentInfo> m_filament_left, m_filament_right;
1229 for (auto it = m_filaments.begin(); it != m_filaments.end(); it++){
1230 if (it->id < 0 || it->id > m_filaments_map.size()){
1231 BOOST_LOG_TRIVIAL(info) << "error: do_ams_mapping: m_filaments[].it" << it->id;
1232 BOOST_LOG_TRIVIAL(info) << "m_filaments_map.size()" << m_filaments_map.size();
1233 return false;
1234 }
1235
1236 if (it->id < m_filaments_map.size()) {
1237 if (m_filaments_map[it->id] == 1)
1238 m_filament_left.push_back(*it);
1239 else if (m_filaments_map[it->id] == 2)
1240 m_filament_right.push_back(*it);
1241 }
1242 }
1243
1244 bool has_left_ams = false, has_right_ams = false;
1245 for (auto ams_item : obj_->GetFilaSystem()->GetAmsList()) {
1246 if (ams_item.second->GetExtruderId() == 0) {
1247 if (obj_->is_main_extruder_on_left())
1248 has_left_ams = true;
1249 else
1250 has_right_ams = true;
1251 }
1252 else if (ams_item.second->GetExtruderId() == 1) {
1253 if (obj_->is_main_extruder_on_left())
1254 has_right_ams = true;
1255 else
1256 has_left_ams = true;
1257 }
1258
1259 if (has_left_ams && has_right_ams)
1260 break;
1261 }
1262
1263 map_opt = {true, false, !has_left_ams, false}; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1264 if (!use_ams) {
1265 map_opt[0] = false;
1266 map_opt[2] = true;
1267 }
1268 int result_first = DevMappingUtil::ams_filament_mapping(obj_, m_filament_left, m_ams_mapping_result_left, map_opt);
1269 map_opt = { false, true, false, !has_right_ams };
1270 if (!use_ams) {
1271 map_opt[1] = false;
1272 map_opt[3] = true;
1273 }
1274 int result_second = DevMappingUtil::ams_filament_mapping(obj_, m_filament_right, m_ams_mapping_result_right, map_opt);
1275
1276 //m_ams_mapping_result.clear();
1277 m_ams_mapping_result.resize(m_ams_mapping_result_left.size() + m_ams_mapping_result_right.size());
1278 std::merge(m_ams_mapping_result_left.begin(), m_ams_mapping_result_left.end(), m_ams_mapping_result_right.begin(),
1279 m_ams_mapping_result_right.end(), m_ams_mapping_result.begin(),
1280 [](const FilamentInfo& f1, const FilamentInfo& f2) {
1281 return f1.id < f2.id; // Merge based on age
1282 });
1283 filament_result = (result_first && result_second);
1284 }
1285 //can hybrid mapping
1286 else {
1287 map_opt = { true, true, true, true }; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1288 if (!use_ams) {
1289 map_opt[0] = false;
1290 map_opt[1] = false;
1291 }
1293 }
1294 //When filaments cannot be matched automatically, whether to use ext for automatic supply
1295 //auto_supply_with_ext(obj_->vt_slot);
1296 }
1297
1298 //single nozzle
1299 else {
1300 map_opt = { false, true, false, false }; //four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1301 if (!use_ams) {
1302 map_opt[1] = false;
1303 map_opt[3] = true;
1304 }
1306 //auto_supply_with_ext(obj_->vt_slot);
1307 }
1308
1309 if (filament_result == 0) {
1311 std::string ams_array;
1312 std::string ams_array2;
1313 std::string mapping_info;
1314 get_ams_mapping_result(ams_array, ams_array2, mapping_info);
1315 if (ams_array.empty()) {
1317 if (m_print_type == FROM_NORMAL) {
1318 updata_thumbnail_data_after_connected_printer(); // FIX:update cur plate thumbnail
1319 }
1320 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=[]";
1321 } else {
1323 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=" << ams_array;
1324 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array2=" << ams_array2;
1325 BOOST_LOG_TRIVIAL(info) << "ams_mapping_info=" << mapping_info;
1326 }
1328 } else {
1329 // do not support ams mapping try to use order mapping
1331 if (filament_result != 1 && !is_valid) {
1332 //reset invalid result
1333 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1334 m_ams_mapping_result[i].tray_id = -1;
1335 m_ams_mapping_result[i].distance = 99999;
1336 }
1337 }
1339 return is_valid;
1340 }
1341
1342 return true;
1343}
size_t size() const override
Definition Config.hpp:722
static int ams_filament_mapping(const MachineObject *obj, const std::vector< FilamentInfo > &filaments, std::vector< FilamentInfo > &result, std::vector< bool > map_opt, std::vector< int > exclude_id=std::vector< int >(), bool nozzle_has_ams_then_ignore_ext=false)
Definition DevMapping.cpp:119
static bool is_valid_mapping_result(const MachineObject *obj, std::vector< FilamentInfo > &result, bool check_empty_slot=false)
Definition DevMapping.cpp:25
bool get_ams_mapping_result(std::string &mapping_array_str, std::string &mapping_array_str2, std::string &ams_mapping_info) const
Definition SelectMachine.cpp:1345
void reset_ams_material()
Definition SelectMachine.cpp:5363
void updata_thumbnail_data_after_connected_printer()
Definition SelectMachine.cpp:6004
void print_ams_mapping_result(std::vector< FilamentInfo > &result)
Definition SelectMachine.cpp:1191
bool is_valid(const FontFile &font, unsigned int index)
Definition Emboss.cpp:284

References Slic3r::DevMappingUtil::ams_filament_mapping(), Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::get_ams_colors(), get_ams_mapping_result(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::MachineObject::HasAms(), Slic3r::MachineObject::is_main_extruder_on_left(), Slic3r::DevMappingUtil::is_valid_mapping_result(), m_ams_mapping_result, m_cur_colors_in_thumbnail, m_filaments, m_filaments_map, m_print_type, Slic3r::GUI::print_ams_mapping_result(), reset_ams_material(), sync_ams_mapping_result(), and updata_thumbnail_data_after_connected_printer().

Referenced by update_show_status().

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

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ Enable_Auto_Refill()

void Slic3r::GUI::SelectMachineDialog::Enable_Auto_Refill ( bool enable)
3247{
3248 if (enable) {
3249 m_ams_backup_tip->SetForegroundColour(StateColor::darkModeColorFor("#009688"));
3250 }
3251 else {
3252 m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90));
3253 }
3254 m_ams_backup_tip->Refresh();
3255}
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References StateColor::darkModeColorFor(), and m_ams_backup_tip.

Referenced by prepare_mode(), and sending_mode().

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

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ Enable_Refresh_Button()

void Slic3r::GUI::SelectMachineDialog::Enable_Refresh_Button ( bool en)
5379{
5380 m_printer_box->EnableRefreshButton(en);
5381}

References m_printer_box.

Referenced by show_status().

Here is the caller graph for this function:

◆ Enable_Send_Button()

void Slic3r::GUI::SelectMachineDialog::Enable_Send_Button ( bool en)
5384{
5385 if (!en) {
5386 if (m_button_ensure->IsEnabled()) {
5387 m_button_ensure->Disable();
5388 // ORCA no need to set colors again
5389 }
5390 } else {
5391 if (!m_button_ensure->IsEnabled()) {
5392 m_button_ensure->Enable();
5393 // ORCA no need to set colors again
5394 }
5395 }
5396}

References m_button_ensure.

Referenced by on_send_print(), prepare_mode(), and show_status().

Here is the caller graph for this function:

◆ EnableEditing()

void Slic3r::GUI::SelectMachineDialog::EnableEditing ( bool enable)
private
3021{
3022 /*project*/
3023 m_rename_button->Enable(enable);
3024
3025 /*printer*/
3026 m_printer_box->EnableEditing(enable);
3027
3028 /*mapping*/
3029 for (size_t i = 0; i < m_sizer_ams_mapping_left->GetItemCount(); ++i) {
3030 wxSizerItem *item = m_sizer_ams_mapping_left->GetItem(i);
3031 if (item) {item->GetWindow()->Enable(enable);}
3032 }
3033
3034 for (size_t i = 0; i < m_sizer_ams_mapping_right->GetItemCount(); ++i) {
3035 wxSizerItem *item = m_sizer_ams_mapping_right->GetItem(i);
3036 if (item) {item->GetWindow()->Enable(enable);}
3037 }
3038
3039 for (size_t i = 0; i < m_sizer_ams_mapping->GetItemCount(); ++i) {
3040 wxSizerItem *item = m_sizer_ams_mapping->GetItem(i);
3041 if (item) { item->GetWindow()->Enable(enable); }
3042 }
3043
3044 /*mapping link*/
3045 //m_link_edit_nozzle->Enable(enable);
3046
3047 /*options*/
3048 for (auto iter : m_checkbox_list)
3049 {
3050 iter.second->enable(enable);
3051 }
3052
3053 // Grey the best-position "saves X" tip when editing is disabled so an error transition
3054 // doesn't leave a stale clickable tip.
3055 if (m_saveTimeText) enable ? m_saveTimeText->Enable() : m_saveTimeText->Disable();
3056}

References m_checkbox_list, m_printer_box, m_rename_button, m_saveTimeText, m_sizer_ams_mapping, m_sizer_ams_mapping_left, and m_sizer_ams_mapping_right.

Referenced by finish_mode(), on_print_job_cancel(), prepare_mode(), sending_mode(), and Show().

Here is the caller graph for this function:

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ final_deal_edge_pixels_data()

void Slic3r::GUI::SelectMachineDialog::final_deal_edge_pixels_data ( ThumbnailData & data)
5935{
5936 if (data.width > 0 && data.height > 0 && m_edge_pixels.size() >0 ) {
5937 for (unsigned int r = 0; r < data.height; ++r) {
5938 unsigned int rr = (data.height - 1 - r) * data.width;
5939 bool exist_rr_up = r >= 1 ? true : false;
5940 bool exist_rr_down = r <= data.height - 2 ? true : false;
5941 unsigned int rr_up = exist_rr_up ? (data.height - 1 - (r - 1)) * data.width : 0;
5942 unsigned int rr_down = exist_rr_down ? (data.height - 1 - (r + 1)) * data.width : 0;
5943 for (unsigned int c = 0; c < data.width; ++c) {
5944 bool exist_c_left = c >= 1 ? true : false;
5945 bool exist_c_right = c <= data.width - 2 ? true : false;
5946 unsigned int c_left = exist_c_left ? c - 1 : 0;
5947 unsigned int c_right = exist_c_right ? c + 1 : 0;
5948 unsigned char *cur_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
5949 unsigned char *relational_pxs[8] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
5950 if (exist_rr_up && exist_c_left) { relational_pxs[0] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c_left); }
5951 if (exist_rr_up) { relational_pxs[1] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c); }
5952 if (exist_rr_up && exist_c_right) { relational_pxs[2] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c_right); }
5953 if (exist_c_left) { relational_pxs[3] = (unsigned char *) data.pixels.data() + 4 * (rr + c_left); }
5954 if (exist_c_right) { relational_pxs[4] = (unsigned char *) data.pixels.data() + 4 * (rr + c_right); }
5955 if (exist_rr_down && exist_c_left) { relational_pxs[5] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c_left); }
5956 if (exist_rr_down) { relational_pxs[6] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c); }
5957 if (exist_rr_down && exist_c_right) { relational_pxs[7] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c_right); }
5958 if (cur_px[3] > 0 && m_edge_pixels[r * data.width + c]) {
5959 int rgba_sum[4] = {0, 0, 0, 0};
5960 int valid_count = 0;
5961 for (size_t k = 0; k < 8; k++) {
5962 if (relational_pxs[k]) {
5963 if (k == 0 && m_edge_pixels[(r - 1) * data.width + c_left]) {
5964 continue;
5965 }
5966 if (k == 1 && m_edge_pixels[(r - 1) * data.width + c]) {
5967 continue;
5968 }
5969 if (k == 2 && m_edge_pixels[(r - 1) * data.width + c_right]) {
5970 continue;
5971 }
5972 if (k == 3 && m_edge_pixels[r * data.width + c_left]) {
5973 continue;
5974 }
5975 if (k == 4 && m_edge_pixels[r * data.width + c_right]) {
5976 continue;
5977 }
5978 if (k == 5 && m_edge_pixels[(r + 1) * data.width + c_left]) {
5979 continue;
5980 }
5981 if (k == 6 && m_edge_pixels[(r + 1) * data.width + c]) {
5982 continue;
5983 }
5984 if (k == 7 && m_edge_pixels[(r + 1) * data.width + c_right]) {
5985 continue;
5986 }
5987 for (size_t m = 0; m < 4; m++) {
5988 rgba_sum[m] += relational_pxs[k][m];
5989 }
5990 valid_count++;
5991 }
5992 }
5993 if (valid_count > 0) {
5994 for (size_t m = 0; m < 4; m++) {
5995 cur_px[m] = std::clamp(int(rgba_sum[m] / (float)valid_count), 0, 255);
5996 }
5997 }
5998 }
5999 }
6000 }
6001 }
6002}

References Slic3r::ThumbnailData::height, m_edge_pixels, Slic3r::ThumbnailData::pixels, and Slic3r::ThumbnailData::width.

Referenced by on_set_finish_mapping(), and unify_deal_thumbnail_data().

Here is the caller graph for this function:

◆ finish_mode()

void Slic3r::GUI::SelectMachineDialog::finish_mode ( )
1105{
1106 EnableEditing(true);
1107
1109 m_is_in_sending_mode = false;
1110 m_simplebook->SetSelection(2);
1111 Layout();
1112 Fit();
1113}
void EnableEditing(bool enable)
Definition SelectMachine.cpp:3020
PrintPageMode m_print_page_mode
Definition SelectMachine.hpp:327
@ PrintPageModeFinish
Definition SelectMachine.hpp:91

References EnableEditing(), m_is_in_sending_mode, m_print_page_mode, m_simplebook, and Slic3r::GUI::PrintPageModeFinish.

Referenced by on_send_print().

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

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ format_steel_name()

wxString Slic3r::GUI::SelectMachineDialog::format_steel_name ( NozzleType type)
3006{
3007 if (type == NozzleType::ntHardenedSteel) {
3008 return _L("Hardened Steel");
3009 }
3010 else if (type == NozzleType::ntStainlessSteel) {
3011 return _L("Stainless Steel");
3012 }
3013 else if (type == NozzleType::ntTungstenCarbide) {
3014 return _L("Tungsten Carbide");
3015 }
3016
3017 return _L("Unknown");
3018}
@ ntTungstenCarbide
Definition CommonDefs.hpp:17
@ ntStainlessSteel
Definition CommonDefs.hpp:16
@ ntHardenedSteel
Definition CommonDefs.hpp:15

References _L, Slic3r::ntHardenedSteel, Slic3r::ntStainlessSteel, and Slic3r::ntTungstenCarbide.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ FormatTime()

wxString Slic3r::GUI::SelectMachineDialog::FormatTime ( float totalSeconds)
2073{
2074 totalSeconds = std::abs(totalSeconds);
2075 int secs = static_cast<int>(std::round(totalSeconds));
2076 int hours = secs / 3600;
2077 int remaining = secs % 3600;
2078 int minutes = remaining / 60;
2079 int seconds = remaining % 60;
2080 if (hours > 0) return wxString::Format("%dm%ds", hours * 60 + minutes, seconds);
2081 if (minutes > 0) return wxString::Format("%dm%ds", minutes, seconds);
2082 return wxString::Format("%ds", seconds);
2083}

Referenced by on_reselect_dialog_btn_clicked(), refresh_save_time(), and update_best_pos_dialog().

Here is the caller graph for this function:

◆ get_ams_mapping_result()

bool Slic3r::GUI::SelectMachineDialog::get_ams_mapping_result ( std::string & mapping_array_str,
std::string & mapping_array_str2,
std::string & ams_mapping_info ) const
1346{
1347 if (m_ams_mapping_result.empty())
1348 return false;
1349
1350 bool valid_mapping_result = true;
1351 int invalid_count = 0;
1352 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1353 if (m_ams_mapping_result[i].tray_id == -1) {
1354 valid_mapping_result = false;
1355 invalid_count++;
1356 }
1357 }
1358
1359 if (invalid_count == m_ams_mapping_result.size()) {
1360 return false;
1361 } else {
1362 if (m_print_type == FROM_NORMAL) {
1363 json mapping_v0_json = json::array();
1364 json mapping_v1_json = json::array();
1365 json mapping_info_json = json::array();
1366
1367 /* get filament maps */
1368 std::vector<int> filament_maps;
1369 Plater * plater = wxGetApp().plater();
1370 if (plater) {
1371 PartPlate *curr_plate = plater->get_partplate_list().get_curr_plate();
1372 if (curr_plate) {
1373 filament_maps = curr_plate->get_filament_maps();
1374 } else {
1375 BOOST_LOG_TRIVIAL(error) << "get_ams_mapping_result, curr_plate is nullptr";
1376 }
1377 } else {
1378 BOOST_LOG_TRIVIAL(error) << "get_ams_mapping_result, plater is nullptr";
1379 }
1380
1381 for (int i = 0; i < wxGetApp().preset_bundle->filament_presets.size(); i++) {
1382 int tray_id = -1;
1383 json mapping_item_v1;
1384 mapping_item_v1["ams_id"] = 0xff;
1385 mapping_item_v1["slot_id"] = 0xff;
1386 json mapping_item;
1387 mapping_item["ams"] = tray_id;
1388 mapping_item["targetColor"] = "";
1389 mapping_item["filamentId"] = "";
1390 mapping_item["filamentType"] = "";
1391 for (int k = 0; k < m_ams_mapping_result.size(); k++) {
1392 if (m_ams_mapping_result[k].id == i) {
1393 tray_id = m_ams_mapping_result[k].tray_id;
1394 mapping_item["ams"] = tray_id;
1395 mapping_item["filamentType"] = m_filaments[k].type;
1396 if (i >= 0 && i < wxGetApp().preset_bundle->filament_presets.size()) {
1397 auto it = wxGetApp().preset_bundle->filaments.find_preset(wxGetApp().preset_bundle->filament_presets[i]);
1398 if (it != nullptr) { mapping_item["filamentId"] = it->filament_id; }
1399 }
1400 /* nozzle id */
1401 if (i >= 0 && i < filament_maps.size()) { mapping_item["nozzleId"] = convert_filament_map_nozzle_id_to_task_nozzle_id(filament_maps[i]); }
1402 // convert #RRGGBB to RRGGBBAA
1403 mapping_item["sourceColor"] = m_filaments[k].color;
1404 mapping_item["targetColor"] = m_ams_mapping_result[k].color;
1405 if (tray_id == VIRTUAL_TRAY_MAIN_ID || tray_id == VIRTUAL_TRAY_DEPUTY_ID) { tray_id = -1; }
1406
1407 /*new ams mapping data*/
1408 try {
1409 if (m_ams_mapping_result[k].ams_id.empty() || m_ams_mapping_result[k].slot_id.empty()) { // invalid case
1410 mapping_item_v1["ams_id"] = VIRTUAL_TRAY_MAIN_ID;
1411 mapping_item_v1["slot_id"] = VIRTUAL_TRAY_MAIN_ID;
1412 } else {
1413 mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
1414 mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
1415 }
1416 } catch (...) {}
1417 }
1418 }
1419 mapping_v0_json.push_back(tray_id);
1420 mapping_v1_json.push_back(mapping_item_v1);
1421 mapping_info_json.push_back(mapping_item);
1422 }
1423
1424 mapping_array_str = mapping_v0_json.dump();
1425 mapping_array_str2 = mapping_v1_json.dump();
1426 ams_mapping_info = mapping_info_json.dump();
1427 return valid_mapping_result;
1428 } else if(m_print_type == FROM_SDCARD_VIEW){
1429 json mapping_v0_json = json::array();
1430 json mapping_v1_json = json::array();
1431
1432 for (int i = 0; i < m_filaments_map.size(); i++) {
1433 int mapping_result = -1;
1434 json mapping_item_v1;
1435 mapping_item_v1["ams_id"] = 0xff;
1436 mapping_item_v1["slot_id"] = 0xff;
1437
1438 try {
1439 for (int k = 0; k < m_ams_mapping_result.size(); k++) {
1440 if (m_ams_mapping_result[k].id == i) {
1441 mapping_result = m_ams_mapping_result[k].tray_id;
1442 mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
1443 mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
1444 }
1445 }
1446 } catch (...) {}
1447
1448 mapping_v0_json.push_back(mapping_result);
1449 mapping_v1_json.push_back(mapping_item_v1);
1450 mapping_array_str = mapping_v0_json.dump();
1451 mapping_array_str2 = mapping_v1_json.dump();
1452 }
1453 return true;
1454 }
1455 }
1456 return true;
1457}
#define VIRTUAL_TRAY_DEPUTY_ID
Definition DevDefs.h:90
#define VIRTUAL_TRAY_MAIN_ID
Definition DevDefs.h:89
PartPlate * get_curr_plate()
Definition PartPlate.hpp:962
PartPlateList & get_partplate_list()
Definition Plater.cpp:22578
int convert_filament_map_nozzle_id_to_task_nozzle_id(int nozzle_id) const
Definition SelectMachine.cpp:1557
@ FROM_SDCARD_VIEW
Definition DevDefs.h:174

References convert_filament_map_nozzle_id_to_task_nozzle_id(), Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::GUI::PartPlate::get_filament_maps(), m_ams_mapping_result, m_filaments, m_filaments_map, m_print_type, Slic3r::GUI::plater(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by do_ams_mapping(), and on_send_print().

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

◆ get_filament_change_gap_time()

std::optional< float > Slic3r::GUI::SelectMachineDialog::get_filament_change_gap_time ( MachineObject * obj_) const
2089{
2090 if (m_print_type != PrintFromType::FROM_NORMAL) return std::nullopt;
2091 if (!m_plater || !obj_ || !obj_->GetFilaSwitch() || !obj_->GetFilaSwitch()->IsInstalled()) return std::nullopt;
2092
2093 GCodeProcessorResult* gcode_result = m_plater->background_process().get_current_gcode_result();
2094 auto nozzle_group_res = DevUtilBackend::GetNozzleGroupResult(m_plater);
2095 if (!nozzle_group_res || !gcode_result) return std::nullopt;
2096
2097 const std::vector<unsigned int>& used_u = nozzle_group_res->get_used_filaments();
2098 const std::vector<int> logic_filaments(used_u.begin(), used_u.end());
2099
2100 std::vector<int> group_of_filaments;
2101 for (const auto& fila_idx : logic_filaments) {
2102 bool found = false;
2103 for (const auto& item : m_ams_mapping_result) {
2104 if (fila_idx != item.id) continue;
2105 const auto& ams_item = obj_->GetFilaSystem()->GetAmsById(item.ams_id);
2106 if (ams_item && ams_item->GetSwitcherPos().has_value()) {
2107 if (ams_item->GetSwitcherPos().value() == DevFilaSwitch::POS_IN_A) { group_of_filaments.push_back(0); found = true; break; }
2108 else if (ams_item->GetSwitcherPos().value() == DevFilaSwitch::POS_IN_B) { group_of_filaments.push_back(1); found = true; break; }
2109 } else {
2110 return std::nullopt;
2111 }
2112 }
2113 if (!found) return std::nullopt;
2114 }
2115
2116 const std::vector<MultiNozzleUtils::NozzleInfo> nozzle_list = nozzle_group_res->get_used_nozzles_in_extruder();
2117 const std::vector<int> fila_change_seq(gcode_result->filament_change_sequence.begin(), gcode_result->filament_change_sequence.end());
2118 const std::vector<int> nozzle_change_seq(gcode_result->nozzle_change_sequence.begin(), gcode_result->nozzle_change_sequence.end());
2119
2120 MultiNozzleUtils::FilamentChangeTimeParams params;
2121 const auto& full_config = wxGetApp().preset_bundle->full_config();
2122 if (const auto* load_time_opt = full_config.option<ConfigOptionFloat>("machine_load_filament_time"))
2123 params.standard_load_time = load_time_opt->value;
2124 if (const auto* unload_time_opt = full_config.option<ConfigOptionFloat>("machine_unload_filament_time"))
2125 params.standard_unload_time = unload_time_opt->value;
2126 params.selector_load_time = params.standard_load_time * 0.5;
2127 params.selector_unload_time = params.standard_unload_time * 0.5;
2128
2129 int group_count = group_of_filaments.empty() ? 0 : *std::max_element(group_of_filaments.begin(), group_of_filaments.end()) + 1;
2130 // Orca: kept device model has no ams_preload_version; assume no AMS pre-load (conservative).
2131 std::vector<bool> ams_preload_enabled(group_count, false);
2132
2133 try {
2134 auto r = MultiNozzleUtils::simulate_filament_change_time(logic_filaments, nozzle_list, fila_change_seq,
2135 nozzle_change_seq, group_of_filaments, params,
2136 ams_preload_enabled, /*calc_sliced_time=*/true);
2137 return static_cast<float>(r.actual_time - r.sliced_time);
2138 } catch (const std::exception& e) {
2139 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": exception: " << e.what();
2140 return std::nullopt;
2141 }
2142}
@ POS_IN_B
Definition DevFilaSwitch.h:35
@ POS_IN_A
Definition DevFilaSwitch.h:36
FilamentChangeSimResult simulate_filament_change_time(const std::vector< int > &logical_filaments, const std::vector< NozzleInfo > &nozzle_list, const std::vector< int > &filament_change_seq, const std::vector< int > &nozzle_change_seq, const std::vector< int > &group_of_filament, const FilamentChangeTimeParams &time_params, const std::vector< bool > &ams_preload_enabled, bool calc_sliced_time)
Definition MultiNozzleUtils.cpp:467
zaa_minimize_perimeter_height ConfigOptionFloat
Definition PrintConfig.hpp:1954

References Slic3r::GCodeProcessorResult::filament_change_sequence, Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevUtilBackend::GetNozzleGroupResult(), Slic3r::DevFilaSwitch::IsInstalled(), m_ams_mapping_result, m_plater, m_print_type, Slic3r::GCodeProcessorResult::nozzle_change_sequence, Slic3r::DevFilaSwitch::POS_IN_A, Slic3r::DevFilaSwitch::POS_IN_B, Slic3r::MultiNozzleUtils::FilamentChangeTimeParams::selector_load_time, Slic3r::MultiNozzleUtils::FilamentChangeTimeParams::selector_unload_time, Slic3r::MultiNozzleUtils::simulate_filament_change_time(), Slic3r::MultiNozzleUtils::FilamentChangeTimeParams::standard_load_time, and Slic3r::MultiNozzleUtils::FilamentChangeTimeParams::standard_unload_time.

Referenced by on_reselect_dialog_btn_clicked(), refresh_save_time(), and update_best_pos_dialog().

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

◆ get_filament_mapping_show_type()

ShowType Slic3r::GUI::SelectMachineDialog::get_filament_mapping_show_type ( MachineObject * obj_,
int fila_logic_id ) const
1514{
1515 try {
1516 const auto& full_config = wxGetApp().preset_bundle->full_config();
1517 size_t total_ext_count = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
1518 if (total_ext_count < 2) {
1519 return ShowType::RIGHT;
1520 }
1521
1522 if (can_hybrid_mapping(obj_)) {
1524 } else if (m_filaments_map.at(fila_logic_id) == 1) {
1525 return ShowType::LEFT;
1526 } else if (m_filaments_map.at(fila_logic_id) == 2) {
1527 return ShowType::RIGHT;
1528 }
1529 } catch (const std::exception& e) {
1530 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": exception: " << e.what();
1531 }
1532
1534}
bool can_hybrid_mapping(MachineObject *obj_) const
Definition SelectMachine.cpp:1509
@ LEFT
Definition AmsMappingPopup.hpp:78
@ LEFT_AND_RIGHT_DYNAMIC
Definition AmsMappingPopup.hpp:81
@ RIGHT
Definition AmsMappingPopup.hpp:79
@ LEFT_AND_RIGHT
Definition AmsMappingPopup.hpp:80

References can_hybrid_mapping(), Slic3r::GUI::LEFT, Slic3r::GUI::LEFT_AND_RIGHT, Slic3r::GUI::LEFT_AND_RIGHT_DYNAMIC, m_filaments_map, and Slic3r::GUI::RIGHT.

Referenced by reset_and_sync_ams_list(), and set_default_from_sdcard().

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

◆ get_filament_suggest_pos() [1/2]

std::map< int, DevFilaSwitch::SwitchPos > Slic3r::GUI::SelectMachineDialog::get_filament_suggest_pos ( MachineObject * obj_) const
2146{
2147 std::map<int, DevFilaSwitch::SwitchPos> suggest_pos_map;
2148 if (m_print_type != PrintFromType::FROM_NORMAL) return suggest_pos_map;
2149 if (!m_plater || !obj_ || !obj_->GetFilaSwitch() || !obj_->GetFilaSwitch()->IsInstalled()) return suggest_pos_map;
2150
2151 GCodeProcessorResult* gcode_result = m_plater->background_process().get_current_gcode_result();
2152 if (!gcode_result) return suggest_pos_map;
2153
2154 std::map<int, std::set<int>> pos2group;
2155 const auto& optimal_assignment = gcode_result->optimal_assignment;
2156 for (int fila_idx = 0; fila_idx < (int) optimal_assignment.size(); fila_idx++) {
2157 if (is_used_filament(fila_idx))
2158 pos2group[optimal_assignment.at(fila_idx)].insert(fila_idx);
2159 }
2160
2161 std::set<int> in_a_fila_set;
2162 std::set<int> in_b_fila_set;
2163 for (const auto& item : m_ams_mapping_result) {
2164 const auto& ams_item = obj_->GetFilaSystem()->GetAmsById(item.ams_id);
2165 if (ams_item && ams_item->GetSwitcherPos().has_value()) {
2166 if (ams_item->GetSwitcherPos().value() == DevFilaSwitch::POS_IN_A) in_a_fila_set.insert(item.id);
2167 else if (ams_item->GetSwitcherPos().value() == DevFilaSwitch::POS_IN_B) in_b_fila_set.insert(item.id);
2168 } else {
2169 return suggest_pos_map;
2170 }
2171 }
2172
2173 if (pos2group.size() == 1) {
2174 DevFilaSwitch::SwitchPos target = (in_a_fila_set.size() >= in_b_fila_set.size()) ? DevFilaSwitch::POS_IN_A : DevFilaSwitch::POS_IN_B;
2175 for (const auto& item : m_ams_mapping_result)
2176 suggest_pos_map[item.id] = target;
2177 } else if (pos2group.size() == 2) {
2178 auto iter = pos2group.begin();
2179 const auto& group_1 = iter->second;
2180 ++iter;
2181 const auto& group_2 = iter->second;
2182
2183 int offset_1 = 0; // place group1->INA, group2->INB
2184 for (const auto& g1 : group_1) if (in_a_fila_set.count(g1) == 0) offset_1++;
2185 for (const auto& g2 : group_2) if (in_b_fila_set.count(g2) == 0) offset_1++;
2186
2187 int offset_2 = 0; // place group2->INA, group1->INB
2188 for (const auto& g1 : group_1) if (in_b_fila_set.count(g1) == 0) offset_2++;
2189 for (const auto& g2 : group_2) if (in_a_fila_set.count(g2) == 0) offset_2++;
2190
2191 if (offset_1 <= offset_2) {
2192 for (const auto& fila_idx : group_1) suggest_pos_map[fila_idx] = DevFilaSwitch::POS_IN_A;
2193 for (const auto& fila_idx : group_2) suggest_pos_map[fila_idx] = DevFilaSwitch::POS_IN_B;
2194 } else {
2195 for (const auto& fila_idx : group_1) suggest_pos_map[fila_idx] = DevFilaSwitch::POS_IN_B;
2196 for (const auto& fila_idx : group_2) suggest_pos_map[fila_idx] = DevFilaSwitch::POS_IN_A;
2197 }
2198 }
2199 return suggest_pos_map;
2200}
SwitchPos
Definition DevFilaSwitch.h:34
bool is_used_filament(int fila_logic_id) const
Definition SelectMachine.cpp:2065

References Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::GetFilaSystem(), is_used_filament(), Slic3r::DevFilaSwitch::IsInstalled(), m_ams_mapping_result, m_plater, m_print_type, Slic3r::GCodeProcessorResult::optimal_assignment, Slic3r::DevFilaSwitch::POS_IN_A, and Slic3r::DevFilaSwitch::POS_IN_B.

Referenced by get_filament_suggest_pos(), is_at_suggested_pos(), on_reselect_dialog_btn_clicked(), and update_best_pos_dialog().

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

◆ get_filament_suggest_pos() [2/2]

std::optional< DevFilaSwitch::SwitchPos > Slic3r::GUI::SelectMachineDialog::get_filament_suggest_pos ( MachineObject * obj_,
int fila_logic_id ) const
2203{
2204 const auto& suggest_pos_opt = get_filament_suggest_pos(obj_);
2205 if (suggest_pos_opt.empty()) return std::nullopt;
2206 for (const auto& item : m_ams_mapping_result) {
2207 if (item.id == filament_logic_id) {
2208 if (suggest_pos_opt.count(item.id) != 0) return suggest_pos_opt.at(item.id);
2209 return std::nullopt;
2210 }
2211 }
2212 return std::nullopt;
2213}
std::map< int, DevFilaSwitch::SwitchPos > get_filament_suggest_pos(MachineObject *obj_) const
Definition SelectMachine.cpp:2145

References get_filament_suggest_pos(), and m_ams_mapping_result.

Here is the call graph for this function:

◆ get_mapped_filament_info()

std::optional< FilamentInfo > Slic3r::GUI::SelectMachineDialog::get_mapped_filament_info ( int fila_logic_id) const
2059{
2060 for (const auto& fila : m_ams_mapping_result)
2061 if (fila.id == fila_logic_id) return fila;
2062 return std::nullopt;
2063}

References m_ams_mapping_result.

Referenced by is_at_suggested_pos().

Here is the caller graph for this function:

◆ get_mapped_nozzle_str()

wxString Slic3r::GUI::SelectMachineDialog::get_mapped_nozzle_str ( int fila_id) const
1626{
1628 return wxEmptyString; // no slicing data when printing from sdcard
1629
1630 DeviceManager* dev = wxGetApp().getDeviceManager();
1631 if (!dev) { return wxEmptyString; }
1632 MachineObject* obj_ = dev->get_selected_machine();
1633 if (!obj_) { return wxEmptyString; }
1634
1635 DevNozzleSystem* nozzle_system = obj_->GetNozzleSystem();
1636 const bool rack_supported = nozzle_system && nozzle_system->GetNozzleRack()->IsSupported();
1637 const bool fila_switch_installed = obj_->GetFilaSwitch()->IsInstalled();
1638
1639 // A dynamic nozzle map routes filaments through the filament switcher; without one it can't map.
1640 if (use_dynamic_nozzle_map() && !fila_switch_installed)
1641 return "?";
1642
1643 if (fila_switch_installed || rack_supported) {
1644 if (rack_supported) {
1645 return obj_->get_nozzle_mapping_result()->GetMappedNozzlePosStrByFilaId(fila_id);
1646 } else {
1647 const auto& nozzle_map = get_mapped_nozzles(fila_id);
1648 if (nozzle_map.count(MAIN_EXTRUDER_ID) != 0 && nozzle_map.count(DEPUTY_EXTRUDER_ID) != 0)
1649 return "L R";
1650 else if (nozzle_map.count(MAIN_EXTRUDER_ID) != 0)
1651 return "R";
1652 else if (nozzle_map.count(DEPUTY_EXTRUDER_ID) != 0)
1653 return "L";
1654 }
1655 return "?";
1656 }
1657
1658 return wxEmptyString;
1659}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102

References DEPUTY_EXTRUDER_ID, Slic3r::GUI::FROM_NORMAL, get_mapped_nozzles(), Slic3r::MachineObject::get_nozzle_mapping_result(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetFilaSwitch(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::DevFilaSwitch::IsInstalled(), m_print_type, MAIN_EXTRUDER_ID, and use_dynamic_nozzle_map().

Referenced by on_set_finish_mapping(), reset_ams_material(), and sync_ams_mapping_result().

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

◆ get_mapped_nozzles()

std::map< int, DevNozzle > Slic3r::GUI::SelectMachineDialog::get_mapped_nozzles ( int fila_id) const
1577{
1578 std::map<int, DevNozzle> nozzle_map;
1579
1580 DeviceManager* dev = wxGetApp().getDeviceManager();
1581 if (!dev) { return nozzle_map; }
1582 MachineObject* obj_ = dev->get_selected_machine();
1583 if (!obj_) { return nozzle_map; }
1584
1585 int total_ext_count = 0;
1586 if (m_print_type == FROM_NORMAL) {
1587 const auto& full_config = wxGetApp().preset_bundle->full_config();
1588 const auto opt = full_config.option<ConfigOptionFloats>("nozzle_diameter");
1589 total_ext_count = opt ? opt->values.size() : 0;
1590 } else {
1591 const auto opt = m_required_data_config.option<ConfigOptionFloats>("nozzle_diameter");
1592 total_ext_count = opt ? opt->values.size() : 0;
1593 }
1594
1595 if (total_ext_count != obj_->GetExtderSystem()->GetTotalExtderCount()) {
1596 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": total_ext_count not match";
1597 return nozzle_map;
1598 }
1599
1600 DevNozzleSystem* nozzle_system = obj_->GetNozzleSystem();
1601 if (!nozzle_system) { return nozzle_map; }
1602
1603 if (!nozzle_system->GetNozzleRack()->IsSupported()) {
1604 if (total_ext_count == 1) {
1605 nozzle_map[MAIN_EXTRUDER_ID] = nozzle_system->GetNozzleByPosId(MAIN_EXTRUDER_ID);
1606 } else if (total_ext_count == 2) {
1607 if (fila_id >= 0 && (size_t)fila_id < m_filaments_map.size()) {
1608 if (m_filaments_map[fila_id] == 1) {
1609 nozzle_map[DEPUTY_EXTRUDER_ID] = nozzle_system->GetNozzleByPosId(DEPUTY_EXTRUDER_ID);
1610 } else if (m_filaments_map[fila_id] == 2) {
1611 nozzle_map[MAIN_EXTRUDER_ID] = nozzle_system->GetNozzleByPosId(MAIN_EXTRUDER_ID);
1612 }
1613 }
1614 }
1615 } else if (m_print_type == FROM_NORMAL) {
1616 // Rack printer (H2C): resolve the physical rack nozzle(s) the print-dispatch mapping assigned
1617 // to this filament. Empty until the printer returns the auto-mapping result.
1618 for (int nozzle_pos : obj_->get_nozzle_mapping_result()->GetMappedNozzlePosVecByFilaId(fila_id))
1619 nozzle_map[nozzle_pos] = nozzle_system->GetNozzleByPosId(nozzle_pos);
1620 }
1621
1622 return nozzle_map;
1623}
std::vector< double > values
Definition Config.hpp:418
Slic3r::DynamicPrintConfig m_required_data_config
Definition SelectMachine.hpp:352

References DEPUTY_EXTRUDER_ID, Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::get_nozzle_mapping_result(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevNozzleSystem::GetNozzleByPosId(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::DevExtderSystem::GetTotalExtderCount(), m_filaments_map, m_print_type, m_required_data_config, and MAIN_EXTRUDER_ID.

Referenced by CheckWarningFilamentCrossExtruder(), get_mapped_nozzle_str(), on_ok_btn(), and update_show_status().

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

◆ get_print_type()

PrintFromType Slic3r::GUI::SelectMachineDialog::get_print_type ( )
inline
616{return m_print_type;};

References m_print_type.

◆ get_status()

PrintDialogStatus Slic3r::GUI::SelectMachineDialog::get_status ( )
inline
618{ return m_print_status; }
PrintDialogStatus m_print_status
Definition SelectMachine.hpp:333

References m_print_status.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ has_timelapse_warning() [1/2]

bool Slic3r::GUI::SelectMachineDialog::has_timelapse_warning ( )
inline
532{ wxString msg; return has_timelapse_warning(msg);};
bool has_timelapse_warning()
Definition SelectMachine.hpp:532

References has_timelapse_warning().

Referenced by has_timelapse_warning(), and update_show_status().

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

◆ has_timelapse_warning() [2/2]

bool Slic3r::GUI::SelectMachineDialog::has_timelapse_warning ( wxString & msg)
5321{
5322 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
5323 for (auto warning : plate->get_slice_result()->warnings) {
5324 if (warning.msg == NOT_GENERATE_TIMELAPSE) {
5325 if (warning.error_code == "10014001") {
5326 msg_text = _L("When spiral vase mode is enabled, machines with I3 structure will not generate timelapse videos.");
5327 } else if (warning.error_code == "10014002") {
5328 msg_text = _L("The current printer does not support timelapse in Traditional Mode when printing By-Object.");
5329 }
5330
5331 return true;
5332 }
5333 }
5334
5335 return false;
5336}
#define NOT_GENERATE_TIMELAPSE
Definition GCodeProcessor.hpp:48

References _L, Slic3r::GUI::PartPlate::get_slice_result(), m_plater, NOT_GENERATE_TIMELAPSE, and Slic3r::GCodeProcessorResult::warnings.

Referenced by load_option_vals().

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

◆ init_bind()

void Slic3r::GUI::SelectMachineDialog::init_bind ( )
925{
926 Bind(wxEVT_TIMER, &SelectMachineDialog::on_timer, this);
927 Bind(EVT_CLEAR_IPADDRESS, &SelectMachineDialog::clear_ip_address_config, this);
928 Bind(EVT_SHOW_ERROR_INFO, [this](auto& e) {show_print_failed_info(true);});
929 Bind(EVT_UPDATE_USER_MACHINE_LIST, &SelectMachineDialog::update_printer_combobox, this);
930 Bind(EVT_PRINT_JOB_CANCEL, &SelectMachineDialog::on_print_job_cancel, this);
931 Bind(EVT_SET_FINISH_MAPPING, &SelectMachineDialog::on_set_finish_mapping, this);
932 Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
933 m_panel_prepare->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
934 m_basic_panel->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {check_fcous_state(this);e.Skip();});
935 m_bitmap_last_plate->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
936 m_bitmap_last_plate->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
937 m_bitmap_next_plate->Bind(wxEVT_ENTER_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_HAND); });
938 m_bitmap_next_plate->Bind(wxEVT_LEAVE_WINDOW, [this](auto& e) {SetCursor(wxCURSOR_ARROW); });
939
940
941 Bind(EVT_CONNECT_LAN_MODE_PRINT, [this](wxCommandEvent& e) {
942 if (e.GetInt() == 0) {
943 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
944 if (!dev) return;
945 MachineObject* obj = dev->get_selected_machine();
946 if (!obj) return;
947
948 if (obj->get_dev_id() == e.GetString()) {
949 m_printer_box->SetPrinterName(wxString::FromUTF8(obj->get_dev_name()) + _L("(LAN)"));
950 }
951 }
952 });
953
954 m_bitmap_last_plate->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
955 if (m_print_plate_idx > 0) {
959 Layout();
960 }
961 });
962
963 m_bitmap_next_plate->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
968 Layout();
969 }
970 });
971
972 m_check_ext_change_assist->Bind(wxEVT_TOGGLEBUTTON, [this](auto &e) {
973 m_ext_change_assist = e.IsChecked();
974 e.Skip();
975 });
976}
void set_default_from_sdcard()
Definition SelectMachine.cpp:6152
void update_printer_combobox(wxCommandEvent &event)
Definition SelectMachine.cpp:4182
int m_print_plate_total
Definition SelectMachine.hpp:316
void on_print_job_cancel(wxCommandEvent &evt)
Definition SelectMachine.cpp:3932
void update_page_turn_state(bool show)
Definition SelectMachine.cpp:6364
void clear_ip_address_config(wxCommandEvent &e)
Definition SelectMachine.cpp:3823
bool m_ext_change_assist
Definition SelectMachine.hpp:326
void on_set_finish_mapping(wxCommandEvent &evt)
Definition SelectMachine.cpp:3865
int m_print_plate_idx
Definition SelectMachine.hpp:315
void on_timer(wxTimerEvent &event)
Definition SelectMachine.cpp:4188

References _L, check_fcous_state(), clear_ip_address_config(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_dev_name(), Slic3r::DeviceManager::get_selected_machine(), m_basic_panel, m_bitmap_last_plate, m_bitmap_next_plate, m_check_ext_change_assist, m_ext_change_assist, m_panel_prepare, m_print_plate_idx, m_print_plate_total, m_printer_box, on_print_job_cancel(), on_set_finish_mapping(), on_timer(), set_default_from_sdcard(), show_print_failed_info(), update_page_turn_state(), and update_printer_combobox().

Referenced by SelectMachineDialog().

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

◆ init_machine_bed_types()

void Slic3r::GUI::SelectMachineDialog::init_machine_bed_types ( )
static
187{
188 if (MACHINE_BED_TYPE_STRING.size() == 0) {
189 MACHINE_BED_TYPE_STRING = {//_L("Auto"),
190 _L("Bambu Cool Plate") + " / " + _L("PLA Plate"),
191 _L("Bambu Engineering Plate"),
192 _L("Bambu Smooth PEI Plate") + "/" + _L("High temperature Plate"),
193 _L("Bambu Textured PEI Plate"),
194 _L("Bambu Cool Plate SuperTack")
195 };
196 MachineBedTypeString = {//"auto",
197 "pc", "pe", "pei", "pte", "suprtack"};
198 }
199}
static std::vector< std::string > MachineBedTypeString
Definition SelectMachine.hpp:470

References _L, MACHINE_BED_TYPE_STRING, and MachineBedTypeString.

Referenced by SelectMachineDialog(), and Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog().

Here is the caller graph for this function:

◆ init_timer()

void Slic3r::GUI::SelectMachineDialog::init_timer ( )
2594{
2595 m_refresh_timer = new wxTimer();
2596 m_refresh_timer->SetOwner(this);
2597}

References m_refresh_timer.

Referenced by SelectMachineDialog().

Here is the caller graph for this function:

◆ is_ams_drying()

bool Slic3r::GUI::SelectMachineDialog::is_ams_drying ( MachineObject * obj)
1931{
1932 const auto& ams_list = obj->GetFilaSystem()->GetAmsList();
1933 for (auto ams = ams_list.begin(); ams != ams_list.end(); ams++) {
1934 if (ams->second->AmsIsDrying()) {
1935 return true;
1936 }
1937 }
1938
1939 return false;
1940}

References Slic3r::MachineObject::GetFilaSystem().

Here is the call graph for this function:

◆ is_at_suggested_pos()

bool Slic3r::GUI::SelectMachineDialog::is_at_suggested_pos ( MachineObject * obj_,
int fila_logic_id ) const
2216{
2217 auto opt = get_filament_suggest_pos(obj_, filament_logic_id);
2218 if (!opt.has_value()) return true;
2219 const auto& mapped_filament_info = get_mapped_filament_info(filament_logic_id);
2220 if (mapped_filament_info.has_value()) {
2221 const auto& ams_item = obj_->GetFilaSystem()->GetAmsById(mapped_filament_info->ams_id);
2222 if (ams_item)
2223 return ams_item->GetSwitcherPos() == opt;
2224 }
2225 return true;
2226}
std::optional< FilamentInfo > get_mapped_filament_info(int fila_logic_id) const
Definition SelectMachine.cpp:2058

References get_filament_suggest_pos(), get_mapped_filament_info(), and Slic3r::MachineObject::GetFilaSystem().

Referenced by on_reselect_dialog_btn_clicked(), refresh_save_time(), and update_best_pos_dialog().

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

◆ is_blocking_printing()

bool Slic3r::GUI::SelectMachineDialog::is_blocking_printing ( MachineObject * obj_)
2612{
2614 return wxGetApp().is_blocking_printing(obj_);
2615
2616 std::string source_model;
2618 source_model = m_required_data_plate_data_list[m_print_plate_idx]->printer_model_id;
2619 return wxGetApp().is_blocking_printing(obj_, source_model);
2620}
Slic3r::PlateDataPtrs m_required_data_plate_data_list
Definition SelectMachine.hpp:354

References Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, m_print_plate_idx, m_print_type, and m_required_data_plate_data_list.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ is_enable_external_change_assist()

bool Slic3r::GUI::SelectMachineDialog::is_enable_external_change_assist ( std::vector< FilamentInfo > & ams_mapping_result)
private
3180 {
3181 // if (_HasAms(ams_mapping_result)) return false;
3182
3183 std::map<std::string, int> v_ams_map;
3184 v_ams_map[VIRTUAL_AMS_MAIN_ID_STR] = 0;
3185 v_ams_map[VIRTUAL_AMS_DEPUTY_ID_STR] = 0;
3186 for(auto info : m_ams_mapping_result){
3187 v_ams_map[info.ams_id]++;
3188 }
3189 return (v_ams_map[VIRTUAL_AMS_MAIN_ID_STR] > 1) || (v_ams_map[VIRTUAL_AMS_DEPUTY_ID_STR] > 1);
3190}
#define VIRTUAL_AMS_DEPUTY_ID_STR
Definition DevDefs.h:93
#define VIRTUAL_AMS_MAIN_ID_STR
Definition DevDefs.h:92

References m_ams_mapping_result, VIRTUAL_AMS_DEPUTY_ID_STR, and VIRTUAL_AMS_MAIN_ID_STR.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ is_nozzle_hrc_matched()

bool Slic3r::GUI::SelectMachineDialog::is_nozzle_hrc_matched ( const DevExtder * extruder,
std::string & filament_type ) const
2659{
2660 if (extruder == nullptr) return false;
2661
2662 auto printer_nozzle_type = extruder->GetNozzleType();
2663
2664 // Assume matching if nozzle type unknown
2665 if (printer_nozzle_type == NozzleType::ntUndefine) {
2666 return true;
2667 }
2668
2669 auto printer_nozzle_hrc = Print::get_hrc_by_nozzle_type(printer_nozzle_type);
2670
2671 auto preset_bundle = wxGetApp().preset_bundle;
2672 MaterialHash::const_iterator iter = m_materialList.begin();
2673 while (iter != m_materialList.end()) {
2674 Material* item = iter->second;
2675 MaterialItem* m = item->item;
2676 auto filament_nozzle_hrc = preset_bundle->get_required_hrc_by_filament_type(m->m_material_name.ToStdString());
2677
2678 if (abs(filament_nozzle_hrc) > abs(printer_nozzle_hrc)) {
2679 filament_type = m->m_material_name.ToStdString();
2680 BOOST_LOG_TRIVIAL(info) << "filaments hardness mismatch: filament = " << filament_type << " printer_nozzle_hrc = " << printer_nozzle_hrc;
2681 return false;
2682 }
2683
2684 iter++;
2685 }
2686
2687 return true;
2688}
static int get_hrc_by_nozzle_type(const NozzleType &type)
Definition Print.cpp:4570
zaa_minimize_perimeter_height filament_type((ConfigOptionBools, filament_soluble))((ConfigOptionStrings
@ ntUndefine
Definition CommonDefs.hpp:14

References Slic3r::filament_type(), Slic3r::Print::get_hrc_by_nozzle_type(), Slic3r::DevExtder::GetNozzleType(), Slic3r::GUI::Material::item, Slic3r::GUI::MaterialItem::m_material_name, m_materialList, and Slic3r::ntUndefine.

Referenced by update_show_status().

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

◆ is_same_printer_model()

bool Slic3r::GUI::SelectMachineDialog::is_same_printer_model ( )
2691{
2692 bool result = true;
2693 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2694 if (!dev) return result;
2695
2696 MachineObject* obj_ = dev->get_selected_machine();
2697
2698 assert(obj_->get_dev_id() == m_printer_last_select);
2699 if (obj_ == nullptr) {
2700 return result;
2701 }
2702
2703 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
2704 if(preset_bundle == nullptr) return result;
2705 const auto source_model = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
2706 const auto target_model = obj_->printer_type;
2709 return true;
2710 }
2711 // Orca: ignore P1P -> P1S
2712 if (source_model != target_model) {
2713 if ((source_model == "C12" && target_model == "C11") || (source_model == "C11" && target_model == "C12") ||
2714 ((obj_->is_support_upgrade_kit && obj_->installed_upgrade_kit) && (source_model == "C12"))) {
2715 return true;
2716 }
2717
2718 BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << source_model;
2719 BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << target_model;
2720 return false;
2721 }
2722
2723 if (obj_->is_support_upgrade_kit && obj_->installed_upgrade_kit) {
2724 BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << source_model;
2725 BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << obj_->printer_type << " (plus)";
2726 return false;
2727 }
2728 return true;
2729}
static bool is_optional_printer_model_id(const std::string &model_id)
Definition DevConfigUtil.h:69
std::string m_printer_last_select
Definition SelectMachine.hpp:330

References Slic3r::MachineObject::get_dev_id(), Slic3r::PresetCollection::get_edited_preset(), Slic3r::Preset::get_printer_type(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::installed_upgrade_kit, Slic3r::DevPrinterConfigUtil::is_optional_printer_model_id(), Slic3r::MachineObject::is_support_upgrade_kit, m_printer_last_select, Slic3r::MachineObject::printer_type, and Slic3r::PresetBundle::printers.

Referenced by on_ok_btn().

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

◆ is_selected_ams_drying()

bool Slic3r::GUI::SelectMachineDialog::is_selected_ams_drying ( MachineObject * obj)
1943{
1944 if (!obj) return false;
1945
1946 // If a UI material is selected, only when that material is mapped to an AMS
1947 // and that AMS is currently drying.
1948 for (const auto &kv : m_materialList) {
1949 Material *mat = kv.second;
1950 if (!mat || !mat->item) continue;
1951 if (!mat->item->m_selected) continue;
1952
1953 // find mapping entry for this material id
1954 for (const FilamentInfo &f : m_ams_mapping_result) {
1955 if (f.id != mat->id) continue;
1956
1957 if (f.ams_id.empty()) return false;
1958
1959 auto fila_system = obj->GetFilaSystem();
1960 if (!fila_system) return false;
1961 DevAms* dev_ams = fila_system->GetAmsById(f.ams_id);
1962 return (dev_ams && dev_ams->AmsIsDrying());
1963 }
1964
1965 return false;
1966 }
1967
1968 return false;
1969}
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124

References Slic3r::DevAms::AmsIsDrying(), Slic3r::f(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, m_ams_mapping_result, m_materialList, and Slic3r::GUI::MaterialItem::m_selected.

Referenced by update_show_status().

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

◆ is_timeout()

bool Slic3r::GUI::SelectMachineDialog::is_timeout ( )
3943{
3944 if (m_timeout_count > 15 * 1000 / LIST_REFRESH_INTERVAL) {
3945 return true;
3946 }
3947 return false;
3948}
#define LIST_REFRESH_INTERVAL
Definition CalibrationPanel.cpp:46
int m_timeout_count
Definition SelectMachine.hpp:317

References LIST_REFRESH_INTERVAL, and m_timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ is_used_filament()

bool Slic3r::GUI::SelectMachineDialog::is_used_filament ( int fila_logic_id) const
2066{
2067 for (const auto& fila : m_ams_mapping_result)
2068 if (fila.id == fila_logic_id) return true;
2069 return false;
2070}

References m_ams_mapping_result.

Referenced by get_filament_suggest_pos().

Here is the caller graph for this function:

◆ load_option_vals()

void Slic3r::GUI::SelectMachineDialog::load_option_vals ( MachineObject * obj)
private
3193{
3194 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " start"
3195 << ", dev_id = " << (obj ? obj->get_dev_id() : "NULL")
3196 << ", sending mode= " << m_is_in_sending_mode;
3197
3198 if (m_is_in_sending_mode) { return;}
3199
3200 AppConfig* config = wxGetApp().app_config;
3201 if (!config) return;
3202 if (!obj) return;
3203
3204 for (auto item : m_checkbox_list) {
3205 PrintOption *opt = item.second;
3206 const std::string &val = config->get(obj->printer_type, item.first);
3207 if (opt->contain_opt(val)) {
3208 opt->setValue(val);
3209 } else if (opt->contain_opt("auto")) {
3210 opt->setValue("auto");
3211 } else if (opt->contain_opt("on")) {
3212 opt->setValue("on");
3213 }
3214 }
3215
3216 /*STUDIO-9197*/
3217 wxString error_messgae;
3218 if (obj->canEnableTimelapse(error_messgae) && !has_timelapse_warning(error_messgae)) {
3219 m_checkbox_list["timelapse"]->enable(true);
3220 m_checkbox_list["timelapse"]->update_tooltip(wxEmptyString);
3221 } else {
3222 m_checkbox_list["timelapse"]->enable(false);
3223 m_checkbox_list["timelapse"]->setValue("off");
3224 m_checkbox_list["timelapse"]->update_tooltip(error_messgae);
3225 }
3226}
bool has_timelapse_warning(wxString &msg)
Definition SelectMachine.cpp:5320

References Slic3r::MachineObject::canEnableTimelapse(), Slic3r::AppConfig::get(), Slic3r::MachineObject::get_dev_id(), has_timelapse_warning(), m_checkbox_list, m_is_in_sending_mode, and Slic3r::MachineObject::printer_type.

Referenced by on_timer(), and update_select_layout().

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

◆ navigate_to_timelapse_page()

void Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page ( )
private
3547{
3549
3550 // EndModal closes the dialog; schedule navigation after the dialog is fully destroyed
3551 wxGetApp().CallAfter([]() {
3552 auto* main_frame = wxGetApp().mainframe;
3553 if (!main_frame) return;
3554
3555 // use existing jump_to_monitor to switch to Monitor tab
3556 main_frame->jump_to_monitor();
3557
3558 // then switch to Storage (Media) tab inside Monitor
3559 MonitorPanel* monitor = MonitorPanel::if_built();
3560 if (monitor) {
3561 auto* tabpanel = monitor->get_tabpanel();
3562 if (tabpanel) {
3563 tabpanel->SetSelection(MonitorPanel::PT_MEDIA);
3564 }
3565 }
3566 });
3567
3568 this->EndModal(wxID_CANCEL);
3569}
static MonitorPanel * if_built()
Definition Lazy.hpp:183
@ PT_MEDIA
Definition Monitor.hpp:112

References Slic3r::GUI::DPIDialog::EndModal(), Slic3r::GUI::MonitorPanel::get_tabpanel(), Slic3r::GUI::LazyInstance< MonitorPanel >::if_built(), m_timelapse_check_timer, and Slic3r::GUI::MonitorPanel::PT_MEDIA.

Referenced by check_timelapse_storage_warning(), and show_timelapse_storage_dialog().

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

◆ normal_font()

◆ on_cancel()

void Slic3r::GUI::SelectMachineDialog::on_cancel ( wxCloseEvent & event)
2600{
2601 if (m_mapping_popup.IsShown())
2602 m_mapping_popup.Dismiss();
2603
2606
2607 m_worker->cancel_all();
2608 this->EndModal(wxID_CANCEL);
2609}

References Slic3r::GUI::DPIDialog::EndModal(), m_mapping_popup, m_timelapse_check_timer, and m_worker.

Referenced by SelectMachineDialog().

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

◆ on_dpi_changed()

void Slic3r::GUI::SelectMachineDialog::on_dpi_changed ( const wxRect & suggested_rect)
overridevirtual

Implements Slic3r::GUI::DPIAware< wxDialog >.

5399{
5400 print_time->msw_rescale();
5401 timeimg->SetBitmap(print_time->bmp());
5402 print_weight->msw_rescale();
5403 weightimg->SetBitmap(print_weight->bmp());
5404 rename_editable->msw_rescale();
5405 rename_editable_light->msw_rescale();
5406 if (ams_mapping_help_icon != nullptr) {
5407 ams_mapping_help_icon->msw_rescale();
5409 }
5410 m_button_ensure->Rescale(); // ORCA
5411 m_status_bar->msw_rescale();
5412
5413 for (auto material1 : m_materialList) {
5414 material1.second->item->msw_rescale();
5415 }
5416
5417 for(auto opt : m_checkbox_list)
5418 {
5419 opt.second->msw_rescale();
5420 }
5421
5422 m_mapping_popup.msw_rescale();
5423
5424 Fit();
5425 Refresh();
5426}
ScalableBitmap * ams_mapping_help_icon
Definition SelectMachine.hpp:442
wxStaticBitmap * img_amsmapping_tip
Definition SelectMachine.hpp:395

References ams_mapping_help_icon, img_amsmapping_tip, m_button_ensure, m_checkbox_list, m_mapping_popup, m_materialList, m_status_bar, print_time, print_weight, rename_editable, rename_editable_light, timeimg, and weightimg.

◆ on_flow_cali_option_changed()

void Slic3r::GUI::SelectMachineDialog::on_flow_cali_option_changed ( )
1754{
1755 DeviceManager* dev = wxGetApp().getDeviceManager();
1756 MachineObject* obj_ = dev ? dev->get_selected_machine() : nullptr;
1757 if (!obj_) return;
1758
1759 // Orca: the PA-profile-sharing toggle is shown only while Flow Dynamics Calibration is off,
1760 // so its visibility must track flow_cali changes (for every pa_mode printer, rack or not).
1763 m_options_other->Layout();
1764 Layout();
1765
1766 // Flow calibration feeds the printer-side rack nozzle-mapping computation, so a change must
1767 // invalidate the cached mapping and let the next status poll re-request it (V0 path).
1768 if (!(obj_->GetNozzleSystem() && obj_->GetNozzleSystem()->GetNozzleRack()->IsSupported())) return;
1769 if (use_dynamic_nozzle_map()) return;
1772}
void clear_nozzle_mapping()
Definition SelectMachine.cpp:1732
void update_options_layout()
Definition SelectMachine.cpp:3079
void update_pa_value_option(MachineObject *obj)
Definition SelectMachine.cpp:1741

References clear_nozzle_mapping(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), m_options_other, Slic3r::GUI::s_nozzle_mapping_last_request_time, update_options_layout(), update_pa_value_option(), and use_dynamic_nozzle_map().

Referenced by SelectMachineDialog().

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

◆ on_ok_btn()

void Slic3r::GUI::SelectMachineDialog::on_ok_btn ( wxCommandEvent & event)
2739{
2740 bool has_slice_warnings = false;
2741 bool is_printing_block = false;
2742
2743 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2744 if (!dev) return;
2745 MachineObject* obj_ = dev->get_selected_machine();
2746 if (!obj_) return;
2747
2748 std::vector<ConfirmBeforeSendInfo> confirm_text;
2749
2750 // check more than one using in same external spool
2751 std::unordered_set<std::string> main_external_spool_filas;
2752 std::unordered_set<std::string> deputy_external_spool_filas;
2753 for (const auto& mapping_info : m_ams_mapping_result) {
2754 if (mapping_info.ams_id == VIRTUAL_AMS_MAIN_ID_STR){
2755 main_external_spool_filas.insert(mapping_info.filament_id);
2756 } else if (mapping_info.ams_id == VIRTUAL_AMS_DEPUTY_ID_STR) {
2757 deputy_external_spool_filas.insert(mapping_info.filament_id);
2758 }
2759 }
2760
2761 if (main_external_spool_filas.size() > 1 || deputy_external_spool_filas.size() > 1) {
2762 if(!m_ext_change_assist ){
2763 confirm_text.push_back(ConfirmBeforeSendInfo(_L("More than one filament types have been mapped to the same external spool, which may cause printing issues. The printer won't pause during printing.")));
2764 has_slice_warnings = true;
2765 }
2766 } else {
2767 //check filaments type in external spool
2768 for (const auto& mapping_info : m_ams_mapping_result) {
2769 if (mapping_info.ams_id != VIRTUAL_AMS_MAIN_ID_STR && mapping_info.ams_id != VIRTUAL_AMS_DEPUTY_ID_STR) {
2770 continue;
2771 }
2772
2773 const auto& mapped_fila_type = obj_->get_filament_type(mapping_info.ams_id, mapping_info.slot_id);
2774 if (!mapped_fila_type.empty() && (mapped_fila_type != mapping_info.type)) {
2775 confirm_text.push_back(ConfirmBeforeSendInfo(_L("The filament type setting of external spool is different from the filament in the slicing file.")));
2776 has_slice_warnings = true;
2777 break;
2778 }
2779 }
2780 }
2781
2782 //Check Printer Model Id
2783 bool is_same_printer_type = is_same_printer_model();
2784 if (!is_same_printer_type && (m_print_type == PrintFromType::FROM_NORMAL)) {
2785 confirm_text.push_back(ConfirmBeforeSendInfo(_L("The printer type selected when generating G-code is not consistent with the currently selected printer. It is recommended that you use the same printer type for slicing.")));
2786 has_slice_warnings = true;
2787 }
2788
2789 //check blacklist
2790 for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
2791
2792 const auto& ams_id = m_ams_mapping_result[i].get_ams_id();
2793 const auto& slot_id = m_ams_mapping_result[i].get_slot_id();
2794
2795 auto tid = m_ams_mapping_result[i].tray_id;
2796
2797 std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
2798 std::string filament_brand;
2799
2800 for (auto fs : m_filaments) {
2801 if (fs.id == m_ams_mapping_result[i].id) {
2802 filament_brand = m_filaments[i].brand;
2803 }
2804 }
2805
2806 DevFilaBlacklist::CheckFilamentInfo check_info;
2807 check_info.dev_id = obj_->get_dev_id();
2808 check_info.model_id = obj_->printer_type;
2809 check_info.fila_id = m_ams_mapping_result[i].filament_id;
2810 check_info.fila_type = filament_type;
2811 check_info.fila_vendor = filament_brand;
2812 // Populate fila_name so the high-flow warning strings (blacklist rules 14/15/18/19,
2813 // "%s has a risk of nozzle clogging ...") render with the filament name instead of a
2814 // leading blank. Resolves the same preset the engine's internal AMS-name recovery uses, so
2815 // blacklist name-matching is unchanged.
2816 if (auto option = wxGetApp().preset_bundle->get_filament_by_filament_id(check_info.fila_id))
2817 check_info.fila_name = option->filament_name;
2818 check_info.ams_id = ams_id;
2819 check_info.slot_id = slot_id;
2820 check_info.has_filament_switch = obj_->GetFilaSwitch()->IsInstalled();
2821
2822 std::vector<DevNozzle> mapped_nozzles;
2823 for (const auto &[pos_id, nozzle] : get_mapped_nozzles(m_ams_mapping_result[i].id)) {
2824 if (!nozzle.IsEmpty()) { mapped_nozzles.push_back(nozzle); }
2825 }
2826
2827 // Evaluate the blacklist once per resolved physical nozzle so the high-flow
2828 // nozzle_flows/nozzle_diameters rules match against the real nozzle. If no nozzle context is
2829 // resolvable (a non-rack printer, or a rack filament not yet mapped by the print-dispatch
2830 // mapping), evaluate once with the nozzle fields unset so the non-nozzle rules still fire as
2831 // before (empty nozzle_flow never matches a nozzle_flows rule).
2832 const size_t iterations = mapped_nozzles.empty() ? 1 : mapped_nozzles.size();
2833 for (size_t n = 0; n < iterations; ++n) {
2834 if (n < mapped_nozzles.size()) {
2835 const DevNozzle &nozzle = mapped_nozzles[n];
2836 check_info.extruder_id = nozzle.GetExtruderId();
2837 check_info.nozzle_flow = DevNozzle::GetNozzleFlowTypeString(nozzle.GetNozzleFlowType());
2838 check_info.nozzle_diameter = nozzle.GetNozzleDiameter();
2839 }
2840
2841 const auto &result = DevFilaBlacklist::check_filaments_in_blacklist(check_info);
2842 if (const auto &warning_items = result.get_items_by_action("warning"); !warning_items.empty()) {
2843 for (const auto &item : warning_items) {
2844 confirm_text.push_back(ConfirmBeforeSendInfo(item.info_msg, item.wiki_url));
2845 has_slice_warnings = true;
2846 }
2847 }
2848 }
2849 }
2850
2851 PartPlate* plate = m_plater->get_partplate_list().get_curr_plate();
2852
2853 bool has_show_traditional_timelapse_waring = false;
2854 for (auto warning : plate->get_slice_result()->warnings) {
2855 if (warning.msg == NOT_SUPPORT_TRADITIONAL_TIMELAPSE) {
2856 if (!has_show_traditional_timelapse_waring && (m_checkbox_list["timelapse"]->getValue() == "on")) {
2857 confirm_text.push_back(ConfirmBeforeSendInfo(Plater::get_slice_warning_string(warning)));
2858 has_show_traditional_timelapse_waring = true;
2859 has_slice_warnings = true;
2860 }
2861 }
2862 else if (warning.msg == SMOOTH_TIMELAPSE_WITHOUT_PRIME_TOWER) {
2863 if (m_checkbox_list["timelapse"]->getValue() == "on") {
2864 confirm_text.push_back(ConfirmBeforeSendInfo(Plater::get_slice_warning_string(warning)));
2865 has_slice_warnings = true;
2866 }
2867 }
2868 else if (warning.msg == NOT_GENERATE_TIMELAPSE) {
2869 continue;
2870 }
2871 else if(warning.msg == NOZZLE_HRC_CHECKER){
2872 wxString error_info = Plater::get_slice_warning_string(warning);
2873 if (error_info.IsEmpty()) {
2874 error_info = wxString::Format("%s\n", warning.msg);
2875 }
2876
2877 confirm_text.push_back(ConfirmBeforeSendInfo(error_info));
2878 has_slice_warnings = true;
2879 }
2880 }
2881
2882
2883 //check for unidentified material
2884 auto mapping_result = m_mapping_popup.parse_ams_mapping(obj_->GetFilaSystem()->GetAmsList());
2885 auto has_unknown_filament = false;
2886
2887 for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
2888
2889 const auto& ams_id = m_ams_mapping_result[i].get_ams_id();
2890 const auto& slot_id = m_ams_mapping_result[i].get_slot_id();
2891
2892 auto tid = m_ams_mapping_result[i].tray_id;
2893
2894 std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
2895 std::string filament_brand;
2896 std::string filament_id;
2897
2898 for (auto fs : m_filaments) {
2899 if (fs.id == m_ams_mapping_result[i].id) {
2900 filament_brand = m_filaments[i].brand;
2901 filament_id = m_filaments[i].filament_id;
2902 }
2903 }
2904
2905 for (auto miter : mapping_result) {
2906 //matching
2907 if (miter.id == tid) {
2908 if (miter.type == TrayType::THIRD || miter.type == TrayType::EMPTY) {
2909 has_unknown_filament = true;
2910 break;
2911 }
2912 }
2913 }
2914 }
2915
2916 if (has_unknown_filament) {
2917 has_slice_warnings = true;
2918 confirm_text.push_back(ConfirmBeforeSendInfo(_L("There are some unknown filaments in the AMS mappings. Please check whether they are the required filaments. If they are okay, click \"Confirm\" to start printing.")));
2919 }
2920
2921 if (has_slice_warnings)
2922 {
2923 ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Warning"));
2924 if (is_printing_block)
2925 {
2926 confirm_dlg.hide_button_ok();
2927 confirm_dlg.edit_cancel_button_txt(_L("Close"), true);
2928 }
2929 confirm_dlg.Bind(EVT_SECONDARY_CHECK_CONFIRM, [this, &confirm_dlg](wxCommandEvent& e)
2930 {
2931 confirm_dlg.on_hide();
2932 this->on_send_print();
2933 });
2934
2935 // STUDIO-9580
2936 /* use warning color if there are warning and normal messages*/
2937 /* use indexes if there are several messages*/
2938 /* add header and ending if there are several messages or has none block warnings*/
2939 if (confirm_text.size() > 1 || !is_printing_block)
2940 {
2941 bool has_warning_msg = false;
2942 bool has_normal_msg = false;
2943
2944 if (confirm_text.size() > 1) {
2945 std::unordered_set<wxString> seen_texts;
2946 std::vector<ConfirmBeforeSendInfo> unique_texts;
2947
2948 for (const auto &item : confirm_text) {
2949 if (seen_texts.insert(item.text).second)
2950 {
2951 unique_texts.push_back(item);
2952 }
2953 }
2954
2955 for (size_t i = 0; i < unique_texts.size(); ++i) {
2956 unique_texts[i].text = wxString::Format("%d. %s", i + 1, unique_texts[i].text);
2957 if (unique_texts[i].level == ConfirmBeforeSendInfo::InfoLevel::Warning)
2958 has_warning_msg = true;
2959 else
2960 has_normal_msg = true;
2961 }
2962 confirm_text.swap(unique_texts);
2963 }
2964
2965 std::vector<ConfirmBeforeSendInfo> shown_infos;
2966 shown_infos.emplace_back(ConfirmBeforeSendInfo(_L("Please check the following:")));
2967 for (const auto& item : confirm_text)
2968 {
2969 shown_infos.emplace_back(item);
2970 }
2971
2972 if (is_printing_block)
2973 {
2974 shown_infos.emplace_back(ConfirmBeforeSendInfo(_L("Please fix the error above, otherwise printing cannot continue."), wxEmptyString, ConfirmBeforeSendInfo::InfoLevel::Warning));
2975 }
2976 else
2977 {
2978 shown_infos.emplace_back(ConfirmBeforeSendInfo(_L("Please click the confirm button if you still want to proceed with printing.")));
2979 }
2980
2981 confirm_dlg.update_text(shown_infos, has_warning_msg&& has_normal_msg);
2982 }
2983 else
2984 {
2985 confirm_dlg.update_text(confirm_text, false);
2986 }
2987
2988 confirm_dlg.on_show();
2989 }
2990 else
2991 {
2992 // if machine supports internal timelapse and timelapse is on, check storage first
2993 if (obj_->is_support_internal_timelapse &&
2994 m_checkbox_list["timelapse"]->IsShown() &&
2995 m_checkbox_list["timelapse"]->getValue() == "on" &&
2996 !m_timelapse_storage.empty())
2997 {
2999 } else {
3000 this->on_send_print();
3001 }
3002 }
3003}
#define SMOOTH_TIMELAPSE_WITHOUT_PRIME_TOWER
Definition GCodeProcessor.hpp:49
#define NOT_SUPPORT_TRADITIONAL_TIMELAPSE
Definition GCodeProcessor.hpp:47
#define NOZZLE_HRC_CHECKER
Definition GCodeProcessor.hpp:45
static CheckResult check_filaments_in_blacklist(const CheckFilamentInfo &info)
Definition DevFilaBlackList.cpp:406
static wxString get_slice_warning_string(GCodeProcessorResult::SliceWarning &warning)
Definition Plater.cpp:8537
void start_timelapse_storage_check(MachineObject *obj)
Definition SelectMachine.cpp:3380
bool is_same_printer_model()
Definition SelectMachine.cpp:2690
void on_send_print()
Definition SelectMachine.cpp:3571
@ THIRD
Definition AmsMappingPopup.hpp:73
@ EMPTY
Definition AmsMappingPopup.hpp:74
static std::string GetNozzleFlowTypeString(NozzleFlowType type)
Definition DevNozzleSystem.cpp:81
@ Warning
Definition ReleaseNote.hpp:245

References _L, Slic3r::DevFilaBlacklist::CheckFilamentInfo::ams_id, Slic3r::DevFilaBlacklist::check_filaments_in_blacklist(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::dev_id, Slic3r::GUI::ConfirmBeforeSendDialog::edit_cancel_button_txt(), Slic3r::GUI::EMPTY, Slic3r::DevFilaBlacklist::CheckFilamentInfo::extruder_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_name, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_type, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_vendor, Slic3r::filament_type(), Slic3r::GUI::FROM_NORMAL, Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_filament_type(), get_mapped_nozzles(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::GUI::PartPlate::get_slice_result(), Slic3r::GUI::Plater::get_slice_warning_string(), Slic3r::DevNozzle::GetExtruderId(), Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevNozzle::GetNozzleDiameter(), Slic3r::DevNozzle::GetNozzleFlowType(), Slic3r::DevNozzle::GetNozzleFlowTypeString(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::has_filament_switch, Slic3r::GUI::ConfirmBeforeSendDialog::hide_button_ok(), is_same_printer_model(), Slic3r::MachineObject::is_support_internal_timelapse, Slic3r::DevFilaSwitch::IsInstalled(), m_ams_mapping_result, m_checkbox_list, m_ext_change_assist, m_filaments, m_mapping_popup, m_plater, m_print_type, m_timelapse_storage, Slic3r::DevFilaBlacklist::CheckFilamentInfo::model_id, NOT_GENERATE_TIMELAPSE, NOT_SUPPORT_TRADITIONAL_TIMELAPSE, Slic3r::DevFilaBlacklist::CheckFilamentInfo::nozzle_diameter, Slic3r::DevFilaBlacklist::CheckFilamentInfo::nozzle_flow, NOZZLE_HRC_CHECKER, Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), on_send_print(), Slic3r::GUI::ConfirmBeforeSendDialog::on_show(), Slic3r::MachineObject::printer_type, Slic3r::DevFilaBlacklist::CheckFilamentInfo::slot_id, SMOOTH_TIMELAPSE_WITHOUT_PRIME_TOWER, start_timelapse_storage_check(), Slic3r::GUI::THIRD, Slic3r::GUI::ConfirmBeforeSendDialog::update_text(), VIRTUAL_AMS_DEPUTY_ID_STR, VIRTUAL_AMS_MAIN_ID_STR, Slic3r::GUI::ConfirmBeforeSendInfo::Warning, and Slic3r::GCodeProcessorResult::warnings.

Referenced by SelectMachineDialog().

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

◆ on_pa_value_option_changed()

void Slic3r::GUI::SelectMachineDialog::on_pa_value_option_changed ( )
1775{
1776 // Orca: the PA-sharing value feeds the printer-side rack nozzle-mapping request (V0), so a
1777 // change must invalidate the cached mapping and let the next status poll re-request it.
1778 DeviceManager* dev = wxGetApp().getDeviceManager();
1779 MachineObject* obj_ = dev ? dev->get_selected_machine() : nullptr;
1780 if (!obj_ || !(obj_->GetNozzleSystem() && obj_->GetNozzleSystem()->GetNozzleRack()->IsSupported())) return;
1781 if (use_dynamic_nozzle_map()) return;
1784}

References clear_nozzle_mapping(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::GUI::s_nozzle_mapping_last_request_time, and use_dynamic_nozzle_map().

Referenced by SelectMachineDialog().

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

◆ on_print_job_cancel()

void Slic3r::GUI::SelectMachineDialog::on_print_job_cancel ( wxCommandEvent & evt)
3933{
3934 BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
3935
3936 EnableEditing(true);
3938 // enter prepare mode
3939 prepare_mode();
3940}
@ PrintStatusInit
Definition PrePrintChecker.hpp:56

References EnableEditing(), prepare_mode(), Slic3r::GUI::PrintStatusInit, and show_status().

Referenced by init_bind().

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

◆ on_refresh()

void Slic3r::GUI::SelectMachineDialog::on_refresh ( wxCommandEvent & event)
3859{
3860 BOOST_LOG_TRIVIAL(info) << "m_printer_last_select: on_refresh";
3863}
void update_user_machine_list()
Definition SelectMachine.cpp:3828
@ PrintStatusRefreshingMachineList
Definition PrePrintChecker.hpp:74

References Slic3r::GUI::PrintStatusRefreshingMachineList, show_status(), and update_user_machine_list().

Referenced by Slic3r::GUI::PrinterInfoBox::Create().

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

◆ on_rename_click()

void Slic3r::GUI::SelectMachineDialog::on_rename_click ( wxMouseEvent & event)
4097{
4098 m_is_rename_mode = true;
4099 m_rename_input->GetTextCtrl()->SetValue(m_current_project_name);
4100 m_rename_switch_panel->SetSelection(1);
4101 m_rename_input->GetTextCtrl()->SetFocus();
4102 m_rename_input->GetTextCtrl()->SetInsertionPointEnd();
4103}
bool m_is_rename_mode
Definition SelectMachine.hpp:324

References m_current_project_name, m_is_rename_mode, m_rename_input, m_rename_switch_panel, and Slic3r::GUI::wxMouseEvent.

Referenced by SelectMachineDialog().

Here is the caller graph for this function:

◆ on_rename_enter()

void Slic3r::GUI::SelectMachineDialog::on_rename_enter ( )
4106{
4107 if (m_is_rename_mode == false){
4108 return;
4109 }
4110 else {
4111 m_is_rename_mode = false;
4112 }
4113
4114 auto new_file_name = m_rename_input->GetTextCtrl()->GetValue();
4115 wxString temp;
4116 int num = 0;
4117 for (auto t : new_file_name) {
4118 if (t == wxString::FromUTF8("\x20")) {
4119 num++;
4120 if (num == 1) temp += t;
4121 } else {
4122 num = 0;
4123 temp += t;
4124 }
4125 }
4126 new_file_name = temp;
4127 auto m_valid_type = Valid;
4128 wxString info_line;
4129
4130 const char* unusable_symbols = "<>[]:/\\|?*\"";
4131
4132 const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)";
4133 for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {
4134 if (new_file_name.find_first_of(unusable_symbols[i]) != std::string::npos) {
4135 info_line = _L("Name is invalid;") + "\n" + _L("illegal characters:") + " " + unusable_symbols;
4136 m_valid_type = NoValid;
4137 break;
4138 }
4139 }
4140
4141 if (m_valid_type == Valid && new_file_name.find(unusable_suffix) != std::string::npos) {
4142 info_line = _L("Name is invalid;") + "\n" + _L("illegal suffix:") + "\n\t" + from_u8(PresetCollection::get_suffix_modified());
4143 m_valid_type = NoValid;
4144 }
4145
4146 if (m_valid_type == Valid && new_file_name.empty()) {
4147 info_line = _L("The name field is not allowed to be empty.");
4148 m_valid_type = NoValid;
4149 }
4150
4151 if (m_valid_type == Valid && new_file_name.find_first_of(' ') == 0) {
4152 info_line = _L("The name is not allowed to start with a space.");
4153 m_valid_type = NoValid;
4154 }
4155
4156 if (m_valid_type == Valid && new_file_name.find_last_of(' ') == new_file_name.length() - 1) {
4157 info_line = _L("The name is not allowed to end with a space.");
4158 m_valid_type = NoValid;
4159 }
4160
4161 if (m_valid_type == Valid && new_file_name.size() >= 100) {
4162 info_line = _L("The name length exceeds the limit.");
4163 m_valid_type = NoValid;
4164 }
4165
4166 if (m_valid_type != Valid) {
4167 MessageDialog msg_wingow(nullptr, info_line, "", wxICON_WARNING | wxOK);
4168 if (msg_wingow.ShowModal() == wxID_OK) {
4169 m_rename_switch_panel->SetSelection(0);
4171 m_rename_normal_panel->Layout();
4172 return;
4173 }
4174 }
4175
4176 m_current_project_name = new_file_name;
4177 m_rename_switch_panel->SetSelection(0);
4179 m_rename_normal_panel->Layout();
4180}
@ NoValid
Definition Auxiliary.hpp:87
@ Valid
Definition Auxiliary.hpp:87
static const std::string & get_suffix_modified()
Definition Preset.cpp:3766
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References _L, Slic3r::GUI::from_u8(), Slic3r::PresetCollection::get_suffix_modified(), m_current_project_name, m_is_rename_mode, m_rename_input, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, NoValid, Slic3r::GUI::DPIAware< P >::ShowModal(), and Valid.

Referenced by SelectMachineDialog(), and check_fcous_state().

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

◆ on_reselect_dialog_btn_clicked()

void Slic3r::GUI::SelectMachineDialog::on_reselect_dialog_btn_clicked ( wxMouseEvent & )
2254{
2255 BOOST_LOG_TRIVIAL(info) << __FUNCTION__;
2256 DeviceManager* dev = wxGetApp().getDeviceManager();
2257 MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
2258 if (!obj) return;
2259 if (m_best_pos_dialog == nullptr)
2260 m_best_pos_dialog = new ReselectMachineDialog(static_cast<wxWindow*>(this));
2261
2262 auto save_time = get_filament_change_gap_time(obj);
2263 wxString text{};
2264 if (save_time.has_value() && save_time.value() >= 1)
2265 text = FormatTime(*save_time);
2266
2267 std::map<int, int> best_pos_map; // key: logic id, value: pos id
2268 for (const auto& slot : m_ams_mapping_result) {
2269 if (!is_at_suggested_pos(obj, slot.id)) {
2270 auto pos = get_filament_suggest_pos(obj, slot.id);
2271 if (pos.has_value())
2272 best_pos_map[slot.id] = pos.value();
2273 }
2274 }
2275 m_best_pos_dialog->UpdateInfo(obj, best_pos_map, m_ams_mapping_result, text);
2276 m_best_pos_dialog->ShowModal();
2277}
ReselectMachineDialog * m_best_pos_dialog
Definition SelectMachine.hpp:465
wxString FormatTime(float totalSeconds)
Definition SelectMachine.cpp:2072
std::optional< float > get_filament_change_gap_time(MachineObject *obj_) const
Definition SelectMachine.cpp:2088
bool is_at_suggested_pos(MachineObject *obj_, int fila_logic_id) const
Definition SelectMachine.cpp:2215

References FormatTime(), get_filament_change_gap_time(), get_filament_suggest_pos(), Slic3r::DeviceManager::get_selected_machine(), is_at_suggested_pos(), m_ams_mapping_result, m_best_pos_dialog, and Slic3r::GUI::wxMouseEvent.

Referenced by SelectMachineDialog().

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

◆ on_selection_changed()

void Slic3r::GUI::SelectMachineDialog::on_selection_changed ( wxCommandEvent & event)
4235{
4236 /* reset timeout and reading printer info */
4237 m_status_bar->reset();
4238 m_timeout_count = 0;
4240 m_ams_mapping_res = false;
4241 m_ams_mapping_valid = false;
4242 m_ams_mapping_result.clear();
4244 m_pre_print_checker.clear();
4245
4246 m_link_edit_nozzle->Show(false);
4247 m_mapping_sugs_sizer->Show(false);
4248 m_change_filament_times_sizer->Show(false);
4249 m_txt_change_filament_times->Show(false);
4250
4251
4253 auto selection = m_printer_box->GetPrinterComboBox()->GetSelection();
4254 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
4255 if (!dev) return;
4256
4257 MachineObject* obj = nullptr;
4258 for (int i = 0; i < m_list.size(); i++) {
4259 if (i == selection) {
4260
4261 //check lan mode machine
4262 if (m_list[i]->is_lan_mode_printer() && !m_list[i]->has_access_right()) {
4263 ConnectPrinterDialog dlg(wxGetApp().mainframe, wxID_ANY, _L("Input access code"));
4264 dlg.set_machine_object(m_list[i]);
4265 auto res = dlg.ShowModal();
4267 m_printer_box->GetPrinterComboBox()->SetSelection(-1);
4268 m_printer_box->GetPrinterComboBox()->Refresh();
4269 m_printer_box->GetPrinterComboBox()->Update();
4270 }
4271
4272 m_printer_last_select = m_list[i]->get_dev_id();
4273 obj = m_list[i];
4274
4275 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "for send task, current printer id = " << m_printer_last_select << std::endl;
4276 break;
4277 }
4278 }
4279
4280 if (obj && !obj->get_lan_mode_connection_state()) {
4281 obj->command_get_version();
4282 obj->command_request_push_all();
4283 if (!dev->get_selected_machine()) {
4284 dev->set_selected_machine(m_printer_last_select);
4285 }else if (dev->get_selected_machine()->get_dev_id() != m_printer_last_select) {
4286 dev->set_selected_machine(m_printer_last_select);
4287 }
4288
4289 // Has changed machine unrecoverably
4290 m_check_flag = false;
4291 } else {
4292 BOOST_LOG_TRIVIAL(error) << "on_selection_changed dev_id not found";
4293 return;
4294 }
4295
4296
4297 //reset print status
4301}
bool m_check_flag
Definition SelectMachine.hpp:325
std::vector< MachineObject * > m_list
Definition SelectMachine.hpp:344
void update_show_status(MachineObject *obj_=nullptr)
Definition SelectMachine.cpp:4748
bool m_ams_mapping_valid
Definition SelectMachine.hpp:321
bool m_ams_mapping_res
Definition SelectMachine.hpp:320
void update_print_status_msg()
Definition SelectMachine.cpp:1976

References _L, clear_nozzle_mapping(), Slic3r::MachineObject::command_get_version(), Slic3r::MachineObject::command_request_push_all(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_lan_mode_connection_state(), Slic3r::DeviceManager::get_selected_machine(), m_ams_mapping_res, m_ams_mapping_result, m_ams_mapping_valid, m_change_filament_times_sizer, m_check_flag, m_link_edit_nozzle, m_list, m_mapping_sugs_sizer, m_pre_print_checker, m_printer_box, m_printer_last_select, m_status_bar, m_timeout_count, m_txt_change_filament_times, Slic3r::GUI::PrintStatusInit, Slic3r::GUI::s_nozzle_mapping_last_request_time, Slic3r::GUI::ConnectPrinterDialog::set_machine_object(), Slic3r::DeviceManager::set_selected_machine(), show_status(), Slic3r::GUI::DPIAware< P >::ShowModal(), update_print_status_msg(), and update_show_status().

Referenced by Slic3r::GUI::PrinterInfoBox::Create().

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

◆ on_send_print()

void Slic3r::GUI::SelectMachineDialog::on_send_print ( )
3572{
3573 BOOST_LOG_TRIVIAL(info) << "print_job: on_ok to send";
3574 m_is_canceled = false;
3575 Enable_Send_Button(false);
3576
3577 if (m_mapping_popup.IsShown())
3578 m_mapping_popup.Dismiss();
3579
3581 return;
3582
3583 int result = 0;
3584 if (m_printer_last_select.empty()) {
3585 return;
3586 }
3587
3588 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
3589 if (!dev) return;
3590
3591 MachineObject* obj_ = dev->get_selected_machine();
3592 assert(obj_->get_dev_id() == m_printer_last_select);
3593 if (obj_ == nullptr) { return; }
3594
3595 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", print_job: for send task, current printer id = " << m_printer_last_select << std::endl;
3597
3598 m_status_bar->reset();
3599 m_status_bar->set_prog_block();
3600 m_status_bar->set_cancel_callback_fina([this]() {
3601 BOOST_LOG_TRIVIAL(info) << "print_job: enter canceled";
3602 m_worker->cancel_all();
3603 m_is_canceled = true;
3604 wxCommandEvent* event = new wxCommandEvent(EVT_PRINT_JOB_CANCEL);
3605 wxQueueEvent(this, event);
3606 });
3607
3608 if (m_is_canceled) {
3609 BOOST_LOG_TRIVIAL(info) << "print_job: m_is_canceled";
3610 m_status_bar->set_status_text(task_canceled_text);
3611 return;
3612 }
3613
3614 // enter sending mode
3615 sending_mode();
3616 m_status_bar->enable_cancel_button();
3617
3618 // get ams_mapping_result
3619 std::string ams_mapping_array;
3620 std::string ams_mapping_array2;
3621 std::string ams_mapping_info;
3622
3623 get_ams_mapping_result(ams_mapping_array,ams_mapping_array2, ams_mapping_info);
3624
3626 result = m_plater->send_gcode(m_print_plate_idx, [this](int export_stage, int current, int total, bool& cancel) {
3627 if (this->m_is_canceled) return;
3628 bool cancelled = false;
3629 wxString msg = _L("Preparing print job");
3630 m_status_bar->update_status(msg, cancelled, 10, true);
3631 m_export_3mf_cancel = cancel = cancelled;
3632 });
3633
3635 BOOST_LOG_TRIVIAL(info) << "print_job: m_export_3mf_cancel or m_is_canceled";
3636 m_status_bar->set_status_text(task_canceled_text);
3637 return;
3638 }
3639
3640 if (result < 0) {
3641 wxString msg = _L("Abnormal print file data. Please slice again");
3642 m_status_bar->set_status_text(msg);
3643 return;
3644 }
3645
3646 // export config 3mf if needed
3647 if (!obj_->is_lan_mode_printer()) {
3648 result = m_plater->export_config_3mf(m_print_plate_idx);
3649 if (result < 0) {
3650 BOOST_LOG_TRIVIAL(info) << "export_config_3mf failed, result = " << result;
3651 return;
3652 }
3653 }
3655 BOOST_LOG_TRIVIAL(info) << "print_job: m_export_3mf_cancel or m_is_canceled";
3656 m_status_bar->set_status_text(task_canceled_text);
3657 return;
3658 }
3659 }
3660
3661 m_print_job = std::make_shared<PrintJob>(m_printer_last_select);
3662 m_print_job->m_dev_ip = obj_->get_dev_ip();
3663 m_print_job->m_ftp_folder = obj_->get_ftp_folder();
3664 m_print_job->m_access_code = obj_->get_access_code();
3665#if !BBL_RELEASE_TO_PUBLIC
3666 m_print_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
3667 m_print_job->m_local_use_ssl = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
3668#else
3669 m_print_job->m_local_use_ssl_for_ftp = obj_->local_use_ssl_for_ftp;
3670 m_print_job->m_local_use_ssl = obj_->local_use_ssl;
3671#endif
3672 m_print_job->connection_type = obj_->connection_type();
3673 m_print_job->cloud_print_only = obj_->is_support_cloud_print_only;
3674
3676 BOOST_LOG_TRIVIAL(info) << "print_job: m_print_type = from_normal";
3677 m_print_job->m_print_type = "from_normal";
3678 m_print_job->set_project_name(m_current_project_name.utf8_string());
3679 }
3681 BOOST_LOG_TRIVIAL(info) << "print_job: m_print_type = from_sdcard_view";
3682 m_print_job->m_print_type = "from_sdcard_view";
3683 //m_print_job->connection_type = "lan";
3684
3685 try {
3686 m_print_job->m_print_from_sdc_plate_idx = m_required_data_plate_data_list[m_print_plate_idx]->plate_index + 1;
3688 }
3689 catch (...) {}
3690 BOOST_LOG_TRIVIAL(info) << "print_job: m_print_plate_idx =" << m_print_job->m_print_from_sdc_plate_idx;
3691
3692 auto input_str_arr = wxGetApp().split_str(m_required_data_file_name, ".gcode.3mf");
3693 if (input_str_arr.size() <= 1) {
3694 input_str_arr = wxGetApp().split_str(m_required_data_file_name, ".3mf");
3695 if (input_str_arr.size() > 1) {
3696 m_print_job->set_project_name(input_str_arr[0]);
3697 }
3698 }
3699 else {
3700 m_print_job->set_project_name(input_str_arr[0]);
3701 }
3702 }
3703
3704 m_print_job->task_ams_mapping = ams_mapping_array;
3705 m_print_job->task_ams_mapping2 = ams_mapping_array2;
3706 m_print_job->task_ams_mapping_info = ams_mapping_info;
3707 // Print-dispatch nozzle mapping (H2C hotend rack): attach ONLY when a mapping result exists.
3708 // For every non-rack printer (X1/P1/A1/H2S/H2D) the mapping json is empty, so task_nozzle_mapping
3709 // stays absent and the print payload is unchanged.
3710 if (!obj_->get_nozzle_mapping_result()->GetNozzleMappingJson().empty()) {
3711 m_print_job->task_nozzle_mapping = obj_->get_nozzle_mapping_result()->GetNozzleMappingJson().dump();
3712 }
3713
3714 /* build nozzles info for multi extruders printers */
3715 if (build_nozzles_info(m_print_job->task_nozzles_info)) {
3716 BOOST_LOG_TRIVIAL(error) << "build_nozzle_info errors";
3717 }
3718
3719 m_print_job->sdcard_state = obj_->GetStorage()->get_sdcard_state();
3720 m_print_job->has_sdcard = wxGetApp().app_config->get("allow_abnormal_storage") == "true"
3723 : m_print_job->sdcard_state == DevStorage::SdcardState::HAS_SDCARD_NORMAL;
3724
3725 m_print_job->could_emmc_print = obj_->can_use_emmc_print();
3726 if (obj_->is_support_print_with_emmc && !m_print_job->could_emmc_print) {
3727 BOOST_LOG_TRIVIAL(info) << "print_job: emmc print disabled by config";
3728 }
3729
3730
3731 bool timelapse_option = m_checkbox_list["timelapse"]->IsShown()?true:false;
3732 if (timelapse_option) {
3733 timelapse_option = m_checkbox_list["timelapse"]->getValue() == "on";
3734 }
3735
3736 // PA-profile-sharing mode (extrude_cali_manual_mode): 0 = share (toggle on), 1 = per-nozzle.
3737 // Shared PA (0) is the deliberate default for pa_mode printers even while the toggle is hidden;
3738 // -1 keeps the field omitted for every other printer, which was the prior behavior.
3739 int pa_manual_mode = -1;
3740 if (obj_->is_support_pa_mode) {
3741 pa_manual_mode = (m_checkbox_list["pa_value"]->getValue() == "on") ? 0 : 1;
3742 }
3743
3744 if (timelapse_option && obj_->is_support_internal_timelapse && !m_timelapse_storage.empty()) {
3745 m_print_job->task_timelapse_use_internal = (m_timelapse_storage == "internal");
3746 }
3747
3748 m_print_job->set_print_config(
3750 (m_checkbox_list["bed_leveling"]->getValue() == "on"),
3751 (m_checkbox_list["flow_cali"]->getValue() == "on"),
3752 false,
3753 timelapse_option,
3754 true,
3756 m_checkbox_list["bed_leveling"]->getValueInt(),
3757 m_checkbox_list["flow_cali"]->getValueInt(),
3758 m_checkbox_list["nozzle_offset_cali"]->getValueInt(),
3759 pa_manual_mode
3760 );
3761
3762 if (obj_->HasAms()) {
3763 bool has_ext = _HasExt(m_ams_mapping_result);
3764 bool has_ams = _HasAms(m_ams_mapping_result);
3765
3766 if (has_ams && !has_ext) {
3767 m_print_job->task_use_ams = true;
3768 }
3769 else if (has_ext && !has_ams) {
3770 m_print_job->task_use_ams = false;
3771 }
3772 else {
3773 m_print_job->task_use_ams = true;
3774 }
3775 } else {
3776 m_print_job->task_use_ams = false;
3777 }
3778
3779 BOOST_LOG_TRIVIAL(info) << "print_job: timelapse_option = " << timelapse_option;
3780 BOOST_LOG_TRIVIAL(info) << "print_job: use_ams = " << m_print_job->task_use_ams;
3781
3782 m_print_job->on_success([this]() { finish_mode(); });
3783
3784 m_print_job->on_check_ip_address_fail([this]() {
3785 // Invoked from the PrintJob worker thread when the LAN pre-flight (file upload
3786 // verification) fails. Marshal device/UI access to the main thread.
3787 CallAfter([this]()
3788 {
3789 // Reset the dialog out of sending mode so the user can retry.
3790 wxCommandEvent* evt = new wxCommandEvent(EVT_CLEAR_IPADDRESS);
3791 wxQueueEvent(this, evt);
3792
3793 DeviceManager* dev = wxGetApp().getDeviceManager();
3794 MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
3795
3796 if (obj && obj->is_connected())
3797 {
3798 // Connected: failed on file upload
3799 MessageDialog dlg(this,
3800 _L("Failed to upload the file to the printer's storage. Please try again."),
3801 _L("Send Failed"), wxOK | wxICON_ERROR);
3802 dlg.ShowModal();
3803 }
3804 else
3805 {
3806 // Not connected: reenter ip and access code
3807 wxGetApp().show_ip_address_enter_dialog();
3808 }
3809 });
3810 });
3811
3812 // update ota version
3813 NetworkAgent* agent = wxGetApp().getAgent();
3814 if (agent) {
3815 std::string dev_ota_str = "dev_ota_ver:" + obj_->get_dev_id();
3816 agent->track_update_property(dev_ota_str, obj_->get_ota_version());
3817 }
3818
3820 BOOST_LOG_TRIVIAL(info) << "print_job: start print job";
3821}
@ HAS_SDCARD_NORMAL
Definition DevStorage.h:19
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
void sending_mode()
Definition SelectMachine.cpp:1082
bool build_nozzles_info(std::string &nozzles_info)
Definition SelectMachine.cpp:1459
bool m_is_canceled
Definition SelectMachine.hpp:323
void Enable_Send_Button(bool en)
Definition SelectMachine.cpp:5383
std::shared_ptr< PrintJob > m_print_job
Definition SelectMachine.hpp:434
std::string m_required_data_file_path
Definition SelectMachine.hpp:356
void finish_mode()
Definition SelectMachine.cpp:1104
std::string m_required_data_file_name
Definition SelectMachine.hpp:355
@ PrintStatusSending
Definition PrePrintChecker.hpp:75
static wxString task_canceled_text
Definition SelectMachine.cpp:155
static bool _HasExt(const std::vector< FilamentInfo > &ams_mapping_result)
Definition SelectMachine.cpp:3156
static bool _HasAms(const std::vector< FilamentInfo > &ams_mapping_result)
Definition SelectMachine.cpp:3170
bool replace_job(Worker &w, Args &&...args)
Definition Worker.hpp:99

References Slic3r::GUI::_HasAms(), Slic3r::GUI::_HasExt(), _L, build_nozzles_info(), Slic3r::MachineObject::can_use_emmc_print(), Slic3r::MachineObject::connection_type(), Enable_Send_Button(), finish_mode(), Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::MachineObject::get_access_code(), get_ams_mapping_result(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_dev_ip(), Slic3r::MachineObject::get_ftp_folder(), Slic3r::MachineObject::get_nozzle_mapping_result(), Slic3r::MachineObject::get_ota_version(), Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetStorage(), Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_NORMAL, Slic3r::MachineObject::HasAms(), Slic3r::MachineObject::is_connected(), Slic3r::MachineObject::is_lan_mode_printer(), Slic3r::MachineObject::is_support_cloud_print_only, Slic3r::MachineObject::is_support_internal_timelapse, Slic3r::MachineObject::is_support_pa_mode, Slic3r::MachineObject::is_support_print_with_emmc, Slic3r::MachineObject::local_use_ssl, Slic3r::MachineObject::local_use_ssl_for_ftp, m_ams_mapping_result, m_checkbox_list, m_current_project_name, m_export_3mf_cancel, m_ext_change_assist, m_is_canceled, m_is_in_sending_mode, m_mapping_popup, m_plater, m_print_job, m_print_plate_idx, m_print_type, m_printer_last_select, m_required_data_file_name, m_required_data_file_path, m_required_data_plate_data_list, m_status_bar, m_timelapse_storage, m_worker, MachineBedTypeString, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::replace_job(), sending_mode(), show_status(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::task_canceled_text, and Slic3r::NetworkAgent::track_update_property().

Referenced by on_ok_btn(), on_timelapse_storage_check_result(), on_timelapse_storage_check_timer(), show_timelapse_storage_dialog(), and start_timelapse_storage_check().

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

◆ on_set_finish_mapping()

void Slic3r::GUI::SelectMachineDialog::on_set_finish_mapping ( wxCommandEvent & evt)
3866{
3867 auto selection_data = evt.GetString();
3868 auto selection_data_arr = wxSplit(selection_data, '|');
3869
3870 BOOST_LOG_TRIVIAL(info) << "The ams mapping selection result: data is " << selection_data;
3871
3872 if (selection_data_arr.size() == 8) {
3873 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
3874 int old_filament_id = (int) wxAtoi(selection_data_arr[5]);
3875 if (m_print_type == PrintFromType::FROM_NORMAL) {//todo:support sd card
3876 change_default_normal(old_filament_id, ams_colour);
3879 }
3880
3881 int ctype = 0;
3882 std::vector<wxColour> material_cols;
3883 std::vector<std::string> tray_cols;
3884 for (auto mapping_item : m_mapping_popup.m_mapping_item_list) {
3885 if (mapping_item->m_tray_data.id == evt.GetInt()) {
3886 ctype = mapping_item->m_tray_data.ctype;
3887 material_cols = mapping_item->m_tray_data.material_cols;
3888 for (auto col : mapping_item->m_tray_data.material_cols) {
3889 wxString color = wxString::Format("#%02X%02X%02X%02X", col.Red(), col.Green(), col.Blue(), col.Alpha());
3890 tray_cols.push_back(color.ToStdString());
3891 }
3892 break;
3893 }
3894 }
3895
3896
3897 for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
3898 if (m_ams_mapping_result[i].id == wxAtoi(selection_data_arr[5])) {
3899 m_ams_mapping_result[i].tray_id = evt.GetInt();
3900 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
3901 wxString color = wxString::Format("#%02X%02X%02X%02X", ams_colour.Red(), ams_colour.Green(), ams_colour.Blue(), ams_colour.Alpha());
3902 m_ams_mapping_result[i].color = color.ToStdString();
3903 m_ams_mapping_result[i].ctype = ctype;
3904 m_ams_mapping_result[i].colors = tray_cols;
3905
3906 m_ams_mapping_result[i].ams_id = selection_data_arr[6].ToStdString();
3907 m_ams_mapping_result[i].slot_id = selection_data_arr[7].ToStdString();
3908
3909 if (m_ams_mapping_result[i].ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || m_ams_mapping_result[i].ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
3910 }else if (m_ams_mapping_result[i].ams_id >= std::to_string(0)) {
3911 }
3912 }
3913 BOOST_LOG_TRIVIAL(trace) << "The ams mapping result: id is " << m_ams_mapping_result[i].id << "tray_id is " << m_ams_mapping_result[i].tray_id;
3914 }
3915
3916 MaterialHash::iterator iter = m_materialList.begin();
3917 while (iter != m_materialList.end()) {
3918 Material* item = iter->second;
3919 MaterialItem *m = item->item;
3920 if (item->id == m_current_filament_id) {
3921 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
3922 m->set_ams_info(ams_colour, selection_data_arr[4], ctype, material_cols);
3923 m->set_nozzle_info(get_mapped_nozzle_str(item->id));
3924 }
3925 iter++;
3926 }
3927 }
3928
3930}
void update_filament_change_count()
Definition SelectMachine.cpp:4320
wxString get_mapped_nozzle_str(int fila_id) const
Definition SelectMachine.cpp:1625
void final_deal_edge_pixels_data(ThumbnailData &data)
Definition SelectMachine.cpp:5934
void change_default_normal(int old_filament_id, wxColour temp_ams_color)
Definition SelectMachine.cpp:6033
int m_current_filament_id
Definition SelectMachine.hpp:314
void set_default_normal(const ThumbnailData &)
Definition SelectMachine.cpp:6102
void trace(unsigned int level, const char *message)
Definition utils.cpp:247

References change_default_normal(), final_deal_edge_pixels_data(), Slic3r::GUI::FROM_NORMAL, get_mapped_nozzle_str(), Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, m_ams_mapping_result, m_current_filament_id, m_mapping_popup, m_materialList, m_preview_thumbnail_data, m_print_type, Slic3r::GUI::MaterialItem::set_ams_info(), set_default_normal(), Slic3r::GUI::MaterialItem::set_nozzle_info(), Slic3r::trace(), update_filament_change_count(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by init_bind().

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

◆ on_sys_color_changed()

◆ on_timelapse_storage_check_result()

void Slic3r::GUI::SelectMachineDialog::on_timelapse_storage_check_result ( )
private
3431{
3432 DeviceManager* dev = wxGetApp().getDeviceManager();
3433 MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
3434 if (!obj) { on_send_print(); return; }
3435
3436 // query failed -> ignore, proceed with print
3437 if (obj->timelapse_storage_check_result != 0) {
3438 BOOST_LOG_TRIVIAL(info) << "timelapse storage check failed (result=" << obj->timelapse_storage_check_result << "), proceeding";
3439 on_send_print();
3440 return;
3441 }
3442
3443 // space is enough -> proceed
3444 if (obj->timelapse_storage_is_enough) {
3445 on_send_print();
3446 return;
3447 }
3448
3449 // space not enough -> show dialog
3451}
void show_timelapse_storage_dialog(MachineObject *obj)
Definition SelectMachine.cpp:3453

References Slic3r::DeviceManager::get_selected_machine(), on_send_print(), show_timelapse_storage_dialog(), Slic3r::MachineObject::timelapse_storage_check_result, and Slic3r::MachineObject::timelapse_storage_is_enough.

Referenced by on_timelapse_storage_check_timer().

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

◆ on_timelapse_storage_check_timer()

void Slic3r::GUI::SelectMachineDialog::on_timelapse_storage_check_timer ( wxTimerEvent & event)
private
3410{
3412
3413 DeviceManager* dev = wxGetApp().getDeviceManager();
3414 MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
3415
3417 bool done = obj && obj->timelapse_storage_check_done.load();
3418
3419 if (done || timed_out) {
3421 if (timed_out && !done) {
3422 BOOST_LOG_TRIVIAL(warning) << "timelapse storage check timed out, proceeding with print";
3423 on_send_print();
3424 return;
3425 }
3427 }
3428}
int m_timelapse_check_elapsed_ms
Definition SelectMachine.hpp:365
int m_timelapse_check_interval_ms
Definition SelectMachine.hpp:366
int m_timelapse_check_timeout_ms
Definition SelectMachine.hpp:364
void on_timelapse_storage_check_result()
Definition SelectMachine.cpp:3430

References Slic3r::DeviceManager::get_selected_machine(), m_timelapse_check_elapsed_ms, m_timelapse_check_interval_ms, m_timelapse_check_timeout_ms, m_timelapse_check_timer, on_send_print(), on_timelapse_storage_check_result(), and Slic3r::MachineObject::timelapse_storage_check_done.

Referenced by start_timelapse_storage_check().

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

◆ on_timer()

void Slic3r::GUI::SelectMachineDialog::on_timer ( wxTimerEvent & event)
4189{
4190 DeviceManager* dev_ = Slic3r::GUI::wxGetApp().getDeviceManager();
4191 if(!dev_) return;
4192 MachineObject* obj_ = dev_->get_my_machine(m_printer_last_select);
4193 if(!obj_) return;
4194
4195 if (obj_->GetExtderSystem()->GetTotalExtderCount() > 1)
4196 {
4197 change_materialitem_tip(false); /*mapping to both ams and ext, is supported while total_extder_count is 2*/
4198 } else {
4200 }
4201
4202 if (!obj_->GetFilaSystem()->HasAms()
4203 || obj_->ams_exist_bits == 0
4204 || !obj_->is_support_filament_backup
4205 || !obj_->GetExtderSystem()->HasFilamentBackup()
4206 || !obj_->GetFilaSystem()->IsAutoRefillEnabled()
4208 if (m_ams_backup_tip->IsShown()) {
4209 m_ams_backup_tip->Hide();
4210 img_ams_backup->Hide();
4211 m_scroll_area->Layout();
4212 }
4213 }
4214 else {
4215 if (!m_ams_backup_tip->IsShown()) {
4216 m_ams_backup_tip->Show();
4217 img_ams_backup->Show();
4218 // first show: position them, they were never laid out while hidden
4219 m_scroll_area->Layout();
4220 }
4221 }
4222
4223 load_option_vals(obj_);
4224 update_show_status(obj_);
4226 //update_scroll_area_size();/*STUDIO-12867 the page maybe blank in some platform. FIXME*/
4227
4228 // Refresh the best-position "saves X" tip after the status update. Placed here (not inside
4229 // update_show_status) so it still runs when update_show_status returns early on an error.
4230 // No-op for printers without a filament switcher.
4231 refresh_save_time(obj_);
4232}
void refresh_save_time(MachineObject *obj)
Definition SelectMachine.cpp:2231
void change_materialitem_tip(bool no_ams_only_ext)
Definition SelectMachine.cpp:5509
void load_option_vals(MachineObject *obj)
Definition SelectMachine.cpp:3192

References Slic3r::GUI::_HasAms(), Slic3r::MachineObject::ams_exist_bits, change_materialitem_tip(), Slic3r::DeviceManager::get_my_machine(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::DevExtderSystem::HasFilamentBackup(), img_ams_backup, Slic3r::MachineObject::is_support_filament_backup, load_option_vals(), m_ams_backup_tip, m_ams_mapping_result, m_printer_last_select, m_scroll_area, refresh_save_time(), update_print_status_msg(), and update_show_status().

Referenced by init_bind().

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

◆ popup_filament_backup()

void Slic3r::GUI::SelectMachineDialog::popup_filament_backup ( )
1020{
1022 return;
1023 }
1024
1025 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1026 if (!dev) return;
1027 if (dev->get_selected_machine()/* && dev->get_selected_machine()->filam_bak.size() > 0*/) {
1028 AmsReplaceMaterialDialog* m_replace_material_popup = new AmsReplaceMaterialDialog(this);
1029 m_replace_material_popup->update_machine_obj(dev->get_selected_machine());
1030 m_replace_material_popup->ShowModal();
1031 }
1032}
@ PrintStatusUnsupportedPrinter
Definition PrePrintChecker.hpp:83

References Slic3r::DeviceManager::get_selected_machine(), m_print_status, Slic3r::GUI::PrintStatusUnsupportedPrinter, Slic3r::GUI::DPIAware< P >::ShowModal(), and Slic3r::GUI::AmsReplaceMaterialDialog::update_machine_obj().

Referenced by SelectMachineDialog().

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

◆ prepare()

void Slic3r::GUI::SelectMachineDialog::prepare ( int print_plate_idx)
1972{
1973 m_print_plate_idx = print_plate_idx;
1974}

References m_print_plate_idx.

◆ prepare_mode()

void Slic3r::GUI::SelectMachineDialog::prepare_mode ( bool refresh_button = true)
1052{
1053 Enable_Auto_Refill(true);
1055
1056 m_is_in_sending_mode = false;
1057 m_worker->wait_for_idle();
1058
1059 if (wxIsBusy())
1060 wxEndBusyCursor();
1061
1062 if (refresh_button) {
1063 EnableEditing(true);
1064 Enable_Send_Button(true);
1065 }
1066
1067 m_status_bar->reset();
1068 if (m_simplebook->GetSelection() != 0) {
1069 m_simplebook->SetSelection(0);
1070 Layout();
1071 Fit();
1072 }
1073
1076 for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
1077 it->second->item->enable();
1078 }
1079 }
1080}
void Enable_Auto_Refill(bool enable)
Definition SelectMachine.cpp:3246
@ PrintPageModePrepare
Definition SelectMachine.hpp:89

References Enable_Auto_Refill(), Enable_Send_Button(), EnableEditing(), m_is_in_sending_mode, m_materialList, m_print_page_mode, m_simplebook, m_status_bar, m_worker, Slic3r::GUI::PrintPageModePrepare, and show_print_failed_info().

Referenced by clear_ip_address_config(), on_print_job_cancel(), and show_status().

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

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ record_edge_pixels_data()

void Slic3r::GUI::SelectMachineDialog::record_edge_pixels_data ( )
5895{
5896 auto is_not_in_preview_colors = [this](unsigned char r, unsigned char g , unsigned char b , unsigned char a) {
5897 for (size_t i = 0; i < m_preview_colors_in_thumbnail.size(); i++) {
5898 wxColour render_color = adjust_color_for_render(m_preview_colors_in_thumbnail[i]);
5899 if (render_color.Red() == r && render_color.Green() == g && render_color.Blue() == b /*&& render_color.Alpha() == a*/) {
5900 return false;
5901 }
5902 }
5903 return true;
5904 };
5905 ThumbnailData &data = m_cur_no_light_thumbnail_data;
5906 ThumbnailData &origin_data = m_cur_input_thumbnail_data;
5907 if (data.width > 0 && data.height > 0 && (data.width == origin_data.width && data.height == origin_data.height) ) {
5908 m_edge_pixels.resize(data.width * data.height);
5909 for (unsigned int r = 0; r < data.height; ++r) {
5910 unsigned int rr = (data.height - 1 - r) * data.width;
5911 for (unsigned int c = 0; c < data.width; ++c) {
5912 unsigned char *no_light_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
5913 unsigned char *origin_px = (unsigned char *) origin_data.pixels.data() + 4 * (rr + c);
5914 m_edge_pixels[r * data.width + c] = false;
5915 if (origin_px[3] > 0) {
5916 if (is_not_in_preview_colors(no_light_px[0], no_light_px[1], no_light_px[2], origin_px[3])) {
5917 m_edge_pixels[r * data.width + c] = true;
5918 }
5919 }
5920 }
5921 }
5922 }
5923}

References adjust_color_for_render(), Slic3r::ThumbnailData::height, m_cur_input_thumbnail_data, m_cur_no_light_thumbnail_data, m_edge_pixels, m_preview_colors_in_thumbnail, Slic3r::ThumbnailData::pixels, and Slic3r::ThumbnailData::width.

Referenced by clone_thumbnail_data().

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

◆ refresh_save_time()

void Slic3r::GUI::SelectMachineDialog::refresh_save_time ( MachineObject * obj)
2232{
2234
2235 auto save_time = get_filament_change_gap_time(obj);
2236 bool is_all_at_suggest_pos = true;
2237 for (const auto& mapping_item : m_ams_mapping_result) {
2238 is_all_at_suggest_pos = is_at_suggested_pos(obj, mapping_item.id);
2239 if (!is_all_at_suggest_pos) break;
2240 }
2241
2242 if (save_time.has_value() && save_time.value() >= 1 && !is_all_at_suggest_pos) {
2243 m_saveTimeText->SetLabel(wxString::Format(_L("Recommended filament arrangement saves %s->"), FormatTime(*save_time)));
2244 m_saveTimeText->Wrap(-1);
2245 m_saveTimeText->Show();
2246 m_basic_panel->Layout();
2247 m_basic_panel->Fit();
2248 } else {
2249 m_saveTimeText->Hide();
2250 }
2251}

References _L, FormatTime(), Slic3r::GUI::FROM_NORMAL, get_filament_change_gap_time(), is_at_suggested_pos(), m_ams_mapping_result, m_basic_panel, m_print_type, and m_saveTimeText.

Referenced by on_timer(), and set_default_from_sdcard().

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

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ reset_ams_material()

void Slic3r::GUI::SelectMachineDialog::reset_ams_material ( )
5364{
5365 MaterialHash::iterator iter = m_materialList.begin();
5366 while (iter != m_materialList.end()) {
5367 int id = iter->first;
5368 Material* item = iter->second;
5369 MaterialItem* m = item->item;
5370 wxString ams_id = "-";
5371 wxColour ams_col = wxColour(0xEE, 0xEE, 0xEE);
5372 m->set_ams_info(ams_col, ams_id);
5373 m->set_nozzle_info(get_mapped_nozzle_str(id));
5374 iter++;
5375 }
5376}

References get_mapped_nozzle_str(), Slic3r::GUI::Material::item, m_materialList, Slic3r::GUI::MaterialItem::set_ams_info(), and Slic3r::GUI::MaterialItem::set_nozzle_info().

Referenced by do_ams_mapping(), and set_default_from_sdcard().

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

◆ reset_and_sync_ams_list()

void Slic3r::GUI::SelectMachineDialog::reset_and_sync_ams_list ( )
5536{
5537 // for black list
5538 std::vector<std::string> materials;
5539 std::vector<std::string> brands;
5540 std::vector<std::string> display_materials;
5541 std::vector<std::string> m_filaments_id;
5542 auto preset_bundle = wxGetApp().preset_bundle;
5543
5544 for (auto filament_name : preset_bundle->filament_presets) {
5545 for (int f_index = 0; f_index < preset_bundle->filaments.size(); f_index++) {
5546 PresetCollection *filament_presets = &wxGetApp().preset_bundle->filaments;
5547 Preset * preset = &filament_presets->preset(f_index);
5548 int size = preset_bundle->filaments.size();
5549 if (preset && filament_name.compare(preset->name) == 0) {
5550 std::string display_filament_type;
5551 std::string filament_type = preset->config.get_filament_type(display_filament_type);
5552 std::string m_filament_id = preset->filament_id;
5553 display_materials.push_back(display_filament_type);
5554 materials.push_back(filament_type);
5555 m_filaments_id.push_back(m_filament_id);
5556
5557 std::string m_vendor_name = "";
5558 auto vendor = dynamic_cast<ConfigOptionStrings *>(preset->config.option("filament_vendor"));
5559 if (vendor && (vendor->values.size() > 0)) {
5560 std::string vendor_name = vendor->values[0];
5561 m_vendor_name = vendor_name;
5562 }
5563 brands.push_back(m_vendor_name);
5564 }
5565 }
5566 }
5567
5568 auto extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_filaments();
5569 BitmapCache bmcache;
5570 MaterialHash::iterator iter = m_materialList.begin();
5571 while (iter != m_materialList.end()) {
5572 int id = iter->first;
5573 Material *item = iter->second;
5574 item->item->Destroy();
5575 delete item;
5576 iter++;
5577 }
5578
5579 m_sizer_ams_mapping->Clear();
5580 m_materialList.clear();
5581 m_filaments.clear();
5582 m_ams_tooltip =_L("Upper half area: Original\nLower half area: Filament in AMS\nAnd you can click it to modify");
5583
5584 const auto& full_config = wxGetApp().preset_bundle->full_config();
5585 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
5586
5587 bool use_double_extruder = nozzle_nums > 1 ? true : false;
5588 if (use_double_extruder)
5589 {
5590 const auto& project_config = preset_bundle->project_config;
5591 m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
5592 }
5593
5594 bool selected_any = false;
5595 MaterialItem *first_enabled = nullptr;
5596 int first_enabled_id = -1;
5597
5598 for (auto i = 0; i < extruders.size(); i++) {
5599 auto extruder = extruders[i] - 1;
5600 auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
5601 unsigned char rgb[4];
5602 bmcache.parse_color4(colour, rgb);
5603
5604 auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
5605 if (extruder >= materials.size() || extruder < 0 || extruder >= display_materials.size()) continue;
5606
5607 MaterialItem* item = nullptr;
5608 if (use_double_extruder)
5609 {
5610
5611 if (m_filaments_map[extruder] == 1)
5612 {
5613 item = new MaterialItem(m_filament_left_panel, colour_rgb, _L(display_materials[extruder]));
5614 m_sizer_ams_mapping_left->Add(item, 0, wxALL, FromDIP(5));
5615 }
5616 else // map == 2, or (non-BBL multi-nozzle) 3+; update_material_item_pos() collapses
5617 { // these into the single panel when the device reports < 2 extruders.
5618 item = new MaterialItem(m_filament_right_panel, colour_rgb, _L(display_materials[extruder]));
5619 m_sizer_ams_mapping_right->Add(item, 0, wxALL, FromDIP(5));
5620 }
5621 }
5622 else
5623 {
5624 item = new MaterialItem(m_filament_panel, colour_rgb, _L(display_materials[extruder]));
5625 m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
5626 }
5627
5628 if (!item) continue;
5629
5630 item->SetToolTip(m_ams_tooltip);
5631
5632 if (!selected_any && extruder == m_current_filament_id && item->m_enable) {
5633 item->on_selected();
5634 selected_any = true;
5635 }
5636 if (!first_enabled && item->m_enable) {
5637 first_enabled = item;
5638 first_enabled_id = extruder;
5639 }
5640
5641 item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent &e) {});
5642 item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder](wxMouseEvent &e) {
5643 if (!item->m_enable) {return;}
5645
5646 MaterialHash::iterator iter = m_materialList.begin();
5647 while (iter != m_materialList.end()) {
5648 int id = iter->first;
5649 Material * item = iter->second;
5650 MaterialItem *m = item->item;
5651 m->on_normal();
5652 iter++;
5653 }
5654
5655 m_current_filament_id = extruder;
5656 item->on_selected();
5657
5658 auto mouse_pos = ClientToScreen(e.GetPosition());
5659 wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
5660
5661 // update ams data
5662 DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
5663 if (!dev_manager) return;
5664 MachineObject *obj_ = dev_manager->get_selected_machine();
5665 m_mapping_popup.set_show_type(get_filament_mapping_show_type(obj_, extruder));
5666 if (obj_) {
5667 if (m_mapping_popup.IsShown()) return;
5668 wxPoint pos = item->ClientToScreen(wxPoint(0, 0));
5669 pos.y += item->GetRect().height;
5670 m_mapping_popup.Move(pos);
5671
5672 if (obj_ && obj_->get_dev_id() == m_printer_last_select) {
5673 m_mapping_popup.set_parent_item(item);
5674 m_mapping_popup.set_only_show_ext_spool(false);
5675 m_mapping_popup.set_current_filament_id(extruder);
5676 m_mapping_popup.set_tag_texture(materials[extruder]);
5677 m_mapping_popup.set_send_win(this);//fix bug:fisrt click is not valid
5679 m_mapping_popup.Popup();
5680 }
5681 }
5682 });
5683
5684 Material *material_item = new Material();
5685 material_item->id = extruder;
5686 material_item->item = item;
5687 m_materialList[i] = material_item;
5688
5689 // build for ams mapping
5690 if (extruder < materials.size() && extruder >= 0) {
5691 FilamentInfo info;
5692 info.id = extruder;
5693 info.type = materials[extruder];
5694 info.brand = brands[extruder];
5695 info.filament_id = m_filaments_id[extruder];
5696 info.color = wxString::Format("#%02X%02X%02X%02X", colour_rgb.Red(), colour_rgb.Green(), colour_rgb.Blue(), colour_rgb.Alpha()).ToStdString();
5697 m_filaments.push_back(info);
5698 }
5699 }
5700
5701 if (!selected_any && first_enabled) {
5702 m_current_filament_id = first_enabled_id;
5703 first_enabled->on_selected();
5704 }
5705
5706 if (use_double_extruder)
5707 {
5708 m_filament_left_panel->Show();
5709 m_filament_right_panel->Show();
5710 m_filament_panel->Hide();
5711
5712 m_sizer_ams_mapping_left->SetCols(4);
5713 m_sizer_ams_mapping_left->Layout();
5715 m_filament_left_panel->Layout();
5716
5717 m_sizer_ams_mapping_right->SetCols(4);
5718 m_sizer_ams_mapping_right->Layout();
5720 m_filament_right_panel->Layout();
5721 }
5722 else
5723 {
5724 m_filament_left_panel->Hide();
5725 m_filament_right_panel->Hide();
5726 m_filament_panel->Show();
5727 m_sizer_ams_mapping->SetCols(8);
5728 m_sizer_ams_mapping->Layout();
5729 m_filament_panel_sizer->Layout();
5730 }
5731
5732 // Orca: a filament switch feeds both extruders, so the per-nozzle material items collapse into
5733 // the single panel. Reposition once the selected machine's switch state is known (no-op otherwise).
5734 DeviceManager* dev = wxGetApp().getDeviceManager();
5735 update_material_item_pos(dev ? dev->get_selected_machine() : nullptr);
5736
5737 // reset_ams_material();//show "-"
5738}
void update_material_item_pos(MachineObject *obj_)
Definition SelectMachine.cpp:5744
wxString m_ams_tooltip
Definition SelectMachine.hpp:342
ShowType get_filament_mapping_show_type(MachineObject *obj_, int fila_logic_id) const
Definition SelectMachine.cpp:1513
@ Preset
Definition calib.hpp:39

References _L, Slic3r::FilamentGroupUtils::FilamentInfo::color, Slic3r::Preset::config, Slic3r::Preset::filament_id, Slic3r::filament_type(), Slic3r::MachineObject::get_dev_id(), get_filament_mapping_show_type(), Slic3r::DynamicPrintConfig::get_filament_type(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, m_ams_mapping_result, m_ams_tooltip, m_check_flag, m_current_filament_id, Slic3r::GUI::MaterialItem::m_enable, m_filament_left_panel, m_filament_panel, m_filament_panel_left_sizer, m_filament_panel_right_sizer, m_filament_panel_sizer, m_filament_right_panel, m_filaments, m_filaments_map, m_mapping_popup, m_materialList, m_print_status, m_print_type, m_printer_last_select, m_sizer_ams_mapping, m_sizer_ams_mapping_left, m_sizer_ams_mapping_right, Slic3r::Preset::name, Slic3r::GUI::MaterialItem::on_normal(), Slic3r::GUI::MaterialItem::on_selected(), Slic3r::ConfigBase::option(), Slic3r::GUI::BitmapCache::parse_color4(), Slic3r::PresetCollection::preset(), Slic3r::GUI::PrintStatusUnsupportedPrinter, Slic3r::FilamentGroupUtils::FilamentInfo::type, update_material_item_pos(), use_dynamic_nozzle_map(), and Slic3r::GUI::wxMouseEvent.

Referenced by set_default().

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

◆ reset_timeout()

void Slic3r::GUI::SelectMachineDialog::reset_timeout ( )
3972{
3973 m_timeout_count = 0;
3974}

References m_timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ save_option_vals() [1/2]

void Slic3r::GUI::SelectMachineDialog::save_option_vals ( )
private
3229{
3230 DeviceManager* dev_manager = wxGetApp().getDeviceManager();
3231 if (!dev_manager) { return; }
3232
3233 MachineObject* obj = dev_manager->get_my_machine(m_printer_last_select);
3234 if (obj) save_option_vals(obj);
3235}

References Slic3r::DeviceManager::get_my_machine(), m_printer_last_select, and save_option_vals().

Referenced by SelectMachineDialog(), save_option_vals(), and update_select_layout().

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

◆ save_option_vals() [2/2]

void Slic3r::GUI::SelectMachineDialog::save_option_vals ( MachineObject * obj)
private
3237 {
3238 AppConfig *config = wxGetApp().app_config;
3239 if (!config) return;
3240 if (!obj) return;
3241 for (auto item : m_checkbox_list) {
3242 config->set(obj->printer_type, item.first, item.second->getValue());
3243 }
3244}

References m_checkbox_list, Slic3r::MachineObject::printer_type, and Slic3r::AppConfig::set().

Here is the call graph for this function:

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ sending_mode()

void Slic3r::GUI::SelectMachineDialog::sending_mode ( )
1083{
1084 // disable combobox
1085 Enable_Auto_Refill(false);
1086 EnableEditing(false);
1087
1088 m_is_in_sending_mode = true;
1089 if (m_simplebook->GetSelection() != 1){
1090 m_simplebook->SetSelection(1);
1091 Layout();
1092 Fit();
1093 }
1094
1095
1098 for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
1099 it->second->item->disable();
1100 }
1101 }
1102}
@ PrintPageModeSending
Definition SelectMachine.hpp:90

References Enable_Auto_Refill(), EnableEditing(), m_is_in_sending_mode, m_materialList, m_print_page_mode, m_simplebook, and Slic3r::GUI::PrintPageModeSending.

Referenced by on_send_print(), and show_status().

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

◆ set_default()

void Slic3r::GUI::SelectMachineDialog::set_default ( )
5429{
5431 m_printer_box->SetDefault(false);
5432 m_rename_normal_panel->Show(true);
5433 }
5435 m_printer_box->SetDefault(true);
5436 m_rename_normal_panel->Show(false);
5437 }
5438
5439 //project name
5440 m_rename_switch_panel->SetSelection(0);
5441
5442 wxString filename = m_plater->get_export_gcode_filename("", true, m_print_plate_idx == PLATE_ALL_IDX ? true : false);
5443 if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
5444 filename = _L("Untitled");
5445 }
5446
5447 if (filename.empty()) {
5448 filename = m_plater->get_export_gcode_filename("", true);
5449 if (filename.empty()) filename = _L("Untitled");
5450 }
5451
5452 fs::path filename_path(filename.c_str());
5453 std::string file_name = filename_path.filename().string();
5454 if (from_u8(file_name).find(_L("Untitled")) != wxString::npos) {
5455 PartPlate *part_plate = m_plater->get_partplate_list().get_plate(m_print_plate_idx);
5456 if (part_plate) {
5457 if (std::vector<ModelObject *> objects = part_plate->get_objects_on_this_plate(); objects.size() > 0) {
5458 file_name = objects[0]->name;
5459 for (int i = 1; i < objects.size(); i++) {
5460 file_name += (" + " + objects[i]->name);
5461 }
5462 }
5463 if (file_name.size() > 100) {
5464 file_name = file_name.substr(0, 97) + "...";
5465 }
5466 }
5467 }
5468 m_current_project_name = wxString::FromUTF8(file_name);
5469
5470
5471 //unsupported character filter
5472 m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
5473
5475 m_rename_normal_panel->Layout();
5476
5477 //clear combobox
5478 m_list.clear();
5480 m_print_info = "";
5481 m_mapping_sugs_sizer->Show(false);
5482 m_change_filament_times_sizer->Show(false);
5483 m_txt_change_filament_times->Show(false);
5484 m_warn_when_drying_sizer->Show(false);
5485
5486 // rset status bar
5487 m_status_bar->reset();
5488
5489 NetworkAgent* agent = wxGetApp().getAgent();
5490 if (agent) {
5491 if (agent->is_user_login(wxGetApp().get_printer_cloud_provider())) {
5493 }
5494 }
5495
5498 set_default_normal(m_plater->get_partplate_list().get_curr_plate()->thumbnail_data);
5499 }
5503 }
5504
5505 Layout();
5506 Fit();
5507}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
std::string m_print_info
Definition SelectMachine.hpp:331
void reset_and_sync_ams_list()
Definition SelectMachine.cpp:5535
std::string filter_characters(const std::string &str, const std::string &filterChars)
Definition Utils.hpp:768
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298

References _L, Slic3r::filter_characters(), Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::GUI::from_u8(), Slic3r::GUI::PartPlate::get_objects_on_this_plate(), Slic3r::NetworkAgent::is_user_login(), m_change_filament_times_sizer, m_current_project_name, m_list, m_mapping_sugs_sizer, m_plater, m_print_info, m_print_plate_idx, m_print_type, m_printer_box, m_printer_last_select, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, m_status_bar, m_txt_change_filament_times, m_warn_when_drying_sizer, PLATE_ALL_IDX, Slic3r::GUI::PrintStatusInit, reset_and_sync_ams_list(), set_default_from_sdcard(), set_default_normal(), show_status(), and update_page_turn_state().

Referenced by Show().

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

◆ set_default_from_sdcard()

void Slic3r::GUI::SelectMachineDialog::set_default_from_sdcard ( )
6153{
6154 DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
6155 if (!dev_manager) return;
6156 MachineObject *obj_ = dev_manager->get_selected_machine();
6157 if (!obj_) { return; };
6158
6159 m_printer_box->SetPrinterName(wxString::FromUTF8(obj_->get_dev_name()));
6160
6163
6164 ThumbnailData& data = m_required_data_plate_data_list[m_print_plate_idx]->plate_thumbnail;
6165
6166 if (data.pixels.size() > 0) {
6167 wxMemoryInputStream mis((unsigned char*)data.pixels.data(), data.pixels.size());
6168 wxImage image = wxImage(mis);
6169 image = image.Rescale(FromDIP(198), FromDIP(198));
6170 m_thumbnailPanel->set_thumbnail(image);
6171 }
6172
6173 //for black list
6174 std::vector<std::string> materials;
6175 std::vector<std::string> brands;
6176 std::vector<std::string> display_materials;
6177
6178 for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
6179 FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
6180 display_materials.push_back(fo.type);
6181 materials.push_back(fo.type);
6182 brands.push_back(fo.brand);
6183 }
6184
6185 auto opt_nozzle_diameters = m_required_data_config.option<ConfigOptionFloats>("nozzle_diameter");
6186 auto diameters_count = 1;
6187 if (opt_nozzle_diameters) {
6188 diameters_count = opt_nozzle_diameters->size();
6189 }
6190
6191 //std::vector<int> filament_map;
6192 m_filaments_map.clear();
6193 if (m_required_data_plate_data_list[m_print_plate_idx]->config.option<ConfigOptionInts>("filament_map")){
6194 m_filaments_map = m_required_data_plate_data_list[m_print_plate_idx]->config.option<ConfigOptionInts>("filament_map")->values;
6195 }
6196
6197 // ams mapping area
6198 if (diameters_count > 1) {
6199 m_filament_left_panel->Show();
6200 m_filament_right_panel->Show();
6201 m_filament_panel->Hide();
6202
6203 m_sizer_ams_mapping_left->SetCols(4);
6204 m_sizer_ams_mapping_left->Layout();
6206 m_filament_left_panel->Layout();
6207
6208 m_sizer_ams_mapping_right->SetCols(4);
6209 m_sizer_ams_mapping_right->Layout();
6211 m_filament_right_panel->Layout();
6212
6213 } else {
6214 m_filament_left_panel->Hide();
6215 m_filament_right_panel->Hide();
6216 m_filament_panel->Show();
6217 m_sizer_ams_mapping->SetCols(8);
6218 m_sizer_ams_mapping->Layout();
6219 m_filament_panel_sizer->Layout();
6220 }
6221
6222 //init MaterialItem
6223 MaterialHash::iterator iter = m_materialList.begin();
6224 while (iter != m_materialList.end()) {
6225 int id = iter->first;
6226 Material* item = iter->second;
6227 item->item->Destroy();
6228 delete item;
6229 iter++;
6230 }
6231
6232 m_ams_mapping_result.clear();
6233 m_sizer_ams_mapping->Clear();
6234 m_sizer_ams_mapping_left->Clear();
6236 m_materialList.clear();
6237 m_filaments.clear();
6238
6239 bool selected_any = false;
6240 MaterialItem *first_enabled = nullptr;
6241 int first_enabled_id = -1;
6242
6243 for (auto i = 0; i < m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size(); i++) {
6244 FilamentInfo fo = m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info[i];
6245
6246 MaterialItem* item = nullptr;
6247
6248 if (diameters_count > 1) {
6249 if (fo.id < m_filaments_map.size()) {
6250 auto nozzle_id = m_filaments_map[fo.id];
6251
6252 if (nozzle_id == 1) {
6253 item = new MaterialItem(m_filament_left_panel, wxColour(fo.color), fo.get_display_filament_type());
6254 m_sizer_ams_mapping_left->Add(item, 0, wxALL, FromDIP(5));
6255 } else if (nozzle_id == 2) {
6256 item = new MaterialItem(m_filament_right_panel, wxColour(fo.color), fo.get_display_filament_type());
6257 m_sizer_ams_mapping_right->Add(item, 0, wxALL, FromDIP(5));
6258 }
6259 }
6260 } else {
6261 item = new MaterialItem(m_filament_panel, wxColour(fo.color), fo.get_display_filament_type());
6262 m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
6263 }
6264
6265 if (!item) continue;
6266
6267 if (!selected_any && fo.id == m_current_filament_id && item->m_enable) {
6268 item->on_selected();
6269 selected_any = true;
6270 }
6271 if (!first_enabled && item->m_enable) {
6272 first_enabled = item;
6273 first_enabled_id = fo.id;
6274 }
6275
6276 item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent& e) {});
6277 item->Bind(wxEVT_LEFT_DOWN, [this, obj_, item, materials, fo](wxMouseEvent& e) {
6278 if (!item->m_enable) {return;}
6280
6281 MaterialHash::iterator iter = m_materialList.begin();
6282 while (iter != m_materialList.end()) {
6283 int id = iter->first;
6284 Material* item = iter->second;
6285 MaterialItem* m = item->item;
6286 m->on_normal();
6287 iter++;
6288 }
6289
6290 try {
6291 m_current_filament_id = fo.id;
6292 }
6293 catch (...) {}
6294 item->on_selected();
6295
6296
6297 auto mouse_pos = ClientToScreen(e.GetPosition());
6298 wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
6299
6300 if (obj_) {
6301 if (m_mapping_popup.IsShown()) return;
6302 wxPoint pos = item->ClientToScreen(wxPoint(0, 0));
6303 pos.y += item->GetRect().height;
6304 m_mapping_popup.Move(pos);
6305
6307
6308 if (obj_ && obj_->get_dev_id() == m_printer_last_select)
6309 {
6310 m_mapping_popup.set_parent_item(item);
6311 m_mapping_popup.set_current_filament_id(fo.id);
6312 m_mapping_popup.set_tag_texture(fo.type);
6313 m_mapping_popup.set_send_win(this);
6315 m_mapping_popup.Popup();
6316 }
6317 }
6318 });
6319
6320 Material* material_item = new Material();
6321 material_item->id = fo.id;
6322 material_item->item = item;
6323 m_materialList[i] = material_item;
6324
6325 // build for ams mapping
6326 m_filaments.push_back(fo);
6327 }
6328
6329 if (m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size() <= 4) {
6330 m_sizer_ams_mapping->SetCols(m_required_data_plate_data_list[m_print_plate_idx]->slice_filaments_info.size());
6331 }
6332 else {
6333 m_sizer_ams_mapping->SetCols(4);
6334 }
6335
6336 m_basic_panel->Layout();
6337 m_basic_panel->Fit();
6338
6339 wxSize screenSize = wxGetDisplaySize();
6340 auto dialogSize = this->GetSize();
6341
6342 if (!selected_any && first_enabled) {
6343 m_current_filament_id = first_enabled_id;
6344 first_enabled->on_selected();
6345 }
6346
6348
6349 // basic info
6350 try {
6351 float float_time = std::stof(m_required_data_plate_data_list[m_print_plate_idx]->get_gcode_prediction_str());
6352 double float_weight = std::stof(m_required_data_plate_data_list[m_print_plate_idx]->get_gcode_weight_str());
6353 wxString time;
6354 time = wxString::Format("%s", short_time(get_time_dhms(float_time)));
6355 char weight[64];
6356 ::sprintf(weight, "%.2f g", float_weight); // ORCA remove spacing before text
6357 m_stext_time->SetLabel(time);
6358 m_stext_weight->SetLabel(weight);
6359 refresh_save_time(obj_); // no-op for FROM_SDCARD_VIEW (refresh_save_time early-returns)
6360 }
6361 catch (...) {}
6362}
std::string short_time(const std::string &time)
Definition Utils.hpp:563
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:1154
std::string get_time_dhms(float time_in_secs)
Definition Utils.hpp:609

References Slic3r::FilamentGroupUtils::FilamentInfo::color, Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_dev_name(), get_filament_mapping_show_type(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::get_time_dhms(), Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, m_ams_mapping_result, m_basic_panel, m_check_flag, m_current_filament_id, Slic3r::GUI::MaterialItem::m_enable, m_filament_left_panel, m_filament_panel, m_filament_panel_left_sizer, m_filament_panel_right_sizer, m_filament_panel_sizer, m_filament_right_panel, m_filaments, m_filaments_map, m_mapping_popup, m_materialList, m_print_plate_idx, m_print_plate_total, m_print_status, m_print_type, m_printer_box, m_printer_last_select, m_required_data_config, m_required_data_plate_data_list, m_sizer_ams_mapping, m_sizer_ams_mapping_left, m_sizer_ams_mapping_right, m_stext_time, m_stext_weight, m_thumbnailPanel, Slic3r::GUI::MaterialItem::on_normal(), Slic3r::GUI::MaterialItem::on_selected(), Slic3r::ThumbnailData::pixels, Slic3r::GUI::PrintStatusUnsupportedPrinter, refresh_save_time(), reset_ams_material(), Slic3r::short_time(), Slic3r::ConfigOptionVector< double >::size(), Slic3r::FilamentGroupUtils::FilamentInfo::type, update_page_turn_state(), use_dynamic_nozzle_map(), and Slic3r::GUI::wxMouseEvent.

Referenced by init_bind(), and set_default().

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

◆ set_default_normal()

void Slic3r::GUI::SelectMachineDialog::set_default_normal ( const ThumbnailData & data)
6103{
6105 if (data.is_valid()) {
6106 wxImage image(data.width, data.height);
6107 image.InitAlpha();
6108 for (unsigned int r = 0; r < data.height; ++r) {
6109 unsigned int rr = (data.height - 1 - r) * data.width;
6110 for (unsigned int c = 0; c < data.width; ++c) {
6111 unsigned char *px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
6112 image.SetRGB((int) c, (int) r, px[0], px[1], px[2]);
6113 image.SetAlpha((int) c, (int) r, px[3]);
6114 }
6115 }
6116 image = image.Rescale(FromDIP(198), FromDIP(198));
6117 m_thumbnailPanel->set_thumbnail(image);
6118 }
6119
6120 m_basic_panel->Layout();
6121 m_basic_panel->Fit();
6122
6123 // disable pei bed
6124 DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
6125 if (!dev_manager) return;
6126 MachineObject *obj_ = dev_manager->get_selected_machine();
6127 wxSize screenSize = wxGetDisplaySize();
6128 auto dialogSize = this->GetSize();
6129
6130#ifdef __WINDOWS__
6131
6132#endif // __WXOSX_MAC__
6133 // basic info
6134 auto aprint_stats = m_plater->get_partplate_list().get_current_fff_print().print_statistics();
6135 wxString time;
6136 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
6137 if (plate) {
6138 if (plate->get_slice_result()) { time = wxString::Format("%s", short_time(get_time_dhms(plate->get_slice_result()->print_statistics.modes[0].time))); }
6139 }
6140
6141 char weight[64];
6142 if (wxGetApp().app_config->get("use_inches") == "1") {
6143 ::sprintf(weight, "%.2f oz", aprint_stats.total_weight * 0.035274); // ORCA remove spacing before text
6144 } else {
6145 ::sprintf(weight, "%.2f g", aprint_stats.total_weight); // ORCA remove spacing before text
6146 }
6147
6148 m_stext_time->SetLabel(time);
6149 m_stext_weight->SetLabel(weight);
6150}
int64_t px(const Point &pt)
Definition ClipperUtils.cpp:207

References Slic3r::DeviceManager::get_selected_machine(), Slic3r::GUI::PartPlate::get_slice_result(), Slic3r::get_time_dhms(), Slic3r::ThumbnailData::height, Slic3r::ThumbnailData::is_valid(), m_basic_panel, m_plater, m_stext_time, m_stext_weight, m_thumbnailPanel, Slic3r::PrintEstimatedStatistics::modes, Slic3r::ThumbnailData::pixels, Slic3r::GCodeProcessorResult::print_statistics, Slic3r::short_time(), update_page_turn_state(), and Slic3r::ThumbnailData::width.

Referenced by on_set_finish_mapping(), set_default(), and unify_deal_thumbnail_data().

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

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_print_type()

void Slic3r::GUI::SelectMachineDialog::set_print_type ( PrintFromType type)
inline
540{m_print_type = type;};

References m_print_type.

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ Show()

bool Slic3r::GUI::SelectMachineDialog::Show ( bool show)
override
6397{
6398 if (show) {
6399 EnableEditing(true);
6400 m_options_other->Show();
6402
6403 //set a default machine when obj is null
6404 if (DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager()) {
6405 if (!dev->get_selected_machine()) {
6406 dev->load_last_machine();
6407 }
6408 };
6409 } else {
6410 m_refresh_timer->Stop();
6411 return DPIDialog::Show(false);
6412 }
6413 show_init();
6415
6416
6417 PresetBundle& preset_bundle = *wxGetApp().preset_bundle;
6418 const auto& project_config = preset_bundle.project_config;
6419
6421 const ConfigOptionEnum<BedType>* bed_type=project_config.option<ConfigOptionEnum<BedType>>("curr_bed_type");
6422 std::string plate_name;
6423 for (auto& elem : enum_keys_map) {
6424 if (elem.second == bed_type->value)
6425 plate_name = elem.first;
6426 }
6427
6428 m_printer_box->UpdatePlate(plate_name);
6429
6430 // set default value when show this dialog
6431 wxGetApp().UpdateDlgDarkUI(this);
6432 wxGetApp().reset_to_active();
6433 set_default();
6435
6436 Layout();
6437 Fit();
6438 CenterOnParent();
6439 return DPIDialog::Show(show);
6440}
static const t_config_enum_values & get_enum_values()
void set_default()
Definition SelectMachine.cpp:5428
void show_init()
Definition SelectMachine.cpp:6442
std::map< std::string, int > t_config_enum_values
Definition Config.hpp:2072

References EnableEditing(), Slic3r::ConfigOptionEnum< T >::get_enum_values(), LIST_REFRESH_INTERVAL, m_options_other, m_printer_box, m_refresh_timer, Slic3r::GUI::PrintStatusInit, Slic3r::PresetBundle::project_config, set_default(), show_init(), show_status(), update_user_machine_list(), and Slic3r::ConfigOptionSingle< T >::value.

Here is the call graph for this function:

◆ show_errors()

void Slic3r::GUI::SelectMachineDialog::show_errors ( wxString & info)
2732{
2733 ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Errors"));
2734 confirm_dlg.update_text(info);
2735 confirm_dlg.on_show();
2736}

References _L, Slic3r::GUI::ConfirmBeforeSendDialog::on_show(), and Slic3r::GUI::ConfirmBeforeSendDialog::update_text().

Here is the call graph for this function:

◆ show_init()

void Slic3r::GUI::SelectMachineDialog::show_init ( )
6442 {
6443 m_ams_mapping_result.clear();
6444}

References m_ams_mapping_result.

Referenced by Show().

Here is the caller graph for this function:

◆ show_print_failed_info()

void Slic3r::GUI::SelectMachineDialog::show_print_failed_info ( bool show,
int code = 0,
wxString description = wxEmptyString,
wxString extra = wxEmptyString )
979{
980
981 if (show) {
982 if (!m_sw_print_failed_info->IsShown()) {
983 m_sw_print_failed_info->Show(true);
984
985 m_st_txt_error_code->SetLabelText(wxString::Format("%d", m_print_error_code));
986 m_st_txt_error_desc->SetLabelText( wxGetApp().filter_string(m_print_error_msg));
987 m_st_txt_extra_info->SetLabelText( wxGetApp().filter_string(m_print_error_extra));
988
989 m_st_txt_error_code->Wrap(FromDIP(500));
990 m_st_txt_error_desc->Wrap(FromDIP(500));
991 m_st_txt_extra_info->Wrap(FromDIP(500));
992 }
993 else {
994 m_sw_print_failed_info->Show(false);
995 }
996 Layout();
997 Fit();
998 }
999 else {
1000 if (!m_sw_print_failed_info->IsShown()) {return;}
1001 m_sw_print_failed_info->Show(false);
1002 m_st_txt_error_code->SetLabelText(wxEmptyString);
1003 m_st_txt_error_desc->SetLabelText(wxEmptyString);
1004 m_st_txt_extra_info->SetLabelText(wxEmptyString);
1005 Layout();
1006 Fit();
1007 }
1008}
std::string m_print_error_msg
Definition SelectMachine.hpp:328
int m_print_error_code
Definition SelectMachine.hpp:318
std::string m_print_error_extra
Definition SelectMachine.hpp:329

References m_print_error_code, m_print_error_extra, m_print_error_msg, m_st_txt_error_code, m_st_txt_error_desc, m_st_txt_extra_info, and m_sw_print_failed_info.

Referenced by SelectMachineDialog(), init_bind(), and prepare_mode().

Here is the caller graph for this function:

◆ show_status()

void Slic3r::GUI::SelectMachineDialog::show_status ( PrintDialogStatus status,
std::vector< wxString > params = std::vector<wxString>(),
wxString wiki_url = wxEmptyString )
2304{
2305 wxString msg;
2306 wxString tips;
2307
2308 if ( params.size() > 0 ) {
2309 msg = params[0];
2310 } else if (params.size() > 1) {
2311 tips = params[1];
2312 }
2313
2314 if (m_print_status != status) {
2315 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": update_status: " << status << "(" << PrePrintChecker::get_print_status_info(status) << ")";
2316 }
2317 m_print_status = status;
2318
2319 // all message
2320 if (status == PrintDialogStatus::PrintStatusInit) {
2322 Enable_Send_Button(false);
2323 } else if (status == PrintDialogStatus::PrintStatusNoUserLogin) {
2325 Enable_Send_Button(false);
2326 } else if (status == PrintDialogStatus::PrintStatusReadyToGo) {
2328 Enable_Send_Button(true);
2329 } else if (status == PrintDialogStatus::PrintStatusInvalidPrinter) {
2331 Enable_Send_Button(false);
2334 Enable_Send_Button(false);
2335 } else if (status == PrintDialogStatus::PrintStatusReading) {
2337 Enable_Send_Button(false);
2338 } else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
2340 Enable_Send_Button(false);
2341 } else if (status == PrintDialogStatus::PrintStatusModeNotFDM) {
2343 Enable_Send_Button(false);
2344 } else if (status == PrintDialogStatus::PrintStatusInUpgrading) {
2346 Enable_Send_Button(false);
2349 Enable_Send_Button(false);
2350 } else if (status == PrintDialogStatus::PrintStatusInPrinting) {
2352 Enable_Send_Button(false);
2353 } else if (status == PrintDialogStatus::PrintStatusAmsOnSettingup) {
2355 Enable_Send_Button(false);
2358 Enable_Send_Button(false);
2361 Enable_Send_Button(false);
2364 Enable_Send_Button(false);
2367 Enable_Send_Button(false);
2368 } else if (status == PrintStatusNozzleDiameterMismatch) {
2369 // Orca: overridable — a non-standard nozzle is a valid reason to differ. Send is gated on
2370 // the acknowledgement checkbox added to the message board below (add_with_checkbox), which
2371 // is enabled only while the user's acknowledgement still matches the current mismatch.
2374 } else if (status == PrintStatusNozzleTypeMismatch) {
2376 Enable_Send_Button(false);
2377 } else if (status == PrintStatusColorQuantityExceed) {
2379 Enable_Send_Button(false);
2380 // Fill the real per-printer max color count into the %s template.
2381 if (!params.empty())
2382 msg = wxString::Format(m_pre_print_checker.get_pre_state_msg(status), params[0], params[0]);
2384 wxString msg_text;
2385 if (params.size() > 1)
2386 msg_text = wxString::Format(_L("Filament %s does not match the filament in AMS slot %s. Please update the printer firmware to support AMS slot assignment."), params[0], params[1]);
2387 else
2388 msg_text = _L("Filament does not match the filament in AMS slot. Please update the printer firmware to support AMS slot assignment.");
2389
2390 msg = msg_text;
2392 Enable_Send_Button(false);
2394 Enable_Refresh_Button(false);
2395 Enable_Send_Button(false);
2396 } else if (status == PrintDialogStatus::PrintStatusSending) {
2397 Enable_Refresh_Button(false);
2398 Enable_Send_Button(false);
2399 sending_mode();
2400 } else if (status == PrintDialogStatus::PrintStatusLanModeNoSdcard) {
2402 Enable_Send_Button(false);
2405 Enable_Send_Button(false);
2406 } else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
2408 Enable_Send_Button(false);
2411 wxString msg_text;
2412 const bool block_send = status == PrintDialogStatus::PrintStatusUnsupportedPrinter;
2413 try
2414 {
2415 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2416 if (!dev) return;
2417
2418 //source print
2419 MachineObject* obj_ = dev->get_selected_machine();
2420 if (obj_ == nullptr) return;
2421 auto sourcet_print_name = obj_->get_printer_type_display_str();
2422 sourcet_print_name.Replace(wxT("Bambu Lab "), wxEmptyString);
2423
2424 //target print
2425 std::string target_model_id;
2427 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
2428 target_model_id = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
2429 }
2431 if (m_required_data_plate_data_list.size() > 0) {
2432 target_model_id = m_required_data_plate_data_list[m_print_plate_idx]->printer_model_id;
2433 }
2434 }
2435
2436 auto target_print_name = wxString(DevPrinterConfigUtil::get_printer_display_name(target_model_id));
2437 target_print_name.Replace(wxT("Bambu Lab "), wxEmptyString);
2438 if (block_send) {
2439 msg_text = wxString::Format(_L("The selected printer (%s) is incompatible with the print file configuration (%s). Please adjust the printer preset in the prepare page or choose a compatible printer on this page."), sourcet_print_name, target_print_name);
2440 } else {
2441 msg_text = wxString::Format(_L("The selected printer (%s) has an unknown model, so compatibility with the print file configuration (%s) cannot be verified. Please verify the printer preset before sending."), sourcet_print_name, target_print_name);
2442 }
2443
2444
2445 msg = msg_text;
2447 Enable_Send_Button(!block_send);
2448 }
2449 catch (...)
2450 {
2452 Enable_Send_Button(!block_send);
2453 }
2454
2455
2456
2457 } else if (status == PrintDialogStatus::PrintStatusTimelapseNoSdcard) { //this warning
2459 Enable_Send_Button(true);
2462 Enable_Send_Button(false);
2465 Enable_Send_Button(false);
2466 } else if (status == PrintDialogStatus::PrintStatusBlankPlate) {
2468 Enable_Send_Button(false);
2471 Enable_Send_Button(false);
2472 } else if (status == PrintDialogStatus::PrintStatusTimelapseWarning) { //this is warning
2473 wxString msg_text;
2474 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
2475 for (auto warning : plate->get_slice_result()->warnings) {
2476 if (warning.msg == NOT_GENERATE_TIMELAPSE) {
2477 if (warning.error_code == "10014001") {
2478 msg_text = _L("When spiral vase mode is enabled, machines with I3 structure will not generate timelapse videos.");
2479 }
2480 else if (warning.error_code == "10014002") {
2481 msg_text = _L("The current printer does not support timelapse in Traditional Mode when printing By-Object.");
2482 }
2483 }
2484 }
2485 msg = msg_text;
2487 Enable_Send_Button(true);
2490 Enable_Send_Button(true);
2491 } else if (status == PrintStatusToolHeadCoolingFanWarning) {
2493 Enable_Send_Button(true);
2494 } else if (status == PrintStatusMixAmsAndVtSlotWarning) {
2496 Enable_Send_Button(true);
2497 } else if (status == PrintStatusTPUUnsupportAutoCali) {
2499 Enable_Send_Button(false);
2500 } else if (status == PrintStatusTPUUnsupportCaliOn) { // advisory — Send stays enabled
2502 Enable_Send_Button(true);
2503 } else if (status == PrintStatusTPUUnsuggestCali) { // advisory — Send stays enabled
2505 Enable_Send_Button(true);
2506 } else if (status == PrintStatusSmartNozzleBlobNeedAuto) { // advisory — Send stays enabled
2508 Enable_Send_Button(true);
2509 } else if (status == PrintStatusHasFilamentInBlackListError) {
2511 Enable_Send_Button(false);
2512 } else if (status == PrintStatusWarningKvalueNotUsed) {
2514 Enable_Send_Button(true);
2515 } else if (status == PrintStatusHasFilamentInBlackListWarning) {
2517 Enable_Send_Button(true);
2520 Enable_Send_Button(true);
2523 Enable_Send_Button(true);
2524 } else if (status == PrintStatusWarningExtFilamentNotMatch) {
2526 Enable_Send_Button(true);
2528 // Printer is computing the rack nozzle mapping: block Send until it replies.
2530 Enable_Send_Button(false);
2533 Enable_Send_Button(false);
2535 // Extra-waste warning: allow Send.
2537 Enable_Send_Button(true);
2539 // Firmware can't print TPU on the left extruder: block Send.
2541 Enable_Send_Button(false);
2543 // Missing or un-set-up switch required by the slice: block Send.
2545 Enable_Send_Button(false);
2547 // Advisory slicing/hardware mismatch: allow Send.
2549 Enable_Send_Button(true);
2551 // Hardness caution against a rack-mapped nozzle: allow Send.
2553 Enable_Send_Button(true);
2556 Enable_Send_Button(false);
2559 Enable_Send_Button(false);
2560 } else if (status == PrintDialogStatus::PrintStatusRackReading) {
2561 // Rack hotend info is being read: block Send until it finishes.
2563 Enable_Send_Button(false);
2566 // Advisory rack inventory shortfalls: allow Send.
2568 Enable_Send_Button(true);
2570 // Advisory only: per-nozzle K can't follow a filament across extruders.
2572 Enable_Send_Button(true);
2573 }
2574
2575 /*enter perpare mode*/
2576 prepare_mode(false);
2578 // Short label on purpose: the 420px message panel caps its width and a wxCheckBox label
2579 // does not wrap; the full explanation is in the warning text above it.
2580 m_pre_print_checker.add_with_checkbox(status, msg,
2581 _L("I have checked the installed nozzle and want to print anyway."),
2583 [this](bool checked) {
2584 m_nozzle_diameter_ack_msg = checked ? m_nozzle_diameter_mismatch_msg : wxString();
2585 Enable_Send_Button(checked);
2586 });
2587 } else {
2588 m_pre_print_checker.add(status, msg, tips, wiki_url);
2589 }
2590
2591}
static std::string get_printer_display_name(const std::string &type_str)
Definition DevConfigUtil.h:71
::std::string get_print_status_info(PrintDialogStatus status)
Definition PrePrintChecker.cpp:23
wxString m_nozzle_diameter_ack_msg
Definition SelectMachine.hpp:575
void Enable_Refresh_Button(bool en)
Definition SelectMachine.cpp:5378
@ PrintStatusNeedForceUpgrading
Definition PrePrintChecker.hpp:79
@ PrintStatusReadingTimeout
Definition PrePrintChecker.hpp:60
@ PrintStatusNozzleTypeMismatch
Definition PrePrintChecker.hpp:71
@ PrintStatusTPUUnsupportAutoCali
Definition PrePrintChecker.hpp:96
@ PrintStatusFilamentWarningHighChamberTempSoft
Definition PrePrintChecker.hpp:129
@ PrintStatusWarningExtFilamentNotMatch
Definition PrePrintChecker.hpp:131
@ PrintStatusInSystemPrinting
Definition PrePrintChecker.hpp:67
@ PrintStatusTPUUnsuggestCali
Definition PrePrintChecker.hpp:138
@ PrintStatusToolHeadCoolingFanWarning
Definition PrePrintChecker.hpp:112
@ PrintStatusAmsMappingMixInvalid
Definition PrePrintChecker.hpp:95
@ PrintStatusAmsMappingInvalid
Definition PrePrintChecker.hpp:93
@ PrintStatusInvalidPrinter
Definition PrePrintChecker.hpp:58
@ PrintStatusSmartNozzleBlobNeedAuto
Definition PrePrintChecker.hpp:139
@ PrintStatusHasFilamentInBlackListWarning
Definition PrePrintChecker.hpp:126
@ PrintStatusNoSdcard
Definition PrePrintChecker.hpp:77
@ PrintStatusFilamentWarningHighChamberTemp
Definition PrePrintChecker.hpp:127
@ PrintStatusMixAmsAndVtSlotWarning
Definition PrePrintChecker.hpp:111
@ PrintStatusBlankPlate
Definition PrePrintChecker.hpp:82
@ PrintStatusLanModeNoSdcard
Definition PrePrintChecker.hpp:76
@ PrintStatusReadyToGo
Definition PrePrintChecker.hpp:150
@ PrintStatusInPrinting
Definition PrePrintChecker.hpp:68
@ PrintStatusTimelapseWarning
Definition PrePrintChecker.hpp:109
@ PrintStatusFirmwareNotSupportTpuAtLeft
Definition PrePrintChecker.hpp:65
@ PrintStatusColorQuantityExceed
Definition PrePrintChecker.hpp:98
@ PrintStatusConnectingServer
Definition PrePrintChecker.hpp:59
@ PrintStatusAmsOnSettingup
Definition PrePrintChecker.hpp:92
@ PrintStatusFilamentCrossExtruderWarning
Definition PrePrintChecker.hpp:133
@ PrintStatusAmsMappingU0Invalid
Definition PrePrintChecker.hpp:94
@ PrintStatusReading
Definition PrePrintChecker.hpp:61
@ PrintStatusWarningKvalueNotUsed
Definition PrePrintChecker.hpp:125
@ PrintStatusNeedConsistencyUpgrading
Definition PrePrintChecker.hpp:80
@ PrintStatusHasFilamentInBlackListError
Definition PrePrintChecker.hpp:97
@ PrintStatusFilamentWarningNozzleHRC
Definition PrePrintChecker.hpp:132
@ PrintStatusModeNotFDM
Definition PrePrintChecker.hpp:66
@ PrintStatusLanModeSDcardNotAvailable
Definition PrePrintChecker.hpp:78
@ PrintStatusNotSupportedPrintAll
Definition PrePrintChecker.hpp:81
@ PrintStatusFilamentWarningUnknownHighChamberTempSoft
Definition PrePrintChecker.hpp:130
@ PrintStatusOptionalPrinterModel
Definition PrePrintChecker.hpp:120
@ PrintStatusTPUUnsupportCaliOn
Definition PrePrintChecker.hpp:137
@ PrintStatusFilamentWarningHighChamberTempCloseDoor
Definition PrePrintChecker.hpp:128
@ PrintStatusNoUserLogin
Definition PrePrintChecker.hpp:57
@ PrintStatusInUpgrading
Definition PrePrintChecker.hpp:64

References _L, Enable_Refresh_Button(), Enable_Send_Button(), Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::PresetCollection::get_edited_preset(), Slic3r::GUI::PrePrintChecker::get_print_status_info(), Slic3r::DevPrinterConfigUtil::get_printer_display_name(), Slic3r::Preset::get_printer_type(), Slic3r::MachineObject::get_printer_type_display_str(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::GUI::PartPlate::get_slice_result(), m_nozzle_diameter_ack_msg, m_nozzle_diameter_mismatch_msg, m_plater, m_pre_print_checker, m_print_plate_idx, m_print_status, m_print_type, m_required_data_plate_data_list, NOT_GENERATE_TIMELAPSE, prepare_mode(), Slic3r::PresetBundle::printers, Slic3r::GUI::PrintStatusAmsMappingInvalid, Slic3r::GUI::PrintStatusAmsMappingMixInvalid, Slic3r::GUI::PrintStatusAmsMappingU0Invalid, Slic3r::GUI::PrintStatusAmsOnSettingup, Slic3r::GUI::PrintStatusBlankPlate, Slic3r::GUI::PrintStatusColorQuantityExceed, Slic3r::GUI::PrintStatusConnectingServer, Slic3r::GUI::PrintStatusFilamentCrossExtruderWarning, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTemp, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTempCloseDoor, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTempSoft, Slic3r::GUI::PrintStatusFilamentWarningNozzleHRC, Slic3r::GUI::PrintStatusFilamentWarningUnknownHighChamberTempSoft, Slic3r::GUI::PrintStatusFilaSwitcherError, Slic3r::GUI::PrintStatusFilaSwitcherSlicingNotMatch, Slic3r::GUI::PrintStatusFirmwareNotSupportTpuAtLeft, Slic3r::GUI::PrintStatusHasFilamentInBlackListError, Slic3r::GUI::PrintStatusHasFilamentInBlackListWarning, Slic3r::GUI::PrintStatusHasUnreliableNozzleWarning, Slic3r::GUI::PrintStatusInit, Slic3r::GUI::PrintStatusInPrinting, Slic3r::GUI::PrintStatusInSystemPrinting, Slic3r::GUI::PrintStatusInUpgrading, Slic3r::GUI::PrintStatusInvalidPrinter, Slic3r::GUI::PrintStatusLanModeNoSdcard, Slic3r::GUI::PrintStatusLanModeSDcardNotAvailable, Slic3r::GUI::PrintStatusMixAmsAndVtSlotWarning, Slic3r::GUI::PrintStatusModeNotFDM, Slic3r::GUI::PrintStatusNeedConsistencyUpgrading, Slic3r::GUI::PrintStatusNeedForceUpgrading, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotSupportedPrintAll, Slic3r::GUI::PrintStatusNoUserLogin, Slic3r::GUI::PrintStatusNozzleDataInvalid, Slic3r::GUI::PrintStatusNozzleDiameterMismatch, Slic3r::GUI::PrintStatusNozzleMatchInvalid, Slic3r::GUI::PrintStatusNozzleNoMatchedHotends, Slic3r::GUI::PrintStatusNozzleRackMaximumInstalled, Slic3r::GUI::PrintStatusNozzleTypeMismatch, Slic3r::GUI::PrintStatusOptionalPrinterModel, Slic3r::GUI::PrintStatusRackNozzleMappingError, Slic3r::GUI::PrintStatusRackNozzleMappingWaiting, Slic3r::GUI::PrintStatusRackNozzleMappingWarning, Slic3r::GUI::PrintStatusRackNozzleNumUnmeetWarning, Slic3r::GUI::PrintStatusRackReading, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusReadyToGo, Slic3r::GUI::PrintStatusRefreshingMachineList, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::PrintStatusSmartNozzleBlobNeedAuto, Slic3r::GUI::PrintStatusTimelapseNoSdcard, Slic3r::GUI::PrintStatusTimelapseStorageLow, Slic3r::GUI::PrintStatusTimelapseWarning, Slic3r::GUI::PrintStatusToolHeadCoolingFanWarning, Slic3r::GUI::PrintStatusTPUUnsuggestCali, Slic3r::GUI::PrintStatusTPUUnsupportAutoCali, Slic3r::GUI::PrintStatusTPUUnsupportCaliOn, Slic3r::GUI::PrintStatusUnsupportedPrinter, Slic3r::GUI::PrintStatusWarningExtFilamentNotMatch, Slic3r::GUI::PrintStatusWarningKvalueNotUsed, sending_mode(), and Slic3r::GCodeProcessorResult::warnings.

Referenced by check_sdcard_for_timelpase(), check_timelapse_storage_warning(), CheckErrorDynamicSwitchNozzle(), CheckErrorExtruderNozzleWithSlicing(), CheckErrorRackStatus(), CheckErrorSyncNozzleMappingResultV0(), CheckErrorSyncNozzleMappingResultV1(), CheckWarningRackStatus(), on_print_job_cancel(), on_refresh(), on_selection_changed(), on_send_print(), set_default(), Show(), update_printer_combobox(), update_show_status(), and UpdateStatusCheckWarning_ExtensionTool().

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

◆ show_timelapse_folder_popup()

void Slic3r::GUI::SelectMachineDialog::show_timelapse_folder_popup ( )
private
3266{
3267 // Orca: this popup is an Orca-themed implementation (RadioBox + Label, mirroring the
3268 // SendToPrinter storage selector) rather than a straight port of the upstream widget.
3270 m_timelapse_storage_popup->Dismiss();
3271 return;
3272 }
3273
3274 // build popup with rounded corners + themed border
3275 const wxColour popup_bg = wxGetApp().dark_mode() ? wxColour("#333337") : wxColour(0xF0, 0xF0, 0xF0);
3276 const wxColour popup_border = StateColor::darkModeColorFor(wxColour(0xCE, 0xCE, 0xCE));
3277 m_timelapse_storage_popup = new PopupWindow(this, wxBORDER_NONE);
3278 m_timelapse_storage_popup->SetBackgroundColour(popup_bg);
3279 m_timelapse_storage_popup->Bind(wxEVT_PAINT, [this, popup_bg, popup_border](wxPaintEvent&) {
3280 wxPaintDC dc(m_timelapse_storage_popup);
3281 auto size = m_timelapse_storage_popup->GetSize();
3282 dc.SetPen(wxPen(popup_border));
3283 dc.SetBrush(wxBrush(popup_bg));
3284 dc.DrawRoundedRectangle(0, 0, size.x, size.y, FromDIP(8));
3285 });
3286
3287 auto* panel = new wxPanel(m_timelapse_storage_popup, wxID_ANY);
3288 panel->SetBackgroundColour(popup_bg);
3289
3290 // horizontal layout: [ Internal] [External]
3291 auto* sizer = new wxBoxSizer(wxHORIZONTAL);
3292
3293 DeviceManager* dev_popup = wxGetApp().getDeviceManager();
3294 MachineObject* obj_popup = dev_popup ? dev_popup->get_selected_machine() : nullptr;
3295 bool has_sdcard = obj_popup && obj_popup->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_NORMAL;
3296 // if external was previously selected but sdcard is now absent, fall back to internal
3297 if (!has_sdcard && m_timelapse_storage == "external")
3298 m_timelapse_storage = "internal";
3299
3300 // Reuse the themed RadioBox widget (radio_on / radio_off bitmaps) instead of the
3301 // native wxRadioButton: the selected state shows a clear filled dot with good
3302 // contrast on every platform, matching the storage selector in SendToPrinter.
3303 auto make_item = [&](const wxString& label, const std::string& val, bool enabled) {
3304 auto* radio = new RadioBox(panel);
3305 radio->SetValue(m_timelapse_storage == val);
3306 if (enabled) radio->Enable(); else radio->Disable();
3307
3308 auto* text = new Label(panel, Label::Body_14, label);
3309 text->SetForegroundColour(enabled ? (wxGetApp().dark_mode() ? wxColour("#E5E5E4") : wxColour(0x5C, 0x5C, 0x5C))
3310 : StateColor::darkModeColorFor(wxColour(0xAC, 0xAC, 0xAC)));
3311
3312 if (enabled) {
3313 auto on_select = [this, val](wxMouseEvent&) {
3314 m_timelapse_storage = val;
3317 DeviceManager* dev = wxGetApp().getDeviceManager();
3318 MachineObject* obj = dev ? dev->get_selected_machine() : nullptr;
3319 if (obj) check_timelapse_storage_warning(obj);
3320 };
3321 radio->Bind(wxEVT_LEFT_DOWN, on_select);
3322 text->Bind(wxEVT_LEFT_DOWN, on_select);
3323 }
3324
3325 sizer->Add(radio, 0, wxALIGN_CENTER_VERTICAL);
3326 sizer->Add(text, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(6));
3327 };
3328
3329 make_item(_L("Internal"), "internal", true);
3330 sizer->AddSpacer(FromDIP(16));
3331 make_item(_L("External"), "external", has_sdcard);
3332
3333 panel->SetSizer(sizer);
3334 panel->Fit();
3335
3336 auto* outer = new wxBoxSizer(wxVERTICAL);
3337 outer->Add(panel, 0, wxALL, FromDIP(10));
3338 m_timelapse_storage_popup->SetSizer(outer);
3340
3341 // restore normal icon when popup is dismissed
3342 m_timelapse_storage_popup->Bind(wxEVT_SHOW, [this](wxShowEvent& e) {
3343 if (!e.IsShown())
3345 e.Skip();
3346 });
3347
3348 wxPoint pos = m_timelapse_folder_btn->ClientToScreen(wxPoint(0, m_timelapse_folder_btn->GetSize().GetHeight()));
3349 m_timelapse_storage_popup->Position(pos, wxSize(0, 0));
3350
3351 // switch to active icon before showing popup
3352 m_timelapse_folder_btn->SetBitmap(create_scaled_bitmap("folder-closed-active", m_timelapse_folder_btn, 16));
3353 m_timelapse_folder_btn->Refresh();
3354
3356}
static wxFont Body_14
Definition Label.hpp:53
void check_timelapse_storage_warning(MachineObject *obj)
Definition SelectMachine.cpp:3358

References _L, Label::Body_14, check_timelapse_storage_warning(), create_scaled_bitmap(), StateColor::darkModeColorFor(), Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetStorage(), Slic3r::DevStorage::HAS_SDCARD_NORMAL, m_timelapse_folder_btn, m_timelapse_storage, m_timelapse_storage_popup, update_timelapse_folder_btn_icon(), and Slic3r::GUI::wxMouseEvent.

Referenced by SelectMachineDialog().

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

◆ show_timelapse_storage_dialog()

void Slic3r::GUI::SelectMachineDialog::show_timelapse_storage_dialog ( MachineObject * obj)
private
3454{
3455 bool is_internal = (m_timelapse_storage == "internal");
3456 // file_count < 0 is the printer's "no video files" sentinel; 0 or more means files exist (0 also covers replies that omit the key).
3457 bool has_video_files = obj->timelapse_storage_file_count >= 0;
3458 // internal: 2 buttons (Confirm & Print, Cancel Timelapse)
3459 // external + has files: 3 buttons (Confirm & Print, Cancel Timelapse, Clean Up)
3460 // external + no files: 1 button (Cancel Timelapse only)
3461 bool show_confirm_btn = is_internal || has_video_files;
3462 bool show_cleanup_btn = !is_internal && has_video_files;
3463
3464 wxString body_text;
3465 if (is_internal)
3466 body_text = _L("Low internal storage. This timelapse will overwrite the oldest video files.");
3467 else if (has_video_files)
3468 body_text = _L("Low external storage. This timelapse will overwrite the oldest video files.");
3469 else
3470 body_text = _L("Insufficient external storage for time-lapse photography. Connect to computer to delete files, or use a larger memory card.");
3471
3472 wxDialog dlg(this, wxID_ANY, _L("Storage Space Not Enough"),
3473 wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE);
3474 dlg.SetBackgroundColour(*wxWHITE);
3475
3476 auto* main_sizer = new wxBoxSizer(wxVERTICAL);
3477
3478 // warning icon + text row
3479 auto* msg_sizer = new wxBoxSizer(wxHORIZONTAL);
3480 auto* warn_bmp = new wxStaticBitmap(&dlg, wxID_ANY,
3481 create_scaled_bitmap("obj_warning", &dlg, 16), wxDefaultPosition, wxSize(FromDIP(16), FromDIP(16)));
3482 auto* msg_label = new Label(&dlg, body_text);
3483 msg_label->SetFont(Label::Body_14);
3484 msg_label->SetForegroundColour(wxGetApp().dark_mode() ? wxColour("#EFEFF0") : wxColour(0x33, 0x33, 0x33));
3485 msg_label->Wrap(FromDIP(340));
3486 msg_sizer->Add(warn_bmp, 0, wxALIGN_TOP | wxRIGHT, FromDIP(6));
3487 msg_sizer->Add(msg_label, 1, wxEXPAND);
3488 main_sizer->Add(msg_sizer, 0, wxALL | wxEXPAND, FromDIP(20));
3489
3490 auto* btn_sizer = new wxBoxSizer(wxVERTICAL);
3491
3492 const int ID_CLEANUP = wxID_HIGHEST + 1; // distinct from wxID_CANCEL (X button)
3493
3494 // use int id to distinguish choices: wxID_OK=confirm, wxID_NO=cancel_tl, ID_CLEANUP=cleanup
3495 if (show_confirm_btn) {
3496 auto* btn_confirm = new Button(&dlg, _L("Confirm & Print"));
3497 // Orca: use the accent green rather than the reference's hard-coded confirm colour.
3498 StateColor confirm_bg(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
3499 btn_confirm->SetBackgroundColor(confirm_bg);
3500 btn_confirm->SetTextColor(StateColor(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal)));
3501 btn_confirm->Bind(wxEVT_BUTTON, [&dlg](wxCommandEvent&) { dlg.EndModal(wxID_OK); });
3502 btn_sizer->Add(btn_confirm, 0, wxEXPAND | wxBOTTOM, FromDIP(8));
3503 }
3504
3505 auto* btn_cancel_tl = new Button(&dlg, _L("Cancel Timelapse & Print"));
3506 if (!show_confirm_btn) {
3507 // Orca: use the accent green rather than the reference's hard-coded confirm colour.
3508 StateColor cancel_bg(std::pair<wxColour, int>(wxColour(0, 150, 136), StateColor::Normal));
3509 btn_cancel_tl->SetBackgroundColor(cancel_bg);
3510 btn_cancel_tl->SetTextColor(StateColor(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal)));
3511 }
3512 btn_cancel_tl->Bind(wxEVT_BUTTON, [&dlg](wxCommandEvent&) { dlg.EndModal(wxID_NO); });
3513 btn_sizer->Add(btn_cancel_tl, 0, wxEXPAND | (show_cleanup_btn ? wxBOTTOM : 0), FromDIP(8));
3514
3515 if (show_cleanup_btn) {
3516 auto* btn_cleanup = new Button(&dlg, _L("Clean Up"));
3517 btn_cleanup->Bind(wxEVT_BUTTON, [&dlg](wxCommandEvent&) { dlg.EndModal(ID_CLEANUP); });
3518 btn_sizer->Add(btn_cleanup, 0, wxEXPAND);
3519 }
3520
3521 main_sizer->Add(btn_sizer, 0, wxLEFT | wxRIGHT | wxBOTTOM | wxEXPAND, FromDIP(20));
3522 dlg.SetSizer(main_sizer);
3523 dlg.Fit();
3524 dlg.CenterOnParent();
3525 wxGetApp().UpdateDlgDarkUI(&dlg);
3526
3527 // ShowModal returns after the dialog closes; handle the action outside the modal stack.
3528 // wxID_CANCEL is returned when the user clicks X (close button) -> do nothing in that case.
3529 int result = dlg.ShowModal();
3530
3531 if (result == wxID_OK) {
3532 // Confirm & Print
3533 obj->command_ipcam_delete_oldest_timelapse(m_timelapse_storage, m_timelapse_total_layer);
3534 on_send_print();
3535 } else if (result == wxID_NO) {
3536 // Cancel Timelapse & Print
3537 m_checkbox_list["timelapse"]->setValue("off");
3538 on_send_print();
3539 } else if (result == ID_CLEANUP) {
3540 // Clean Up: close SelectMachineDialog and navigate
3542 }
3543 // wxID_CANCEL (X button): do nothing, user dismissed the dialog
3544}
wxString btn_confirm[10]
Definition Button.cpp:196
int m_timelapse_total_layer
Definition SelectMachine.hpp:367
@ Normal
Definition StateColor.hpp:16

References _L, Label::Body_14, btn_confirm, Slic3r::MachineObject::command_ipcam_delete_oldest_timelapse(), create_scaled_bitmap(), m_checkbox_list, m_timelapse_storage, m_timelapse_total_layer, navigate_to_timelapse_page(), StateColor::Normal, on_send_print(), and Slic3r::MachineObject::timelapse_storage_file_count.

Referenced by on_timelapse_storage_check_result().

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

◆ ShowModal()

◆ slicing_with_fila_switch()

bool Slic3r::GUI::SelectMachineDialog::slicing_with_fila_switch ( ) const
1681{
1683 return true;
1684
1685 if (m_print_type == FROM_NORMAL) {
1686 auto has_filament_switcher = wxGetApp().preset_bundle->project_config.option<ConfigOptionBool>("has_filament_switcher");
1687 if (has_filament_switcher)
1688 return has_filament_switcher->value;
1689 } else if (m_print_type == FROM_SDCARD_VIEW) {
1690 if (m_required_data_plate_data_list.size() > (size_t) m_print_plate_idx) {
1691 auto has_filament_switcher = m_required_data_plate_data_list[m_print_plate_idx]->config.option<ConfigOptionBool>("has_filament_switcher");
1692 if (has_filament_switcher)
1693 return has_filament_switcher->value;
1694 }
1695 auto has_filament_switcher = m_required_data_config.option<ConfigOptionBool>("has_filament_switcher");
1696 if (has_filament_switcher)
1697 return has_filament_switcher->value;
1698 }
1699 return false;
1700}

References Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, m_print_plate_idx, m_print_type, m_required_data_config, m_required_data_plate_data_list, use_dynamic_nozzle_map(), and Slic3r::ConfigOptionSingle< T >::value.

Referenced by CheckErrorDynamicSwitchNozzle().

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

◆ start_timelapse_storage_check()

void Slic3r::GUI::SelectMachineDialog::start_timelapse_storage_check ( MachineObject * obj)
private
3381{
3382 if (!obj) { on_send_print(); return; }
3383
3384 // get total layer count from the sliced result
3385 // Orca: PrintStatistics::Mode has no per-layer time vector (unlike the reference), so
3386 // derive the timelapse layer count from the sliced print objects instead.
3389 PartPlate* plate = m_plater->get_partplate_list().get_curr_plate();
3390 if (plate && plate->fff_print()) {
3391 for (const PrintObject* po : plate->fff_print()->objects())
3392 m_timelapse_total_layer = std::max(m_timelapse_total_layer, (int)po->layer_count());
3393 }
3394 }
3395
3396 obj->timelapse_storage_check_done = false;
3397 obj->timelapse_storage_check_result = -1;
3398 obj->command_ipcam_check_timelapse_storage(m_timelapse_storage, m_timelapse_total_layer);
3399
3400 // start polling timer
3403 m_timelapse_check_timer = new wxTimer(this);
3405 }
3407}
void on_timelapse_storage_check_timer(wxTimerEvent &event)
Definition SelectMachine.cpp:3409

References Slic3r::MachineObject::command_ipcam_check_timelapse_storage(), Slic3r::GUI::PartPlate::fff_print(), Slic3r::GUI::FROM_NORMAL, m_plater, m_print_type, m_timelapse_check_elapsed_ms, m_timelapse_check_interval_ms, m_timelapse_check_timer, m_timelapse_storage, m_timelapse_total_layer, Slic3r::Print::objects(), on_send_print(), on_timelapse_storage_check_timer(), Slic3r::MachineObject::timelapse_storage_check_done, and Slic3r::MachineObject::timelapse_storage_check_result.

Referenced by on_ok_btn().

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

◆ sync_ams_mapping_result()

void Slic3r::GUI::SelectMachineDialog::sync_ams_mapping_result ( std::vector< FilamentInfo > & result)
1117{
1118 // A rack / filament-switcher printer grows its filament cards to show the mapped-nozzle row.
1119 // Reflow the grid so the taller cards aren't clipped; no-op for printers that never show it.
1120 auto relayout_nozzle_cards = [this]() {
1121 DeviceManager* dev = wxGetApp().getDeviceManager();
1122 MachineObject* obj_ = dev ? dev->get_selected_machine() : nullptr;
1123 if (!obj_) return;
1124 DevNozzleSystem* ns = obj_->GetNozzleSystem();
1125 if (!obj_->GetFilaSwitch()->IsInstalled() && !(ns && ns->GetNozzleRack()->IsSupported())) return;
1128 if (m_sizer_ams_mapping) { m_sizer_ams_mapping->Layout(); m_filament_panel_sizer->Layout(); m_filament_panel->Layout(); }
1129 if (m_scroll_area) { m_scroll_area->Layout(); }
1130 Layout();
1131 };
1132
1133 if (result.empty()) {
1134 BOOST_LOG_TRIVIAL(info) << "ams_mapping result is empty";
1135 for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
1136 wxString ams_id = _L("Ext");//
1137 wxColour ams_col = wxColour(0xCE, 0xCE, 0xCE);
1138 it->second->item->set_ams_info(ams_col, ams_id);
1139 it->second->item->set_nozzle_info(get_mapped_nozzle_str(it->first));
1140 }
1141 relayout_nozzle_cards();
1142 return;
1143 }
1144
1145 for (auto f = result.begin(); f != result.end(); f++) {
1146 BOOST_LOG_TRIVIAL(trace) << "ams_mapping f id = " << f->id << ", tray_id = " << f->tray_id << ", color = " << f->color << ", type = " << f->type;
1147
1148 MaterialHash::iterator iter = m_materialList.begin();
1149 while (iter != m_materialList.end()) {
1150 int id = iter->second->id;
1151 Material * item = iter->second;
1152 MaterialItem *m = item->item;
1153
1154 if (f->id == id) {
1155 wxString ams_id;
1156 wxColour ams_col;
1157
1158 if (f->tray_id == VIRTUAL_TRAY_MAIN_ID || f->tray_id == VIRTUAL_TRAY_DEPUTY_ID)
1159 {
1160 ams_id = _L("Ext");
1161 }else if (f->tray_id >= 0) {
1162 ams_id = wxGetApp().transition_tridid(f->tray_id);
1163 } else {
1164 ams_id = "-";
1165 }
1166
1167 if (!f->color.empty()) {
1168 ams_col = DevAmsTray::decode_color(f->color);
1169 } else {
1170 // default color
1171 ams_col = wxColour(0xCE, 0xCE, 0xCE);
1172 }
1173 std::vector<wxColour> cols;
1174 for (auto col : f->colors) {
1175 cols.push_back(DevAmsTray::decode_color(col));
1176 }
1177 m->set_ams_info(ams_col, ams_id,f->ctype, cols);
1178 m->set_nozzle_info(get_mapped_nozzle_str(id));
1179 break;
1180 }
1181 iter++;
1182 }
1183 }
1184 relayout_nozzle_cards();
1185 wxString tab_name = wxGetApp().tab_panel()->GetSelectedPageName();
1186 if (tab_name == TAB_ID_PREPARE || tab_name == TAB_ID_PREVIEW) {
1188 }
1189}
#define TAB_ID_PREPARE
Definition MainFrame.hpp:60
#define TAB_ID_PREVIEW
Definition MainFrame.hpp:61
static wxColour decode_color(const std::string &color)
Definition DevFilaSystem.cpp:38
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173

References _L, Slic3r::DevAmsTray::decode_color(), Slic3r::f(), get_mapped_nozzle_str(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetFilaSwitch(), Slic3r::DevNozzleSystem::GetNozzleRack(), Slic3r::MachineObject::GetNozzleSystem(), Slic3r::DevFilaSwitch::IsInstalled(), Slic3r::GUI::Material::item, m_filament_left_panel, m_filament_panel, m_filament_panel_left_sizer, m_filament_panel_right_sizer, m_filament_panel_sizer, m_filament_right_panel, m_materialList, m_scroll_area, m_sizer_ams_mapping, m_sizer_ams_mapping_left, m_sizer_ams_mapping_right, Slic3r::GUI::MaterialItem::set_ams_info(), Slic3r::GUI::MaterialItem::set_nozzle_info(), TAB_ID_PREPARE, TAB_ID_PREVIEW, Slic3r::trace(), updata_thumbnail_data_after_connected_printer(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by CheckErrorSyncNozzleMappingResultV0(), CheckErrorSyncNozzleMappingResultV1(), do_ams_mapping(), and update_show_status().

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

◆ sys_color_changed()

void Slic3r::GUI::SelectMachineDialog::sys_color_changed ( )
6384{
6385 if (wxGetApp(). dark_mode()) {
6386 //rename_button->SetIcon("ams_editable_light");
6387 m_rename_button->SetBitmap(rename_editable_light->bmp());
6388
6389 }
6390 else {
6391 m_rename_button->SetBitmap(rename_editable->bmp());
6392 }
6393 m_rename_button->Refresh();
6394}

References m_rename_button, rename_editable, and rename_editable_light.

◆ unify_deal_thumbnail_data()

void Slic3r::GUI::SelectMachineDialog::unify_deal_thumbnail_data ( ThumbnailData & input_data,
ThumbnailData & no_light_data )
6015 {
6016 if (input_data.width == 0 || input_data.height == 0 || no_light_data.width == 0 || no_light_data.height == 0) {
6017 BOOST_LOG_TRIVIAL(error) << "SelectMachineDialog::no_light_data is empty,error";
6018 return;
6019 }
6020 m_cur_input_thumbnail_data = input_data;
6021 m_cur_no_light_thumbnail_data = no_light_data;
6023 MaterialHash::iterator iter = m_materialList.begin();
6024 if (m_cur_colors_in_thumbnail.size() > 0) {
6025 change_default_normal(-1, wxColour());
6028 } else {
6029 set_default_normal(input_data);
6030 }
6031}
void clone_thumbnail_data()
Definition SelectMachine.cpp:5835

References change_default_normal(), clone_thumbnail_data(), final_deal_edge_pixels_data(), Slic3r::ThumbnailData::height, m_cur_colors_in_thumbnail, m_cur_input_thumbnail_data, m_cur_no_light_thumbnail_data, m_materialList, m_preview_thumbnail_data, set_default_normal(), and Slic3r::ThumbnailData::width.

Referenced by updata_thumbnail_data_after_connected_printer().

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

◆ updata_thumbnail_data_after_connected_printer()

void Slic3r::GUI::SelectMachineDialog::updata_thumbnail_data_after_connected_printer ( )
6005{
6006 // change thumbnail_data
6007 ThumbnailData &input_data = m_plater->get_partplate_list().get_curr_plate()->thumbnail_data;
6008 ThumbnailData &no_light_data = m_plater->get_partplate_list().get_curr_plate()->no_light_thumbnail_data;
6009 if (input_data.width == 0 || input_data.height == 0 || no_light_data.width == 0 || no_light_data.height == 0) {
6010 wxGetApp().plater()->update_all_plate_thumbnails(false);
6011 }
6012 unify_deal_thumbnail_data(input_data, no_light_data);
6013}
void unify_deal_thumbnail_data(ThumbnailData &input_data, ThumbnailData &no_light_data)
Definition SelectMachine.cpp:6015

References Slic3r::ThumbnailData::height, m_plater, unify_deal_thumbnail_data(), and Slic3r::ThumbnailData::width.

Referenced by do_ams_mapping(), and sync_ams_mapping_result().

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

◆ update_ams_check()

void Slic3r::GUI::SelectMachineDialog::update_ams_check ( MachineObject * obj)
4304{
4305 if (!obj) {return;}
4306
4307 if (!obj->is_enable_np) {
4308 if (obj->HasAms()) {
4310 }
4311 else {
4313 }
4314 }else{
4316 }
4317}

References change_materialitem_tip(), Slic3r::MachineObject::HasAms(), and Slic3r::MachineObject::is_enable_np.

Referenced by update_show_status().

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

◆ update_best_pos_dialog()

void Slic3r::GUI::SelectMachineDialog::update_best_pos_dialog ( wxCommandEvent & evt)
2280{
2281 if (!m_best_pos_dialog) return; // Orca: only relevant while the popup is open
2282 DeviceManager* dev = wxGetApp().getDeviceManager();
2283 MachineObject* obj_ = dev ? dev->get_selected_machine() : nullptr;
2284 if (!obj_) return;
2285 update_show_status(obj_);
2286
2287 auto save_time = get_filament_change_gap_time(obj_);
2288 wxString text{};
2289 if (save_time.has_value() && save_time.value() >= 1)
2290 text = FormatTime(*save_time);
2291
2292 std::map<int, int> best_pos_map;
2293 for (const auto& slot : m_ams_mapping_result) {
2294 if (!is_at_suggested_pos(obj_, slot.id)) {
2295 auto pos = get_filament_suggest_pos(obj_, slot.id);
2296 if (pos.has_value())
2297 best_pos_map[slot.id] = pos.value();
2298 }
2299 }
2300 m_best_pos_dialog->UpdateInfo(obj_, best_pos_map, m_ams_mapping_result, text);
2301}

References FormatTime(), get_filament_change_gap_time(), get_filament_suggest_pos(), Slic3r::DeviceManager::get_selected_machine(), is_at_suggested_pos(), m_ams_mapping_result, m_best_pos_dialog, and update_show_status().

Referenced by SelectMachineDialog().

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

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

◆ update_filament_change_count()

void Slic3r::GUI::SelectMachineDialog::update_filament_change_count ( )
4321{
4322 /*check filament change times*/
4323 PartPlate * part_plate = m_plater->get_partplate_list().get_curr_plate();
4324 PrintBase * print = nullptr;
4325 GCodeResult *gcode_result = nullptr;
4326
4327 m_change_filament_times_sizer->Show(false);
4328 m_txt_change_filament_times->Show(false);
4329 m_mapping_sugs_sizer->Show(false);
4330 m_link_edit_nozzle->Show(false);
4331
4332 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
4333 if (!dev) return;
4334 MachineObject *obj = dev->get_selected_machine();
4335 if (!obj) return;
4336 if (m_print_type == FROM_SDCARD_VIEW) return;
4337
4338 std::vector<int> filament_ids;
4339 for (auto mr : m_ams_mapping_result) {
4340 if (mr.ams_id == std::to_string(VIRTUAL_TRAY_MAIN_ID) || mr.ams_id == std::to_string(VIRTUAL_TRAY_DEPUTY_ID)) {
4341 filament_ids.push_back(mr.id);
4342 }
4343 }
4344
4345 /*check nozzle & filament is it the best*/
4346 auto stats = m_plater->get_partplate_list().get_current_fff_print().statistics_by_extruder();
4347 auto best = stats.stats_by_multi_extruder_best;
4348 auto curr = stats.stats_by_multi_extruder_curr;
4349
4350 // Per-nozzle flush_filament_change_count. Equals the per-extruder filament_change_count for
4351 // single-nozzle-per-extruder printers, so this suggestion's shown value is unchanged.
4352 int hand_changes_count = curr.flush_filament_change_count - best.flush_filament_change_count;
4353 int saving_weight = curr.filament_flush_weight - best.filament_flush_weight;
4354
4355 if (obj->GetExtderSystem()->GetTotalExtderCount() > 1) { m_link_edit_nozzle->Show(true); }
4356
4357 if (hand_changes_count > 0 || saving_weight > 0) {
4358 m_mapping_sugs_sizer->Show(true);
4360 m_txt_change_filament_times->Show(true);
4361 m_txt_change_filament_times->SetLabel(wxString::Format(_L_PLURAL("Cost %dg filament and %d change more than optimal grouping.",
4362 "Cost %dg filament and %d changes more than optimal grouping.", hand_changes_count),
4363 saving_weight, hand_changes_count));
4364 m_txt_change_filament_times->Wrap(FromDIP(580));
4366 }
4367
4368 Layout();
4369 Fit();
4370}
GCodeProcessorResult GCodeResult
Definition PartPlate.hpp:98
zaa_minimize_perimeter_height filament_ids((ConfigOptionStrings, filament_colour))((ConfigOptionStrings
#define _L_PLURAL(s, plural, n)
Definition I18N.hpp:96

References _L_PLURAL, Slic3r::filament_ids(), Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevExtderSystem::GetTotalExtderCount(), m_ams_mapping_result, m_change_filament_times_sizer, m_link_edit_nozzle, m_mapping_sugs_sizer, m_plater, m_print_type, m_txt_change_filament_times, VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by on_set_finish_mapping(), and update_show_status().

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

◆ update_material_item_pos()

void Slic3r::GUI::SelectMachineDialog::update_material_item_pos ( MachineObject * obj_)
5745{
5746 if (!obj_) {
5747 return;
5748 }
5749
5750 const bool is_single_head = obj_->GetExtderSystem()->GetTotalExtderCount() < 2;
5751 const bool has_switcher = obj_->GetFilaSwitch()->IsInstalled();
5752 // reset_and_sync_ams_list() fills m_filaments_map only for a multi-nozzle plate
5753 const auto& full_config = wxGetApp().preset_bundle->full_config();
5754 const bool single_nozzle_plate = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size() < 2;
5755 const bool use_single_panel = is_single_head || has_switcher || single_nozzle_plate;
5756
5757 bool to_change_pos = false;
5758 for (const auto& iter : m_materialList) {
5759 const auto& material_id = iter.second->id;
5760 const auto& material_item = iter.second->item;
5761 if (use_single_panel) {
5762 if (!m_sizer_ams_mapping->IsShown(material_item)) {
5763 to_change_pos = true;
5764 }
5765 } else {
5766 if (m_filaments_map[material_id] == 1 && !m_sizer_ams_mapping_left->IsShown(material_item)) {
5767 to_change_pos = true;
5768 } else if (m_filaments_map[material_id] == 2 && !m_sizer_ams_mapping_right->IsShown(material_item)) {
5769 to_change_pos = true;
5770 }
5771 }
5772
5773 if (to_change_pos) break;
5774 }
5775
5776 if (!to_change_pos) {
5777 return;
5778 }
5779
5780 m_sizer_ams_mapping->Clear(false);
5781 m_sizer_ams_mapping_left->Clear(false);
5782 m_sizer_ams_mapping_right->Clear(false);
5783
5784 int sizer_count = 0;
5785 int left_sizer_count = 0;
5786 int right_sizer_count = 0;
5787 for (const auto& iter : m_materialList) {
5788 const auto& material_id = iter.second->id;
5789 const auto& material_item = iter.second->item;
5790 if (use_single_panel) {
5791 if (!m_sizer_ams_mapping->IsShown(material_item)) {
5792 material_item->Reparent(m_filament_panel);
5793 m_sizer_ams_mapping->Add(material_item, 0, wxALL, FromDIP(5));
5794 sizer_count++;
5795 }
5796 } else {
5797 if (m_filaments_map[material_id] == 1) {
5798 material_item->Reparent(m_filament_left_panel);
5799 m_sizer_ams_mapping_left->Add(material_item, 0, wxALL, FromDIP(5));
5800 left_sizer_count++;
5801 } else if(m_filaments_map[material_id] == 2){
5802 material_item->Reparent(m_filament_right_panel);
5803 m_sizer_ams_mapping_right->Add(material_item, 0, wxALL, FromDIP(5));
5804 right_sizer_count++;
5805 }
5806 }
5807 }
5808
5809 if (sizer_count > 0) {
5810 m_sizer_ams_mapping->SetCols(8);
5811 m_sizer_ams_mapping->Layout();
5812 m_filament_panel_sizer->Layout();
5813 }
5814
5815 if (left_sizer_count > 0) {
5816 m_sizer_ams_mapping_left->SetCols(4);
5817 m_sizer_ams_mapping_left->Layout();
5819 m_filament_left_panel->Layout();
5820 }
5821
5822 if (right_sizer_count > 0) {
5823 m_sizer_ams_mapping_right->SetCols(4);
5824 m_sizer_ams_mapping_right->Layout();
5826 m_filament_right_panel->Layout();
5827 }
5828
5829 m_filament_panel->Show(sizer_count > 0);
5830 m_filament_left_panel->Show(left_sizer_count > 0 || right_sizer_count > 0);
5831 m_filament_right_panel->Show(left_sizer_count > 0 || right_sizer_count > 0);
5832 Layout();
5833}

References Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetFilaSwitch(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::DevFilaSwitch::IsInstalled(), m_filament_left_panel, m_filament_panel, m_filament_panel_left_sizer, m_filament_panel_right_sizer, m_filament_panel_sizer, m_filament_right_panel, m_filaments_map, m_materialList, m_sizer_ams_mapping, m_sizer_ams_mapping_left, and m_sizer_ams_mapping_right.

Referenced by reset_and_sync_ams_list().

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

◆ update_option_opts()

void Slic3r::GUI::SelectMachineDialog::update_option_opts ( MachineObject * obj)
private
3102{
3103 if (!obj)
3104 {
3105 for (auto opt : m_checkbox_list) { opt.second->Hide(); }
3107 return;
3108 }
3109
3110 /*timelapse*/
3111 m_checkbox_list["timelapse"]->Show();
3112 if (obj->is_support_internal_timelapse) {
3113 m_timelapse_folder_btn->Show();
3114 if (m_timelapse_storage.empty()) {
3115 m_timelapse_storage = "internal";
3116 }
3118 } else {
3119 m_timelapse_folder_btn->Hide();
3120 m_timelapse_storage.clear();
3121 }
3122
3123 /*bed_leveling*/
3124 if (obj->is_support_bed_leveling == 2) {
3125 m_checkbox_list["bed_leveling"]->Show();
3126 m_checkbox_list["bed_leveling"]->update_options(ops_auto, _L("This checks the flatness of heatbed. Leveling makes extruded height uniform.\n*Automatic mode: Run a "
3127 "leveling check(about 10 seconds). Skip if surface is fine."));
3128 } else if (obj->is_support_bed_leveling == 1) {
3129 m_checkbox_list["bed_leveling"]->Show();
3130 m_checkbox_list["bed_leveling"]->update_options(ops_no_auto, _L("This checks the flatness of heatbed. Leveling makes extruded height uniform."));
3131 } else {
3132 m_checkbox_list["bed_leveling"]->Hide();
3133 }
3134
3135 /*nozzle_offset_cali*/
3136 bool support_cali_nozzle_offset = obj->GetConfig()->SupportCalibrationNozzleOffset();
3137 if (support_cali_nozzle_offset) {
3138 m_checkbox_list["nozzle_offset_cali"]->update_options(ops_auto, _L("Calibrate nozzle offsets to enhance print quality.\n*Automatic mode: Check for calibration before printing. Skip if unnecessary."));
3139 }
3140 m_checkbox_list["nozzle_offset_cali"]->Show(support_cali_nozzle_offset);
3141
3142 /*flow_cali*/
3143 if (obj->is_support_pa_calibration) {
3144 if (obj->GetConfig()->SupportCalibrationPA_FlowAuto() && can_support_pa_auto_cali())
3145 {
3146 m_checkbox_list["flow_cali"]->update_options(ops_auto, _L("This process determines the dynamic flow values to improve overall print quality.\n*Automatic mode: Skip if the filament was calibrated recently."));
3147 } else {
3148 m_checkbox_list["flow_cali"]->update_options(ops_no_auto, _L("This process determines the dynamic flow values to improve overall print quality."));
3149 }
3150 }
3151 m_checkbox_list["flow_cali"]->Show(obj->is_support_pa_calibration);
3152
3154}
bool can_support_pa_auto_cali()
Definition SelectMachine.cpp:5338

References _L, can_support_pa_auto_cali(), Slic3r::MachineObject::GetConfig(), Slic3r::MachineObject::is_support_bed_leveling, Slic3r::MachineObject::is_support_internal_timelapse, Slic3r::MachineObject::is_support_pa_calibration, m_checkbox_list, m_timelapse_folder_btn, m_timelapse_storage, ops_auto, ops_no_auto, Slic3r::DevConfig::SupportCalibrationNozzleOffset(), Slic3r::DevConfig::SupportCalibrationPA_FlowAuto(), update_options_layout(), and update_timelapse_folder_btn_icon().

Referenced by update_select_layout().

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

◆ update_options_layout()

void Slic3r::GUI::SelectMachineDialog::update_options_layout ( )
private
3080{
3081 std::unordered_set<wxWindow*> shown_options;
3082 const wxSizerItemList& children = m_sizer_options->GetChildren();
3083 for (auto item : children) {
3084 if (item && item->IsWindow()) { shown_options.insert(item->GetWindow()); }
3085 }
3086
3087 std::unordered_set<wxWindow *> toshow_options;
3088 for (auto option : m_checkbox_list_order) {
3089 if (option->IsShown()) { toshow_options.insert(option); }
3090 }
3091
3092 /*To show changed, update layout*/
3093 if (shown_options != toshow_options) {
3094 m_sizer_options->Clear();
3095 for (auto option : m_checkbox_list_order) {
3096 if (option->IsShown()) { m_sizer_options->Add(option, 0, wxEXPAND); }
3097 }
3098 }
3099}

References m_checkbox_list_order, and m_sizer_options.

Referenced by on_flow_cali_option_changed(), update_option_opts(), and update_select_layout().

Here is the caller graph for this function:

◆ update_pa_value_option()

void Slic3r::GUI::SelectMachineDialog::update_pa_value_option ( MachineObject * obj)
1742{
1743 auto it = m_checkbox_list.find("pa_value");
1744 if (it == m_checkbox_list.end()) return;
1745 // Orca: the PA-profile-sharing toggle only applies when the printer advertises pa_mode support
1746 // and Flow Dynamics Calibration is set to off (mirrors the device's own gate for the switch).
1747 const bool show_pa = obj && obj->is_support_pa_mode
1748 && m_checkbox_list["flow_cali"]->IsShown()
1749 && m_checkbox_list["flow_cali"]->getValue() == "off";
1750 it->second->Show(show_pa);
1751}

References Slic3r::MachineObject::is_support_pa_mode, and m_checkbox_list.

Referenced by on_flow_cali_option_changed(), and update_select_layout().

Here is the caller graph for this function:

◆ update_page_turn_state()

void Slic3r::GUI::SelectMachineDialog::update_page_turn_state ( bool show)
6365{
6366 m_bitmap_last_plate->Show(show);
6367 m_bitmap_next_plate->Show(show);
6368
6369 if (show) {
6370 if (m_print_plate_idx <= 0) { m_bitmap_last_plate->Disable(); }
6371 else { m_bitmap_last_plate->Enable(); }
6372
6373 if ((m_print_plate_idx + 1) >= m_print_plate_total) { m_bitmap_next_plate->Disable(); }
6374 else { m_bitmap_next_plate->Enable(); }
6375
6376 if (m_print_plate_total == 1) {
6377 m_bitmap_last_plate->Show(false);
6378 m_bitmap_next_plate->Show(false);
6379 }
6380 }
6381}

References m_bitmap_last_plate, m_bitmap_next_plate, m_print_plate_idx, and m_print_plate_total.

Referenced by init_bind(), set_default(), set_default_from_sdcard(), and set_default_normal().

Here is the caller graph for this function:

◆ update_print_error_info()

void Slic3r::GUI::SelectMachineDialog::update_print_error_info ( int code,
std::string msg,
std::string extra )
1988{
1989 m_print_error_code = code;
1990 m_print_error_msg = msg;
1991 m_print_error_extra = extra;
1992}

References m_print_error_code, m_print_error_extra, and m_print_error_msg.

◆ update_print_required_data()

int Slic3r::GUI::SelectMachineDialog::update_print_required_data ( Slic3r::DynamicPrintConfig config,
Slic3r::Model model,
Slic3r::PlateDataPtrs plate_data_list,
std::string file_name,
std::string file_path )
3951{
3953 m_required_data_config = config;
3954 m_required_data_model = model;
3955 //m_required_data_plate_data_list = plate_data_list;
3956 auto* agent = wxGetApp().getAgent();
3957 for (auto i = 0; i < plate_data_list.size(); i++) {
3958 if (!plate_data_list[i]->gcode_file.empty()) {
3959 if (agent)
3960 for (auto& info : plate_data_list[i]->slice_filaments_info)
3961 info.filament_id = agent->to_orca_filament_id(info.filament_id);
3962 m_required_data_plate_data_list.push_back(plate_data_list[i]);
3963 }
3964 }
3965
3966 m_required_data_file_name = file_name;
3967 m_required_data_file_path = file_path;
3968 return m_required_data_plate_data_list.size();
3969}
Slic3r::Model m_required_data_model
Definition SelectMachine.hpp:353

References m_required_data_config, m_required_data_file_name, m_required_data_file_path, m_required_data_model, and m_required_data_plate_data_list.

◆ update_print_status_msg()

void Slic3r::GUI::SelectMachineDialog::update_print_status_msg ( )
1977{
1978 bool is_ams_update = m_statictext_ams_msg->UpdateInfos(m_pre_print_checker.filamentList);
1979 bool is_printer_update = m_text_printer_msg->UpdateInfos(m_pre_print_checker.printerList);
1980 if (is_printer_update || is_ams_update) {
1981 Layout();
1982 Fit();
1983 }
1984
1985 }

References m_pre_print_checker, m_statictext_ams_msg, and m_text_printer_msg.

Referenced by on_selection_changed(), and on_timer().

Here is the caller graph for this function:

◆ update_printer_combobox()

void Slic3r::GUI::SelectMachineDialog::update_printer_combobox ( wxCommandEvent & event)
4183{
4186}
void update_user_printer()
Definition SelectMachine.cpp:4064

References Slic3r::GUI::PrintStatusInit, show_status(), and update_user_printer().

Referenced by init_bind().

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

◆ update_scroll_area_size()

void Slic3r::GUI::SelectMachineDialog::update_scroll_area_size ( )
private
3060 {
3061
3062 wxSize new_size(FromDIP(700), -1);
3063
3064 int height = m_scroll_area->GetSizer()->CalcMin().GetHeight();
3065 if (height < FromDIP(650)) {
3066 new_size.SetHeight(height);
3067 } else {
3068 new_size.SetHeight(FromDIP(650));
3069 }
3070
3071 if (m_scroll_area->GetSize() != new_size) {
3072 m_scroll_area->SetMaxSize(new_size);
3073 m_scroll_area->SetMinSize(new_size);
3074 Layout();
3075 Fit();
3076 }
3077}
coord_t height(const BoundingBox &box)
Definition Arrange.cpp:1185

References m_scroll_area.

◆ update_select_layout()

void Slic3r::GUI::SelectMachineDialog::update_select_layout ( MachineObject * obj)
1035{
1036 update_option_opts(obj);
1037
1038 load_option_vals(obj);
1039 if (obj && obj->get_printer_arch() == PrinterArch::ARCH_I3) { m_checkbox_list["timelapse"]->setValue("off"); } /*off timelapse on selected for n series by zhimin.zeng*/
1040 save_option_vals(obj);
1041
1042 // Orca: pa_value visibility depends on the freshly-loaded flow_cali value, so recompute it
1043 // after load_option_vals and re-run the grid layout.
1046
1047 Layout();
1048 Fit();
1049}
@ ARCH_I3
Definition DevDefs.h:30
void update_option_opts(MachineObject *obj)
Definition SelectMachine.cpp:3101

References ARCH_I3, Slic3r::MachineObject::get_printer_arch(), load_option_vals(), m_checkbox_list, save_option_vals(), update_option_opts(), update_options_layout(), and update_pa_value_option().

Referenced by update_show_status(), and update_user_printer().

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

◆ update_show_status()

void Slic3r::GUI::SelectMachineDialog::update_show_status ( MachineObject * obj_ = nullptr)

error check

warning check

warning check

normal check

4749{
4750 m_pre_print_checker.clear();
4751 // Orca: re-raised by CheckErrorExtruderNozzleWithSlicing() below if the mismatch is still there,
4752 // so an early return from this pass cannot leave a stale warning behind.
4754
4755 /*agent check and printer valid check*/
4756 NetworkAgent* agent = Slic3r::GUI::wxGetApp().getAgent();
4757 if (!agent) {
4759 update_ams_check(nullptr);
4760 return;
4761 }
4762
4763 if (!obj_) {
4765 update_ams_check(nullptr);
4766 return;
4767 }
4768
4769 /*combobox check*/
4771 m_printer_box->GetPrinterComboBox()->Disable();
4772 } else {
4774 m_printer_box->GetPrinterComboBox()->Disable();
4775 else
4776 m_printer_box->GetPrinterComboBox()->Enable();
4777 }
4778
4779 /*mode check*/
4781
4782 /*no valid gcode file*/
4784 PartPlate* plate = m_plater->get_partplate_list().get_curr_plate();
4785 if (plate && !plate->is_valid_gcode_file()) {
4787 return;
4788 }
4789 }
4790
4792 /* check cloud machine connections */
4793 if (!obj_->is_lan_mode_printer() && !agent->is_server_connected(wxGetApp().get_printer_cloud_provider())) {
4795 reset_timeout();
4796 return;
4797 }
4798
4799 if (!obj_->is_info_ready()) {
4800 if (is_timeout()) {
4801 m_ams_mapping_result.clear();
4804 } else {
4807 }
4808 return;
4809 }
4810
4811 reset_timeout();
4812
4813 /*check print all*/
4814 if (!obj_->GetConfig()->SupportPrintAllPlates() && m_print_plate_idx == PLATE_ALL_IDX)
4815 {
4817 return;
4818 }
4819
4820 if (!m_check_flag && obj_->is_info_ready()) {
4822 update_ams_check(obj_);
4823 m_check_flag = true;
4824 }
4825
4826 /*do ams mapping if no ams result*/
4827 if (m_ams_mapping_result.empty()) {
4828 do_ams_mapping(obj_, true);
4830 }
4831
4832 /* multi color external change assist*/
4833 // A/P-series expose this via flag3 bit-16 (is_support_ext_change_assist_old)
4834 bool is_support_mutile_color = obj_->is_support_ext_change_assist_old || obj_->is_support_ext_change_assist;
4835 if (is_support_mutile_color && !m_check_ext_change_assist->IsShown()) {
4836 m_check_ext_change_assist->Show(true);
4837 m_label_ext_change_assist->Show(true);
4838 } else if (!is_support_mutile_color && m_check_ext_change_assist->IsShown()) {
4841 }
4842 /*check external change assist*/
4844 m_check_ext_change_assist->Enable(true);
4845 }else{
4846 m_check_ext_change_assist->SetValue(false);
4847 m_check_ext_change_assist->Enable(false);
4848 }
4849
4850 {
4851 const bool show_warn_when_drying = is_selected_ams_drying(obj_);
4852 const bool is_currently_shown = (m_txt_warn_when_drying != nullptr) ? m_txt_warn_when_drying->IsShown() : false;
4853 if (is_currently_shown != show_warn_when_drying) {
4854 m_warn_when_drying_sizer->Show(show_warn_when_drying);
4855 Layout();
4856 Fit();
4857 }
4858 }
4859
4860 /*reading done*/
4861 if (wxGetApp().app_config) {
4862 if (obj_->upgrade_force_upgrade) {
4864 return;
4865 }
4866
4867 if (obj_->upgrade_consistency_request) {
4869 return;
4870 }
4871 }
4872
4873 if (!obj_->is_fdm_type()) {
4875 return;
4876 }
4877
4878 bool has_optional_printer_model = DevPrinterConfigUtil::is_optional_printer_model_id(obj_->printer_type);
4880 PresetBundle* preset_bundle = wxGetApp().preset_bundle;
4881 has_optional_printer_model = has_optional_printer_model ||
4883 preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle)));
4885 has_optional_printer_model = has_optional_printer_model ||
4888 }
4889
4890 if (has_optional_printer_model) {
4892 }
4893
4894 if (is_blocking_printing(obj_)) {
4896 return;
4897 } else if (obj_->is_in_upgrading()) {
4899 return;
4900 } else if (obj_->is_system_printing()) {
4902 return;
4903 } else if (obj_->is_in_printing() || obj_->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
4905 return;
4906 } else if (!obj_->GetConfig()->SupportPrintWithoutSD() && (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD)) {
4908 return;
4909 }
4910 // Gate against the printer's real max filament-color count, floored at 16 so printers that
4911 // report 0 (e.g. series X/O) keep that limit. The max is passed as a param so the %s message
4912 // shows the actual count.
4913 int max_color = obj_->get_max_filament_color_count();
4914 if (max_color < 16) max_color = 16;
4915 if (wxGetApp().preset_bundle->filament_presets.size() > (size_t)max_color && m_print_type != PrintFromType::FROM_SDCARD_VIEW) {
4916 if (!obj_->is_enable_ams_np && !obj_->is_enable_np)
4917 {
4918 show_status(PrintDialogStatus::PrintStatusColorQuantityExceed, {wxString::Format("%d", max_color)});
4919 return;
4920 }
4921 }
4922
4923 /*check sdcard when if lan mode printer*/
4924 if (obj_->is_lan_mode_printer()) {
4925 if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD
4926 && !obj_->can_use_emmc_print()) {
4928 return;
4929 } else if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_READONLY) {
4931 return;
4932 } else if(obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_ABNORMAL && (wxGetApp().app_config->get("allow_abnormal_storage") == "false")){
4934 return;
4935 }
4936 }
4937
4938 // TPU/Aero flow-cali gate on printers that don't support PA auto-cali: "auto" blocks; "on" is a
4939 // non-blocking advisory (the printer falls back to the previous cali value and skips flow
4940 // calibration), so Send stays enabled and there is no return.
4941 if (!can_support_pa_auto_cali() && m_checkbox_list["flow_cali"]->IsShown()) {
4942 if (m_checkbox_list["flow_cali"]->getValue() == "auto") {
4944 return;
4945 }
4946 if (m_checkbox_list["flow_cali"]->getValue() == "on") {
4948 }
4949 }
4950
4951 /*disable print when there is no mapping*/
4952 if (obj_->GetExtderSystem()->GetTotalExtderCount() > 1) {
4953 for (auto mres : m_ams_mapping_result) {
4954 if (mres.ams_id.empty() && mres.slot_id.empty()) {
4956 return;
4957 }
4958 }
4959 }
4960
4961 const auto &full_config = wxGetApp().preset_bundle->full_config();
4962 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
4963
4964 // Filament Track Switch: warn on a slicing/hardware mismatch, and block Send when dynamic
4965 // nozzle mapping needs a switch that isn't installed or set up. No-op for printers without one.
4966 if (!CheckErrorDynamicSwitchNozzle(obj_)) return;
4967
4968 // Block Send while a rack printer is still reading its hotend information.
4969 if (!CheckErrorRackStatus(obj_)) return;
4970
4971 // Compare the slicing file's nozzle requirements (validity, flow, diameter) against the printer.
4972 if (!CheckErrorExtruderNozzleWithSlicing(obj_)) return;
4973
4975 {
4976 // Orca: blocking hardness gate on the mounted nozzles; the rack extruder is instead judged
4977 // per dispatch-mapped nozzle in the blacklist loop below, as a non-blocking caution.
4978 const auto &used_nozzle_idxes = _get_used_nozzle_idxes();
4979 for (const auto &extder : obj_->GetExtderSystem()->GetExtruders()) {
4980 if (used_nozzle_idxes.count(extder.GetNozzleId()) == 0) { continue; }
4981 if (_is_rack_managed_nozzle(obj_, extder.GetNozzleId())) { continue; }
4982
4983 std::string filament_type;
4984 if (!is_nozzle_hrc_matched(&extder, filament_type)) {
4985 std::vector<wxString> error_msg;
4986 error_msg.emplace_back(wxString::Format(_L("The hardness of current material (%s) exceeds the hardness of %s(%s). Please verify the nozzle or material settings and try again."),
4987 filament_type, _get_nozzle_name(obj_->GetExtderSystem()->GetTotalExtderCount(), extder.GetNozzleId()), format_steel_name(extder.GetNozzleType())));
4989 return;
4990 }
4991 }
4992 }
4993
4994 // Rack print-dispatch nozzle mapping (dynamic V1): request/await the printer's mapping and block
4995 // Send while it computes. No-op for non-rack printers.
4996 if (!CheckErrorSyncNozzleMappingResultV1(obj_)) return;
4997
4998 if (!DevPrinterConfigUtil::support_ams_ext_mix_print(obj_->printer_type)) {
4999 bool useAms = _HasAms(m_ams_mapping_result);
5000 bool useExt = _HasExt(m_ams_mapping_result);
5001 if (useAms && useExt) {
5003 return;
5004 }
5005 }
5006
5007 if (obj_->GetFilaSystem()->IsAmsSettingUp()) {
5009 return;
5010 }
5011
5014 return;
5015 }
5016
5017 // Rack print-dispatch nozzle mapping (static rack V0): consumes the validated AMS mapping, so it
5018 // runs after the AMS-validity check and before the per-nozzle blacklist loop (which needs the result).
5019 if (!CheckErrorSyncNozzleMappingResultV0(obj_)) return;
5020
5021 // H2-series firmware gate: block Send when TPU is mapped to the left (deputy) extruder on firmware
5022 // that can't print it. Inert unless the printer JSON opts in via support_print_check_firmware_for_tpu_left.
5023 // Fail-closed on purpose: a mapping entry missing from the tray list blocks as
5024 // AmsMappingInvalid, and value_or(false) blocks TPU-left until the first fun2 push arrives;
5025 // both self-clear on the next status refresh.
5027 // Read the raw string members fila.ams_id/fila.slot_id — an int round-trip would throw on
5028 // an unmapped filament. Orca: the jump-to-upgrade button styling is not ported.
5029 bool has_tpu_left = false;
5030 for (const auto& fila : m_ams_mapping_result) {
5031 const auto& ams_id = fila.ams_id;
5032 const auto& slot_id = fila.slot_id;
5033 if (!obj_->contains_tray(ams_id, slot_id)) {
5035 return;
5036 }
5037
5038 if (obj_->get_extruder_id_by_ams_id(ams_id) == DEPUTY_EXTRUDER_ID &&
5039 obj_->get_tray(ams_id, slot_id).get_filament_type() == "TPU") {
5040 has_tpu_left = true;
5041 break;
5042 }
5043 }
5044
5045 if (has_tpu_left && !obj_->m_firmware_support_print_tpu_left.value_or(false)) {
5047 {_L("Your current firmware version cannot start this print job. Please update to the latest version and try again.")});
5048 return;
5049 }
5050 }
5051
5052 // filaments check for black list
5053 for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
5054 const auto &ams_id = m_ams_mapping_result[i].get_ams_id();
5055 const auto &slot_id = m_ams_mapping_result[i].get_slot_id();
5056
5057 auto tid = m_ams_mapping_result[i].tray_id;
5058
5059 std::string filament_type = boost::to_upper_copy(m_ams_mapping_result[i].type);
5060 std::string filament_brand;
5061
5062 for (auto& fs : m_filaments) {
5063 if (fs.id == m_ams_mapping_result[i].id) { filament_brand = m_filaments[i].brand; }
5064 }
5065
5066 DevFilaBlacklist::CheckFilamentInfo check_info;
5067 check_info.dev_id = obj_->get_dev_id();
5068 check_info.model_id = obj_->printer_type;
5069 check_info.fila_id = m_ams_mapping_result[i].filament_id;
5070 check_info.fila_type = filament_type;
5071 check_info.fila_vendor = filament_brand;
5072 // Populate fila_name so the high-flow warning strings (blacklist rules 14/15/18/19,
5073 // "%s has a risk of nozzle clogging ...") render with the filament name instead of a
5074 // leading blank. Resolves the same preset the engine's internal AMS-name recovery uses, so
5075 // blacklist name-matching is unchanged.
5076 if (auto option = wxGetApp().preset_bundle->get_filament_by_filament_id(check_info.fila_id))
5077 check_info.fila_name = option->filament_name;
5078 check_info.ams_id = ams_id;
5079 check_info.slot_id = slot_id;
5080 check_info.has_filament_switch = obj_->GetFilaSwitch()->IsInstalled();
5081
5082 std::vector<DevNozzle> mapped_nozzles;
5083 for (const auto &[pos_id, nozzle] : get_mapped_nozzles(m_ams_mapping_result[i].id)) {
5084 if (!nozzle.IsEmpty()) { mapped_nozzles.push_back(nozzle); }
5085 }
5086
5087 // Per-physical-nozzle blacklist check — thread the nozzle the filament prints on so the
5088 // high-flow prohibition/warning rules evaluate against the real nozzle flow/diameter.
5089 // With no resolvable nozzle context (a non-rack printer, or a rack filament not yet mapped
5090 // by the print-dispatch mapping), evaluate once with the nozzle fields unset so the
5091 // non-nozzle prohibitions/warnings still fire as before.
5092 const size_t iterations = mapped_nozzles.empty() ? 1 : mapped_nozzles.size();
5093 for (size_t n = 0; n < iterations; ++n) {
5094 if (n < mapped_nozzles.size()) {
5095 const DevNozzle &nozzle = mapped_nozzles[n];
5096 check_info.extruder_id = nozzle.GetExtruderId();
5097 check_info.nozzle_flow = DevNozzle::GetNozzleFlowTypeString(nozzle.GetNozzleFlowType());
5098 check_info.nozzle_diameter = nozzle.GetNozzleDiameter();
5099 }
5100
5101 const auto &result = DevFilaBlacklist::check_filaments_in_blacklist(check_info);
5102 if (const auto &prohibition_items = result.get_items_by_action("prohibition"); !prohibition_items.empty()) {
5103 for (const auto &item : prohibition_items) {
5105 }
5106 return;
5107 }
5108
5109 if (const auto &warning_items = result.get_items_by_action("warning"); !warning_items.empty()) {
5110 for (const auto &item : warning_items) {
5112 }
5113 }
5114
5115 // A rack-managed nozzle skipped the mounted-nozzle hardness gate above; judge the
5116 // filament's hardness against the nozzle the print-dispatch mapping assigned. Caution
5117 // only: the printer picks the swap target, so Send stays enabled.
5118 if (n < mapped_nozzles.size()) {
5119 const DevNozzle &nozzle = mapped_nozzles[n];
5120 if (_is_rack_managed_nozzle(obj_, nozzle.GetExtruderId()) && nozzle.GetNozzleType() != NozzleType::ntUndefine) {
5121 const int nozzle_hrc = Print::get_hrc_by_nozzle_type(nozzle.GetNozzleType());
5122 const int filament_hrc = wxGetApp().preset_bundle->get_required_hrc_by_filament_type(filament_type);
5123 if (abs(filament_hrc) > abs(nozzle_hrc)) {
5124 const int pos_id = nozzle.GetNozzlePosId();
5125 const wxString nozzle_str = (pos_id < 0x10) ? wxString("R") : wxString::Format("R%d", pos_id - 0x10 + 1);
5127 {wxString::Format(_L("The hardness of current material (%s) exceeds the hardness of %s(%s). It may cause nozzle wear, "
5128 "leading to material leakage and unstable flow. Please exercise caution when using it."),
5129 filament_type, nozzle_str, format_steel_name(nozzle.GetNozzleType()))});
5130 }
5131 }
5132 }
5133 }
5134 }
5135
5137 struct ExtruderStatus
5138 {
5139 bool has_ams{false};
5140 bool has_vt_slot{false};
5141 };
5142 std::vector<ExtruderStatus> extruder_status(nozzle_nums);
5143 for (const FilamentInfo &item : m_ams_mapping_result) {
5144 if (item.ams_id.empty()) continue;
5145
5146 int extruder_id = obj_->get_extruder_id_by_ams_id(item.ams_id);
5147 if (devPrinterUtil::IsVirtualSlot(item.ams_id))
5148 extruder_status[extruder_id].has_vt_slot = true;
5149 else
5150 extruder_status[extruder_id].has_ams = true;
5151 }
5152 for (auto extruder : extruder_status) {
5153 if (extruder.has_ams && extruder.has_vt_slot) {
5155 // return;
5156 }
5157 }
5159 wxString warning_msg = _L("Some filaments may switch between extruders during printing. Manual K-value calibration cannot be applied throughout the entire print, which "
5160 "may affect print quality. Enabling Flow Dynamics Calibration is recommended.");
5162 }
5163
5164 // Suggest switching nozzle clumping detection to Auto when the file has stringing-prone
5165 // filament. The message is passed as a literal (no get_pre_state_msg entry) so the tail add()
5166 // doesn't also push a second, linkless copy.
5169 m_pre_print_checker.add_with_link(
5171 _L("There is stringing-prone filament in this file. For best print quality, we recommend switching nozzle clumping detection to Auto mode."),
5172 _L("Switch"),
5173 [] {
5174 DeviceManager* dev = wxGetApp().getDeviceManager();
5175 MachineObject* o = dev ? dev->get_selected_machine() : nullptr;
5176 if (o && o->GetPrintOptions())
5177 o->GetPrintOptions()->command_smart_nozzle_blob_detect_mode(2);
5178 });
5179 }
5180
5181 // Non-blocking: when Flow Dynamics Calibration is Auto/On and a mapped filament is in the
5182 // printer's auto_on_cali_warning_tpu_filaments list, warn that the system will use the
5183 // manual/default value and skip flow calibration. Send stays enabled.
5184 if (obj_ && m_checkbox_list.count("flow_cali") && m_checkbox_list["flow_cali"]->IsShown()
5185 && m_checkbox_list["flow_cali"]->getValue() != "off") {
5186 const auto& warning_tpu_filaments =
5187 DevPrinterConfigUtil::get_value_from_config<std::vector<std::string>>(obj_->printer_type, "auto_on_cali_warning_tpu_filaments");
5188 if (!warning_tpu_filaments.empty()) {
5189 auto* agent = wxGetApp().getAgent();
5190 for (const auto& fila : m_ams_mapping_result) {
5191 // fila.filament_id is our OF id; the printer config list holds the printer's own.
5192 const std::string printer_filament_id = agent ? agent->from_orca_filament_id(fila.filament_id) : fila.filament_id;
5193 if (std::find(warning_tpu_filaments.begin(), warning_tpu_filaments.end(), printer_filament_id) != warning_tpu_filaments.end()) {
5195 { _L("If 'Dynamic Flow Calibration' is set to Auto/On, the system will use the manual calibration value or the default value and skip the flow calibration process. You can perform a manual flow calibration for TPU filament on the 'Calibration' page.") });
5196 break;
5197 }
5198 }
5199 }
5200 }
5201
5202 if (m_ams_mapping_res) {
5203 if (has_timelapse_warning()) {
5205 // return;
5206 }
5207 } else {
5209 if (!check_sdcard_for_timelpase(obj_)) {
5210 if (has_timelapse_warning()) {
5212 // return;
5213 }
5214 }
5215 }
5216 }
5218
5219 // Orca: show warning if external filament does not match
5220 for (auto& m : m_ams_mapping_result) {
5221 if (devPrinterUtil::IsVirtualSlot(m.ams_id)) {
5222 for (auto& fs : m_filaments) {
5223 if (fs.id == m.id && m.type != fs.type) {
5225 goto ext_mismatch;
5226 }
5227 }
5228 }
5229 }
5230 ext_mismatch:
5231
5232 /*STUDIO-10970 check the k value and flow cali option*/
5233 if (m_checkbox_list["flow_cali"]->IsShown() && m_checkbox_list["flow_cali"]->getValue() == "auto") {
5234 const auto &not_default_ams_names = _check_kval_not_default(obj_, m_ams_mapping_result);
5235 if (!not_default_ams_names.empty()) {
5236 std::vector<wxString> params{not_default_ams_names};
5238 // return;
5239 }
5240 }
5241
5242 /*Check high temperture slicing*/
5244 std::set<std::string> high_temp_filaments;
5245 std::unordered_set<int> known_fila_soften_extruders;
5246 std::unordered_set<int> unknown_fila_soften_extruders;
5247 auto preset_full_config = wxGetApp().preset_bundle->full_config();
5248 auto chamber_temperatures = preset_full_config.option<ConfigOptionInts>("chamber_temperature");
5249 for (const FilamentInfo& item : m_ams_mapping_result) {
5250 try
5251 {
5252 int chamber_temp = chamber_temperatures->values[item.id];
5253 if (chamber_temp >= 40) {
5254 high_temp_filaments.insert(item.get_display_filament_type());// high printing chamber temperature
5255 }
5256
5257 for (const auto& extder : obj_->GetExtderSystem()->GetExtruders()) { // check vitrification
5258 if (extder.HasFilamentInExt()) {
5259 const auto& fila_id = obj_->get_filament_id(extder.GetSlotNow().ams_id, extder.GetSlotNow().slot_id);
5260 auto filament_info = wxGetApp().preset_bundle->get_filament_by_filament_id(fila_id);
5261 if (filament_info) {
5262 if (filament_info->temperature_vitrification - chamber_temp <= 5) {
5263 known_fila_soften_extruders.insert(extder.GetExtId());
5264 }
5265 } else {
5266 // the minimum temperature_vitrification of the known filaments is 43 degrees
5267 if (43 - chamber_temp <= 5) { unknown_fila_soften_extruders.insert(extder.GetExtId()); }
5268 }
5269 }
5270 }
5271 }
5272 catch (std::exception&) { assert(0); }
5273 }
5274
5275 if (!high_temp_filaments.empty()) {
5276 wxString filament_strs;/*join the filament strs*/
5277 for (auto filament : high_temp_filaments) {
5278 filament_strs += filament;
5279 if (filament != *high_temp_filaments.rbegin()) {
5280 filament_strs += ", ";
5281 }
5282 }
5283
5284 if (obj_->GetConfig()->HasChamber()) {
5285 const auto& msg = wxString::Format(_L("[ %s ] requires printing in a high-temperature environment. Please close the door."), filament_strs);
5288 } else {
5289 const auto& msg = wxString::Format(_L("[ %s ] requires printing in a high-temperature environment."), filament_strs);
5292 }
5293 }
5294
5295 if (!known_fila_soften_extruders.empty()) {
5296 const wxString& msg = wxString::Format(_L("The filament on %s may soften. Please unload."),
5297 _get_ext_loc_str(known_fila_soften_extruders, obj_->GetExtderSystem()->GetTotalExtderCount()));
5300 }
5301
5302 if (!unknown_fila_soften_extruders.empty()) {
5303 const wxString& msg = wxString::Format(_L("The filament on %s is unknown and may soften. Please set filament."),
5304 _get_ext_loc_str(unknown_fila_soften_extruders, obj_->GetExtderSystem()->GetTotalExtderCount()));
5307 }
5308 }
5309
5310 // check extension tool warning
5312
5313 // check rack nozzle warning
5315
5318}
static bool support_ams_ext_mix_print(std::string type_str)
Definition DevConfigUtil.h:114
static bool support_print_check_firmware_for_tpu_left(std::string type_str)
Definition DevConfigUtil.h:111
static T get_value_from_config(const std::string &type_str, const std::string &item)
Definition DevConfigUtil.h:136
@ HAS_SDCARD_READONLY
Definition DevStorage.h:21
static bool is_error(PrintDialogStatus status)
Definition PrePrintChecker.hpp:180
void reset_timeout()
Definition SelectMachine.cpp:3971
bool CheckWarningSmartNozzleBlobAuto(MachineObject *obj_)
Definition SelectMachine.cpp:2028
bool CheckErrorDynamicSwitchNozzle(MachineObject *obj_)
Definition SelectMachine.cpp:1702
bool is_blocking_printing(MachineObject *obj_)
Definition SelectMachine.cpp:2611
void update_select_layout(MachineObject *obj)
Definition SelectMachine.cpp:1034
PrintDialogStatus get_status()
Definition SelectMachine.hpp:618
bool check_sdcard_for_timelpase(MachineObject *obj)
Definition SelectMachine.cpp:1994
bool is_selected_ams_drying(MachineObject *obj)
Definition SelectMachine.cpp:1942
bool CheckWarningFilamentCrossExtruder(MachineObject *obj_)
Definition SelectMachine.cpp:2010
wxString format_steel_name(NozzleType type)
Definition SelectMachine.cpp:3005
void update_ams_check(MachineObject *obj)
Definition SelectMachine.cpp:4303
bool CheckErrorSyncNozzleMappingResultV1(MachineObject *obj_)
Definition SelectMachine.cpp:1789
bool is_enable_external_change_assist(std::vector< FilamentInfo > &ams_mapping_result)
Definition SelectMachine.cpp:3180
bool do_ams_mapping(MachineObject *obj_, bool use_ams)
Definition SelectMachine.cpp:1204
bool is_timeout()
Definition SelectMachine.cpp:3942
bool CheckErrorSyncNozzleMappingResultV0(MachineObject *obj_)
Definition SelectMachine.cpp:1856
bool CheckErrorExtruderNozzleWithSlicing(MachineObject *obj_)
Definition SelectMachine.cpp:4598
bool CheckErrorRackStatus(MachineObject *obj_)
Definition SelectMachine.cpp:4502
bool is_nozzle_hrc_matched(const DevExtder *extruder, std::string &filament_type) const
Definition SelectMachine.cpp:2658
void CheckWarningRackStatus(MachineObject *obj_)
Definition SelectMachine.cpp:4522
void UpdateStatusCheckWarning_ExtensionTool(MachineObject *obj_)
Definition SelectMachine.cpp:6454
static bool IsVirtualSlot(int ams_id)
Definition DevDefs.h:165
static bool _is_rack_managed_nozzle(const MachineObject *obj, int nozzle_idx)
Definition SelectMachine.cpp:2649
static wxString _get_ext_loc_str(const std::unordered_set< int > &extruders, int total_ext_num)
Definition SelectMachine.cpp:4718
static wxString _check_kval_not_default(const MachineObject *obj, const std::vector< FilamentInfo > &mapping_result)
Definition SelectMachine.cpp:4372
static std::unordered_set< int > _get_used_nozzle_idxes()
Definition SelectMachine.cpp:2622
@ AMS_STATUS_MAIN_FILAMENT_CHANGE
Definition DevDefs.h:47

References Slic3r::GUI::_check_kval_not_default(), Slic3r::GUI::_get_ext_loc_str(), Slic3r::GUI::_get_nozzle_name(), Slic3r::GUI::_get_used_nozzle_idxes(), Slic3r::GUI::_HasAms(), Slic3r::GUI::_HasExt(), Slic3r::GUI::_is_rack_managed_nozzle(), _L, Slic3r::DevFilaBlacklist::CheckFilamentInfo::ams_id, Slic3r::MachineObject::ams_status_main, Slic3r::AMS_STATUS_MAIN_FILAMENT_CHANGE, can_support_pa_auto_cali(), Slic3r::MachineObject::can_use_emmc_print(), Slic3r::DevFilaBlacklist::check_filaments_in_blacklist(), check_sdcard_for_timelpase(), check_timelapse_storage_warning(), CheckErrorDynamicSwitchNozzle(), CheckErrorExtruderNozzleWithSlicing(), CheckErrorRackStatus(), CheckErrorSyncNozzleMappingResultV0(), CheckErrorSyncNozzleMappingResultV1(), CheckWarningFilamentCrossExtruder(), CheckWarningRackStatus(), CheckWarningSmartNozzleBlobAuto(), Slic3r::DevPrintOptions::command_smart_nozzle_blob_detect_mode(), Slic3r::MachineObject::contains_tray(), DEPUTY_EXTRUDER_ID, Slic3r::DevFilaBlacklist::CheckFilamentInfo::dev_id, do_ams_mapping(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::extruder_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_id, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_name, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_type, Slic3r::DevFilaBlacklist::CheckFilamentInfo::fila_vendor, Slic3r::filament_type(), format_steel_name(), Slic3r::GUI::FROM_NORMAL, Slic3r::NetworkAgent::from_orca_filament_id(), Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::MachineObject::get_dev_id(), Slic3r::PresetCollection::get_edited_preset(), Slic3r::MachineObject::get_extruder_id_by_ams_id(), Slic3r::MachineObject::get_filament_id(), Slic3r::DevAmsTray::get_filament_type(), Slic3r::Print::get_hrc_by_nozzle_type(), get_mapped_nozzles(), Slic3r::MachineObject::get_max_filament_color_count(), Slic3r::Preset::get_printer_type(), Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), get_status(), Slic3r::MachineObject::get_tray(), Slic3r::DevPrinterConfigUtil::get_value_from_config(), Slic3r::MachineObject::GetConfig(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevNozzle::GetExtruderId(), Slic3r::DevExtderSystem::GetExtruders(), Slic3r::MachineObject::GetFilaSwitch(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevNozzle::GetNozzleDiameter(), Slic3r::DevNozzle::GetNozzleFlowType(), Slic3r::DevNozzle::GetNozzleFlowTypeString(), Slic3r::DevNozzle::GetNozzlePosId(), Slic3r::DevNozzle::GetNozzleType(), Slic3r::MachineObject::GetPrintOptions(), Slic3r::MachineObject::GetStorage(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::has_filament_switch, Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, has_timelapse_warning(), Slic3r::DevConfig::HasChamber(), is_blocking_printing(), Slic3r::MachineObject::is_enable_ams_np, is_enable_external_change_assist(), Slic3r::MachineObject::is_enable_np, Slic3r::GUI::PrePrintChecker::is_error(), Slic3r::MachineObject::is_fdm_type(), Slic3r::MachineObject::is_in_printing(), Slic3r::MachineObject::is_in_upgrading(), Slic3r::MachineObject::is_info_ready(), Slic3r::MachineObject::is_lan_mode_printer(), is_nozzle_hrc_matched(), Slic3r::DevPrinterConfigUtil::is_optional_printer_model_id(), is_selected_ams_drying(), Slic3r::NetworkAgent::is_server_connected(), Slic3r::MachineObject::is_support_ext_change_assist, Slic3r::MachineObject::is_support_ext_change_assist_old, Slic3r::MachineObject::is_system_printing(), is_timeout(), Slic3r::GUI::PartPlate::is_valid_gcode_file(), Slic3r::DevMappingUtil::is_valid_mapping_result(), Slic3r::DevFilaSwitch::IsInstalled(), Slic3r::devPrinterUtil::IsVirtualSlot(), m_ams_mapping_res, m_ams_mapping_result, m_check_ext_change_assist, m_check_flag, m_checkbox_list, m_filaments, Slic3r::MachineObject::m_firmware_support_print_tpu_left, m_label_ext_change_assist, m_nozzle_diameter_mismatch_msg, m_plater, m_pre_print_checker, m_print_plate_idx, m_print_type, m_printer_box, m_required_data_plate_data_list, m_timeout_count, m_txt_warn_when_drying, m_warn_when_drying_sizer, Slic3r::DevFilaBlacklist::CheckFilamentInfo::model_id, Slic3r::DevStorage::NO_SDCARD, Slic3r::DevFilaBlacklist::CheckFilamentInfo::nozzle_diameter, Slic3r::DevFilaBlacklist::CheckFilamentInfo::nozzle_flow, Slic3r::ntUndefine, PLATE_ALL_IDX, Slic3r::MachineObject::printer_type, Slic3r::PresetBundle::printers, Slic3r::GUI::PrintStatusAmsMappingInvalid, Slic3r::GUI::PrintStatusAmsMappingMixInvalid, Slic3r::GUI::PrintStatusAmsOnSettingup, Slic3r::GUI::PrintStatusBlankPlate, Slic3r::GUI::PrintStatusColorQuantityExceed, Slic3r::GUI::PrintStatusConnectingServer, Slic3r::GUI::PrintStatusFilamentCrossExtruderWarning, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTemp, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTempCloseDoor, Slic3r::GUI::PrintStatusFilamentWarningHighChamberTempSoft, Slic3r::GUI::PrintStatusFilamentWarningNozzleHRC, Slic3r::GUI::PrintStatusFilamentWarningUnknownHighChamberTempSoft, Slic3r::GUI::PrintStatusFirmwareNotSupportTpuAtLeft, Slic3r::GUI::PrintStatusHasFilamentInBlackListError, Slic3r::GUI::PrintStatusHasFilamentInBlackListWarning, Slic3r::GUI::PrintStatusInPrinting, Slic3r::GUI::PrintStatusInSystemPrinting, Slic3r::GUI::PrintStatusInUpgrading, Slic3r::GUI::PrintStatusInvalidPrinter, Slic3r::GUI::PrintStatusLanModeNoSdcard, Slic3r::GUI::PrintStatusLanModeSDcardNotAvailable, Slic3r::GUI::PrintStatusMixAmsAndVtSlotWarning, Slic3r::GUI::PrintStatusModeNotFDM, Slic3r::GUI::PrintStatusNeedConsistencyUpgrading, Slic3r::GUI::PrintStatusNeedForceUpgrading, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotSupportedPrintAll, Slic3r::GUI::PrintStatusNoUserLogin, Slic3r::GUI::PrintStatusNozzleTypeMismatch, Slic3r::GUI::PrintStatusOptionalPrinterModel, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusReadyToGo, Slic3r::GUI::PrintStatusRefreshingMachineList, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::PrintStatusSmartNozzleBlobNeedAuto, Slic3r::GUI::PrintStatusTimelapseWarning, Slic3r::GUI::PrintStatusTPUUnsuggestCali, Slic3r::GUI::PrintStatusTPUUnsupportAutoCali, Slic3r::GUI::PrintStatusTPUUnsupportCaliOn, Slic3r::GUI::PrintStatusUnsupportedPrinter, Slic3r::GUI::PrintStatusWarningExtFilamentNotMatch, Slic3r::GUI::PrintStatusWarningKvalueNotUsed, reset_timeout(), show_status(), Slic3r::DevFilaBlacklist::CheckFilamentInfo::slot_id, Slic3r::DevPrinterConfigUtil::support_ams_ext_mix_print(), Slic3r::DevPrinterConfigUtil::support_print_check_firmware_for_tpu_left(), Slic3r::DevConfig::SupportPrintAllPlates(), Slic3r::DevConfig::SupportPrintWithoutSD(), sync_ams_mapping_result(), update_ams_check(), update_filament_change_count(), update_select_layout(), UpdateStatusCheckWarning_ExtensionTool(), Slic3r::MachineObject::upgrade_consistency_request, and Slic3r::MachineObject::upgrade_force_upgrade.

Referenced by on_selection_changed(), on_timer(), and update_best_pos_dialog().

Here is the caller graph for this function:

◆ update_timelapse_folder_btn_icon()

void Slic3r::GUI::SelectMachineDialog::update_timelapse_folder_btn_icon ( )
private
3258{
3259 if (!m_timelapse_folder_btn) return;
3260 // always restore to normal (grey) - active state is managed by popup open/close
3261 m_timelapse_folder_btn->SetBitmap(create_scaled_bitmap("folder-closed", m_timelapse_folder_btn, 16));
3262 m_timelapse_folder_btn->Refresh();
3263}

References create_scaled_bitmap(), and m_timelapse_folder_btn.

Referenced by SelectMachineDialog(), show_timelapse_folder_popup(), and update_option_opts().

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

◆ update_user_machine_list()

void Slic3r::GUI::SelectMachineDialog::update_user_machine_list ( )
3829{
3830 NetworkAgent* m_agent = wxGetApp().getAgent();
3831 const std::string provider = wxGetApp().get_printer_cloud_provider();
3832 if (m_agent && m_agent->is_user_login(provider)) {
3833 boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token), provider] {
3834 NetworkAgent* agent = wxGetApp().getAgent();
3835 unsigned int http_code;
3836 std::string body;
3837 int result = agent->get_user_print_info(&http_code, &body, provider);
3838 CallAfter([token, this, result, body] {
3839 if (token.expired()) {return;}
3840 if (result == 0) {
3841 m_print_info = body;
3842 }
3843 else {
3844 m_print_info = "";
3845 }
3846 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
3847 event.SetEventObject(this);
3848 wxPostEvent(this, event);
3849 });
3850 });
3851 } else {
3852 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
3853 event.SetEventObject(this);
3854 wxPostEvent(this, event);
3855 }
3856}
std::shared_ptr< int > m_token
Definition SelectMachine.hpp:341
boost::thread create_thread(boost::thread::attributes &attrs, Fn &&fn)
Definition Thread.hpp:48

References Slic3r::create_thread(), Slic3r::NetworkAgent::get_user_print_info(), Slic3r::NetworkAgent::is_user_login(), m_print_info, and m_token.

Referenced by on_refresh(), and Show().

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

◆ update_user_printer()

void Slic3r::GUI::SelectMachineDialog::update_user_printer ( )
4065{
4066 Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
4067 if (!dev) return;
4068
4069 // update user print info
4070 if (!m_print_info.empty()) {
4072 m_print_info = "";
4073 }
4074
4075 // update the machine list, and select a default machine
4077 m_printer_box->SetPrinters(m_list);
4078 if (!m_list.empty())
4079 {
4080 m_printer_last_select = m_list.front()->get_dev_id();
4081 m_printer_box->GetPrinterComboBox()->SetSelection(0);
4082 wxCommandEvent event(wxEVT_COMBOBOX);
4083 event.SetEventObject(m_printer_box->GetPrinterComboBox());
4084 wxPostEvent(m_printer_box->GetPrinterComboBox(), event);
4085 }
4086 else
4087 {
4089 update_select_layout(nullptr);
4090 m_printer_box->GetPrinterComboBox()->SetValue(_L("No available printers"));
4091 }
4092
4093 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "for send task, current printer id = " << m_printer_last_select << std::endl;
4094}
void parse_user_print_info(std::string body)
Definition DevManager.cpp:894
static void _collect_sorted_machines(Slic3r::DeviceManager *dev_manager, std::vector< MachineObject * > &sorted_machine_objs)
Definition SelectMachine.cpp:3990

References Slic3r::GUI::_collect_sorted_machines(), _L, m_list, m_print_info, m_printer_box, m_printer_last_select, Slic3r::DeviceManager::parse_user_print_info(), and update_select_layout().

Referenced by update_printer_combobox().

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

◆ UpdateStatusCheckWarning_ExtensionTool()

void Slic3r::GUI::SelectMachineDialog::UpdateStatusCheckWarning_ExtensionTool ( MachineObject * obj_)
6455{
6456 if (!obj_)
6457 {
6458 return;
6459 }
6460
6462 {
6463 return;
6464 }
6465
6466 if (auto extension_tool = obj_->GetExtensionTool().lock())
6467 {
6468 if (extension_tool->IsToolTypeFanF000() && !extension_tool->IsMounted() )
6469 {
6470 for (const FilamentInfo& item : m_ams_mapping_result)
6471 {
6472 auto filament_info = wxGetApp().preset_bundle->get_filament_by_filament_id(item.filament_id);
6473 if (filament_info && (filament_info->temperature_vitrification <= 50))
6474 {
6476 { _L("Install toolhead enhanced cooling fan to prevent filament softening.")},
6477 "https://www.orcaslicer.com/wiki/"); // Orca: neutral wiki link (vendor URL removed)
6478 return;
6479 }
6480 }
6481 }
6482 }
6483}
static bool support_print_check_extension_fan_f000_mounted(const std::string &type_str)
Definition DevConfigUtil.h:128

References _L, Slic3r::MachineObject::GetExtensionTool(), m_ams_mapping_result, Slic3r::MachineObject::printer_type, Slic3r::GUI::PrintStatusToolHeadCoolingFanWarning, show_status(), and Slic3r::DevPrinterConfigUtil::support_print_check_extension_fan_f000_mounted().

Referenced by update_show_status().

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

◆ use_dynamic_nozzle_map()

bool Slic3r::GUI::SelectMachineDialog::use_dynamic_nozzle_map ( ) const
1662{
1663 if (m_print_type == FROM_NORMAL) {
1664 auto nozzle_group_res = DevUtilBackend::GetNozzleGroupResult(m_plater);
1665 if (nozzle_group_res && nozzle_group_res->is_support_dynamic_nozzle_map())
1666 return true;
1667 } else if (m_print_type == FROM_SDCARD_VIEW) {
1668 if (m_required_data_plate_data_list.size() > (size_t) m_print_plate_idx) {
1669 auto dynamic_nozzle_map = m_required_data_plate_data_list[m_print_plate_idx]->config.option<ConfigOptionBool>("enable_filament_dynamic_map");
1670 if (dynamic_nozzle_map)
1671 return dynamic_nozzle_map->value;
1672 }
1673 auto dynamic_nozzle_map = m_required_data_config.option<ConfigOptionBool>("enable_filament_dynamic_map");
1674 if (dynamic_nozzle_map)
1675 return dynamic_nozzle_map->value;
1676 }
1677 return false;
1678}

References Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::DevUtilBackend::GetNozzleGroupResult(), m_plater, m_print_plate_idx, m_print_type, m_required_data_config, m_required_data_plate_data_list, and Slic3r::ConfigOptionSingle< T >::value.

Referenced by CheckErrorDynamicSwitchNozzle(), CheckErrorSyncNozzleMappingResultV0(), CheckErrorSyncNozzleMappingResultV1(), get_mapped_nozzle_str(), on_flow_cali_option_changed(), on_pa_value_option_changed(), reset_and_sync_ams_list(), set_default_from_sdcard(), and slicing_with_fila_switch().

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

Member Data Documentation

◆ ams_mapping_help_icon

ScalableBitmap* Slic3r::GUI::SelectMachineDialog::ams_mapping_help_icon {nullptr}
protected
442{nullptr};

Referenced by on_dpi_changed().

◆ img_ams_backup

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::img_ams_backup {nullptr}
protected
443{nullptr};

Referenced by SelectMachineDialog(), and on_timer().

◆ img_amsmapping_tip

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::img_amsmapping_tip {nullptr}
protected
395{nullptr};

Referenced by on_dpi_changed().

◆ m_ams_backup_tip

Label* Slic3r::GUI::SelectMachineDialog::m_ams_backup_tip {nullptr}
protected
411{nullptr};

Referenced by SelectMachineDialog(), Enable_Auto_Refill(), and on_timer().

◆ m_ams_mapping_res

bool Slic3r::GUI::SelectMachineDialog::m_ams_mapping_res { false }
private
320{ false };

Referenced by on_selection_changed(), and update_show_status().

◆ m_ams_mapping_result

◆ m_ams_mapping_valid

bool Slic3r::GUI::SelectMachineDialog::m_ams_mapping_valid { false }
private
321{ false };

Referenced by on_selection_changed().

◆ m_ams_tooltip

wxString Slic3r::GUI::SelectMachineDialog::m_ams_tooltip
private

Referenced by reset_and_sync_ams_list().

◆ m_basic_panel

wxPanel* Slic3r::GUI::SelectMachineDialog::m_basic_panel
protected

◆ m_basicl_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_basicl_sizer { nullptr }
protected
383{ nullptr };

Referenced by SelectMachineDialog().

◆ m_bedtype_list

std::vector<wxString> Slic3r::GUI::SelectMachineDialog::m_bedtype_list
private

Referenced by SelectMachineDialog().

◆ m_best_pos_dialog

ReselectMachineDialog* Slic3r::GUI::SelectMachineDialog::m_best_pos_dialog { nullptr }
protected
465{ nullptr }; // AMS best-position popup

Referenced by on_reselect_dialog_btn_clicked(), and update_best_pos_dialog().

◆ m_bitmap_last_plate

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::m_bitmap_last_plate { nullptr }
protected
393{ nullptr };

Referenced by SelectMachineDialog(), init_bind(), and update_page_turn_state().

◆ m_bitmap_next_plate

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::m_bitmap_next_plate { nullptr }
protected
394{ nullptr };

Referenced by SelectMachineDialog(), init_bind(), and update_page_turn_state().

◆ m_btn_bg_enable

StateColor Slic3r::GUI::SelectMachineDialog::m_btn_bg_enable
private

◆ m_button_ensure

Button* Slic3r::GUI::SelectMachineDialog::m_button_ensure { nullptr }
protected
390{ nullptr };

Referenced by SelectMachineDialog(), Enable_Send_Button(), and on_dpi_changed().

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_change_filament_times_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_change_filament_times_sizer { nullptr }
protected

◆ m_check_ext_change_assist

CheckBox* Slic3r::GUI::SelectMachineDialog::m_check_ext_change_assist { nullptr }
protected
421{ nullptr };

Referenced by SelectMachineDialog(), init_bind(), and update_show_status().

◆ m_check_flag

bool Slic3r::GUI::SelectMachineDialog::m_check_flag {false}
private

◆ m_checkbox_list

◆ m_checkbox_list_order

std::list<PrintOption*> Slic3r::GUI::SelectMachineDialog::m_checkbox_list_order
private

◆ m_colour_bold_color

wxColour Slic3r::GUI::SelectMachineDialog::m_colour_bold_color {wxColour(38, 46, 48)}
private
335{wxColour(38, 46, 48)};

◆ m_colour_def_color

wxColour Slic3r::GUI::SelectMachineDialog::m_colour_def_color {wxColour(255, 255, 255)}
private
334{wxColour(255, 255, 255)};

Referenced by SelectMachineDialog().

◆ m_cur_colors_in_thumbnail

std::vector<wxColour> Slic3r::GUI::SelectMachineDialog::m_cur_colors_in_thumbnail
protected

◆ m_cur_input_thumbnail_data

ThumbnailData Slic3r::GUI::SelectMachineDialog::m_cur_input_thumbnail_data
protected

◆ m_cur_no_light_thumbnail_data

ThumbnailData Slic3r::GUI::SelectMachineDialog::m_cur_no_light_thumbnail_data
protected

◆ m_current_filament_id

int Slic3r::GUI::SelectMachineDialog::m_current_filament_id {0}
private

◆ m_current_project_name

wxString Slic3r::GUI::SelectMachineDialog::m_current_project_name
private

◆ m_edge_pixels

std::vector<bool> Slic3r::GUI::SelectMachineDialog::m_edge_pixels
protected

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_export_3mf_cancel

bool Slic3r::GUI::SelectMachineDialog::m_export_3mf_cancel { false }
private
322{ false };

Referenced by SelectMachineDialog(), and on_send_print().

◆ m_ext_change_assist

bool Slic3r::GUI::SelectMachineDialog::m_ext_change_assist { false }
private
326{ false };

Referenced by init_bind(), on_ok_btn(), and on_send_print().

◆ m_filament_left_panel

StaticBox* Slic3r::GUI::SelectMachineDialog::m_filament_left_panel
protected

◆ m_filament_panel

StaticBox* Slic3r::GUI::SelectMachineDialog::m_filament_panel
protected

◆ m_filament_panel_left_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_filament_panel_left_sizer
protected

◆ m_filament_panel_right_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_filament_panel_right_sizer
protected

◆ m_filament_panel_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_filament_panel_sizer
protected

◆ m_filament_right_panel

StaticBox* Slic3r::GUI::SelectMachineDialog::m_filament_right_panel
protected

◆ m_filaments

◆ m_filaments_map

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_is_canceled

bool Slic3r::GUI::SelectMachineDialog::m_is_canceled { false }
private
323{ false };

Referenced by on_send_print().

◆ m_is_in_sending_mode

bool Slic3r::GUI::SelectMachineDialog::m_is_in_sending_mode { false }
private

◆ m_is_rename_mode

bool Slic3r::GUI::SelectMachineDialog::m_is_rename_mode { false }
private
324{ false };

Referenced by on_rename_click(), and on_rename_enter().

◆ m_label_ext_change_assist

Label* Slic3r::GUI::SelectMachineDialog::m_label_ext_change_assist { nullptr }
protected
422{ nullptr };

Referenced by SelectMachineDialog(), and update_show_status().

◆ m_line_top

wxPanel* Slic3r::GUI::SelectMachineDialog::m_line_top { nullptr }
protected
406{ nullptr };

Referenced by SelectMachineDialog().

◆ m_link_edit_nozzle

Label* Slic3r::GUI::SelectMachineDialog::m_link_edit_nozzle { nullptr }
protected

◆ m_link_network_state

HyperLink* Slic3r::GUI::SelectMachineDialog::m_link_network_state { nullptr }
protected
412{ nullptr }; // ORCA

Referenced by SelectMachineDialog().

◆ m_list

std::vector<MachineObject*> Slic3r::GUI::SelectMachineDialog::m_list
private

◆ m_mapping_popup

AmsMapingPopup Slic3r::GUI::SelectMachineDialog::m_mapping_popup { nullptr }
protected

◆ m_mapping_sugs_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_mapping_sugs_sizer { nullptr }
protected

◆ m_mapping_tip_popup

AmsMapingTipPopup Slic3r::GUI::SelectMachineDialog::m_mapping_tip_popup { nullptr }
protected
375{ nullptr };

Referenced by SelectMachineDialog().

◆ m_mapping_tutorial_popup

AmsTutorialPopup Slic3r::GUI::SelectMachineDialog::m_mapping_tutorial_popup { nullptr }
protected
376{ nullptr };

Referenced by SelectMachineDialog().

◆ m_materialList

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_nozzle_diameter_ack_msg

wxString Slic3r::GUI::SelectMachineDialog::m_nozzle_diameter_ack_msg

Referenced by show_status().

◆ m_nozzle_diameter_mismatch_msg

wxString Slic3r::GUI::SelectMachineDialog::m_nozzle_diameter_mismatch_msg

◆ m_nozzle_mapping_result

std::unordered_map<int, int> Slic3r::GUI::SelectMachineDialog::m_nozzle_mapping_result
private

◆ m_options_other

wxPanel* Slic3r::GUI::SelectMachineDialog::m_options_other {nullptr}
protected
379{nullptr};

Referenced by SelectMachineDialog(), on_flow_cali_option_changed(), and Show().

◆ m_panel_finish

wxPanel* Slic3r::GUI::SelectMachineDialog::m_panel_finish {nullptr}
protected
402{nullptr};

Referenced by SelectMachineDialog().

◆ m_panel_prepare

wxPanel* Slic3r::GUI::SelectMachineDialog::m_panel_prepare {nullptr}
protected
401{nullptr};

Referenced by SelectMachineDialog(), and init_bind().

◆ m_panel_sending

wxPanel* Slic3r::GUI::SelectMachineDialog::m_panel_sending {nullptr}
protected
400{nullptr};

Referenced by SelectMachineDialog().

◆ m_panel_status

wxPanel* Slic3r::GUI::SelectMachineDialog::m_panel_status { nullptr }
protected
397{ nullptr };

◆ m_plater

◆ m_pre_print_checker

PrePrintChecker Slic3r::GUI::SelectMachineDialog::m_pre_print_checker
protected

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_preview_colors_in_thumbnail

std::vector<wxColour> Slic3r::GUI::SelectMachineDialog::m_preview_colors_in_thumbnail
protected

◆ m_preview_thumbnail_data

ThumbnailData Slic3r::GUI::SelectMachineDialog::m_preview_thumbnail_data
protected

◆ m_print_error_code

int Slic3r::GUI::SelectMachineDialog::m_print_error_code {0}
private

◆ m_print_error_extra

std::string Slic3r::GUI::SelectMachineDialog::m_print_error_extra
private

◆ m_print_error_msg

std::string Slic3r::GUI::SelectMachineDialog::m_print_error_msg
private

◆ m_print_info

std::string Slic3r::GUI::SelectMachineDialog::m_print_info
private

◆ m_print_job

std::shared_ptr<PrintJob> Slic3r::GUI::SelectMachineDialog::m_print_job
protected

Referenced by on_send_print().

◆ m_print_page_mode

PrintPageMode Slic3r::GUI::SelectMachineDialog::m_print_page_mode {PrintPageMode::PrintPageModePrepare}
private

◆ m_print_plate_idx

◆ m_print_plate_total

int Slic3r::GUI::SelectMachineDialog::m_print_plate_total {0}
private

◆ m_print_status

PrintDialogStatus Slic3r::GUI::SelectMachineDialog::m_print_status { PrintStatusInit }
private

◆ m_print_type

◆ m_printer_box

◆ m_printer_last_select

◆ m_refresh_timer

wxTimer* Slic3r::GUI::SelectMachineDialog::m_refresh_timer { nullptr }
protected
433{ nullptr };

Referenced by ~SelectMachineDialog(), init_timer(), and Show().

◆ m_rename_button

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::m_rename_button {nullptr}
protected
391{nullptr};

Referenced by SelectMachineDialog(), EnableEditing(), and sys_color_changed().

◆ m_rename_input

TextInput* Slic3r::GUI::SelectMachineDialog::m_rename_input {nullptr}
protected

◆ m_rename_normal_panel

wxPanel* Slic3r::GUI::SelectMachineDialog::m_rename_normal_panel {nullptr}
protected
399{nullptr};

Referenced by SelectMachineDialog(), on_rename_enter(), and set_default().

◆ m_rename_switch_panel

wxSimplebook* Slic3r::GUI::SelectMachineDialog::m_rename_switch_panel {nullptr}
protected

◆ m_rename_text

wxStaticText* Slic3r::GUI::SelectMachineDialog::m_rename_text {nullptr}
protected
415{nullptr};

Referenced by SelectMachineDialog(), on_rename_enter(), and set_default().

◆ m_required_data_config

◆ m_required_data_file_name

std::string Slic3r::GUI::SelectMachineDialog::m_required_data_file_name
private

◆ m_required_data_file_path

std::string Slic3r::GUI::SelectMachineDialog::m_required_data_file_path
private

◆ m_required_data_model

Slic3r::Model Slic3r::GUI::SelectMachineDialog::m_required_data_model
private

◆ m_required_data_plate_data_list

◆ m_saveTimeText

Label* Slic3r::GUI::SelectMachineDialog::m_saveTimeText { nullptr }
protected
418{ nullptr }; // best-position "saves X" clickable tip

Referenced by SelectMachineDialog(), EnableEditing(), and refresh_save_time().

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_scroll_area

wxScrolledWindow* Slic3r::GUI::SelectMachineDialog::m_scroll_area {nullptr}
protected

◆ m_simplebook

wxSimplebook* Slic3r::GUI::SelectMachineDialog::m_simplebook {nullptr}
protected

◆ m_sizer_ams_mapping

wxGridSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_ams_mapping { nullptr }
protected

◆ m_sizer_ams_mapping_left

wxGridSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_ams_mapping_left { nullptr }
protected

◆ m_sizer_ams_mapping_right

wxGridSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_ams_mapping_right { nullptr }
protected

◆ m_sizer_autorefill

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_autorefill { nullptr }
protected
386{ nullptr };

Referenced by SelectMachineDialog().

◆ m_sizer_filament_2extruder

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_filament_2extruder
protected

Referenced by SelectMachineDialog().

◆ m_sizer_options

wxGridSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_options {nullptr}
protected
380{nullptr};

Referenced by SelectMachineDialog(), and update_options_layout().

◆ m_sizer_thumbnail

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_sizer_thumbnail { nullptr }
protected
381{ nullptr };

Referenced by SelectMachineDialog().

◆ m_st_txt_error_code

Label* Slic3r::GUI::SelectMachineDialog::m_st_txt_error_code {nullptr}
protected
408{nullptr};

Referenced by SelectMachineDialog(), and show_print_failed_info().

◆ m_st_txt_error_desc

Label* Slic3r::GUI::SelectMachineDialog::m_st_txt_error_desc {nullptr}
protected
409{nullptr};

Referenced by SelectMachineDialog(), and show_print_failed_info().

◆ m_st_txt_extra_info

Label* Slic3r::GUI::SelectMachineDialog::m_st_txt_extra_info {nullptr}
protected
410{nullptr};

Referenced by SelectMachineDialog(), and show_print_failed_info().

◆ m_staticbitmap

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::m_staticbitmap { nullptr }
protected
392{ nullptr };

◆ m_statictext_ams_msg

PrinterMsgPanel* Slic3r::GUI::SelectMachineDialog::m_statictext_ams_msg {nullptr}
protected
419{nullptr};

Referenced by SelectMachineDialog(), and update_print_status_msg().

◆ m_staticText_bed_title

wxStaticText* Slic3r::GUI::SelectMachineDialog::m_staticText_bed_title { nullptr }
protected
429{ nullptr };

◆ m_statictext_finish

wxStaticText* Slic3r::GUI::SelectMachineDialog::m_statictext_finish {nullptr}
protected
431{nullptr};

Referenced by SelectMachineDialog().

◆ m_status_bar

std::shared_ptr<BBLStatusBarPrint> Slic3r::GUI::SelectMachineDialog::m_status_bar
private

◆ m_stext_sending

wxStaticText* Slic3r::GUI::SelectMachineDialog::m_stext_sending { nullptr }
protected
430{ nullptr };

◆ m_stext_time

Label* Slic3r::GUI::SelectMachineDialog::m_stext_time { nullptr }
protected

◆ m_stext_weight

Label* Slic3r::GUI::SelectMachineDialog::m_stext_weight { nullptr }
protected

◆ m_sw_print_failed_info

wxScrolledWindow* Slic3r::GUI::SelectMachineDialog::m_sw_print_failed_info {nullptr}
protected
435{nullptr};

Referenced by SelectMachineDialog(), and show_print_failed_info().

◆ m_text_printer_msg

PrinterMsgPanel* Slic3r::GUI::SelectMachineDialog::m_text_printer_msg {nullptr}
protected
427{nullptr};

Referenced by SelectMachineDialog(), and update_print_status_msg().

◆ m_text_printer_msg_tips

Label* Slic3r::GUI::SelectMachineDialog::m_text_printer_msg_tips { nullptr }
protected
428{ nullptr };

Referenced by SelectMachineDialog().

◆ m_thumbnailPanel

ThumbnailPanel* Slic3r::GUI::SelectMachineDialog::m_thumbnailPanel { nullptr }
protected

◆ m_timelapse_check_elapsed_ms

int Slic3r::GUI::SelectMachineDialog::m_timelapse_check_elapsed_ms { 0 }
private

◆ m_timelapse_check_interval_ms

int Slic3r::GUI::SelectMachineDialog::m_timelapse_check_interval_ms { 100 }
private

◆ m_timelapse_check_timeout_ms

int Slic3r::GUI::SelectMachineDialog::m_timelapse_check_timeout_ms { 5000 }
private
364{ 5000 };

Referenced by on_timelapse_storage_check_timer().

◆ m_timelapse_check_timer

wxTimer* Slic3r::GUI::SelectMachineDialog::m_timelapse_check_timer { nullptr }
private

◆ m_timelapse_folder_btn

ScalableButton* Slic3r::GUI::SelectMachineDialog::m_timelapse_folder_btn { nullptr }
private

◆ m_timelapse_storage

◆ m_timelapse_storage_popup

PopupWindow* Slic3r::GUI::SelectMachineDialog::m_timelapse_storage_popup { nullptr }
private
361{ nullptr };

Referenced by SelectMachineDialog(), and show_timelapse_folder_popup().

◆ m_timelapse_total_layer

int Slic3r::GUI::SelectMachineDialog::m_timelapse_total_layer { 0 }
private

◆ m_timeout_count

int Slic3r::GUI::SelectMachineDialog::m_timeout_count {0}
private

◆ m_token

std::shared_ptr<int> Slic3r::GUI::SelectMachineDialog::m_token = std::make_shared<int>(0)
private

◆ m_txt_change_filament_times

Label* Slic3r::GUI::SelectMachineDialog::m_txt_change_filament_times { nullptr }
protected

◆ m_txt_warn_when_drying

Label* Slic3r::GUI::SelectMachineDialog::m_txt_warn_when_drying { nullptr }
protected
424{ nullptr };

Referenced by SelectMachineDialog(), and update_show_status().

◆ m_warn_when_drying_sizer

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::m_warn_when_drying_sizer { nullptr }
protected
389{ nullptr };

Referenced by SelectMachineDialog(), set_default(), and update_show_status().

◆ m_worker

std::unique_ptr<Worker> Slic3r::GUI::SelectMachineDialog::m_worker
private

◆ MACHINE_BED_TYPE_STRING

std::vector< wxString > Slic3r::GUI::SelectMachineDialog::MACHINE_BED_TYPE_STRING
static

◆ MachineBedTypeString

std::vector< std::string > Slic3r::GUI::SelectMachineDialog::MachineBedTypeString
static

◆ ops_auto

std::vector<POItem> Slic3r::GUI::SelectMachineDialog::ops_auto
private

◆ ops_no_auto

std::vector<POItem> Slic3r::GUI::SelectMachineDialog::ops_no_auto
private

◆ print_time

ScalableBitmap* Slic3r::GUI::SelectMachineDialog::print_time {nullptr}
protected
439{nullptr};

Referenced by SelectMachineDialog(), and on_dpi_changed().

◆ print_weight

ScalableBitmap* Slic3r::GUI::SelectMachineDialog::print_weight {nullptr}
protected
441{nullptr};

Referenced by SelectMachineDialog(), and on_dpi_changed().

◆ rename_editable

ScalableBitmap* Slic3r::GUI::SelectMachineDialog::rename_editable {nullptr}
protected
436{nullptr};

Referenced by SelectMachineDialog(), on_dpi_changed(), and sys_color_changed().

◆ rename_editable_light

ScalableBitmap* Slic3r::GUI::SelectMachineDialog::rename_editable_light {nullptr}
protected
437{nullptr};

Referenced by SelectMachineDialog(), on_dpi_changed(), and sys_color_changed().

◆ rename_sizer_h

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::rename_sizer_h { nullptr }
protected
385{ nullptr };

Referenced by SelectMachineDialog().

◆ rename_sizer_v

wxBoxSizer* Slic3r::GUI::SelectMachineDialog::rename_sizer_v { nullptr }
protected
384{ nullptr };

Referenced by SelectMachineDialog().

◆ timeimg

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::timeimg {nullptr}
protected
438{nullptr};

Referenced by SelectMachineDialog(), and on_dpi_changed().

◆ weightimg

wxStaticBitmap* Slic3r::GUI::SelectMachineDialog::weightimg {nullptr}
protected
440{nullptr};

Referenced by SelectMachineDialog(), and on_dpi_changed().


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