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

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

Inheritance diagram for Slic3r::GUI::SyncAmsInfoDialog:
Collaboration diagram for Slic3r::GUI::SyncAmsInfoDialog:

Classes

struct  SyncInfo
struct  SyncResult

Public Member Functions

void check_empty_project ()
void reinit_dialog ()
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 prepare_mode (bool refresh_button=true)
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 >())
void reset_timeout ()
void update_user_printer ()
void reset_ams_material ()
void reset_all_ams_info ()
void reset_one_ams_material (const std::string &index_str, bool reset_to_first=false)
void update_show_status ()
void update_printer_combobox (wxCommandEvent &event)
void on_cancel (wxCloseEvent &event)
void show_errors (wxString &info)
void Enable_Auto_Refill (bool enable)
void on_refresh (wxCommandEvent &event)
void on_set_finish_mapping (wxCommandEvent &evt)
void on_print_job_cancel (wxCommandEvent &evt)
void reset_and_sync_ams_list ()
void generate_override_fix_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 show_ams_controls (bool flag)
void show_advanced_settings (bool flag, bool update_layout=true)
void update_thumbnail_data_accord_plate_index (bool allow_clone_ams_color)
void update_final_thumbnail_data ()
void unify_deal_thumbnail_data (ThumbnailData &input_data, ThumbnailData &no_light_data, bool allow_clone_ams_color)
void change_default_normal (int old_filament_id, wxColour temp_ams_color)
void on_timer (wxTimerEvent &event)
void update_user_machine_list ()
void update_lan_machine_list ()
void stripWhiteSpace (std::string &str)
void update_ams_status_msg (wxString msg, bool is_warning=false)
void update_priner_status_msg (wxString msg, bool is_warning=false)
void update_print_status_msg (wxString msg, bool is_warning=false, bool is_printer=true)
void update_print_error_info (int code, std::string msg, std::string extra)
bool has_timelapse_warning ()
void update_timelapse_enable_status ()
bool is_same_printer_model ()
bool is_blocking_printing (MachineObject *obj_)
bool is_same_nozzle_type (std::string &filament_type, NozzleType &tag_nozzle_type)
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 do_ams_mapping (MachineObject *obj_)
bool has_selector (MachineObject *obj_) const
void deal_only_exist_ext_spool (MachineObject *obj_)
void show_thumbnail_page ()
bool get_ams_mapping_result (std::string &mapping_array_str, std::string &mapping_array_str2, std::string &ams_mapping_info)
bool build_nozzles_info (std::string &nozzles_info)
void auto_supply_with_ext (std::vector< DevAmsTray > slots)
bool is_nozzle_type_match (DevExtderSystem data, wxString &error_message) const
int convert_filament_map_nozzle_id_to_task_nozzle_id (int nozzle_id)
PrintFromType get_print_type ()
wxString format_text (wxString &m_msg)
PrintDialogStatus get_status ()
std::vector< std::string > sort_string (std::vector< std::string > strArray)
const std::vector< FilamentInfo > & get_ams_mapping_result ()
 SyncAmsInfoDialog (wxWindow *parent, SyncInfo &info)
 ~SyncAmsInfoDialog ()
void set_info (SyncInfo &info)
void on_dpi_changed (const wxRect &suggested_rect) override
const SyncResult & get_result ()
bool Show (bool show) override
void updata_ui_data_after_connected_printer ()
void set_default (bool hide_some=false)
void update_select_layout (MachineObject *obj)
void set_default_normal (const ThumbnailData &)
bool is_must_finish_slice_then_connected_printer ()
void hide_no_use_controls ()
void show_sizer (wxSizer *sizer, bool show)
void deal_ok ()
bool get_is_double_extruder ()
bool is_dirty_filament ()
bool is_need_show ()
void set_check_dirty_fialment (bool flag)
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 ()

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}
wxBoxSizer * m_sizer_options_timelapse {nullptr}
wxBoxSizer * m_sizer_options_other {nullptr}
wxBoxSizer * m_sizer_thumbnail {nullptr}
wxScrolledWindow * m_scrolledWindow {nullptr}
wxBoxSizer * m_sizer_main {nullptr}
wxBoxSizer * m_sizer_this {nullptr}
wxBoxSizer * m_basicl_sizer {nullptr}
wxBoxSizer * m_sizer_autorefill {nullptr}
wxStaticBitmap * m_staticbitmap {nullptr}
wxStaticBitmap * img_amsmapping_tip {nullptr}
ThumbnailPanel * m_thumbnailPanel {nullptr}
wxPanel * m_panel_status {nullptr}
wxPanel * m_basic_panel
wxPanel * m_line_top {nullptr}
Label * m_ams_backup_tip {nullptr}
Label * m_statictext_ams_msg {nullptr}
Label * m_text_printer_msg {nullptr}
wxStaticText * m_staticText_bed_title {nullptr}
wxStaticText * m_original_in_colormap {nullptr}
wxStaticText * m_original_in_override {nullptr}
wxStaticText * m_ams_or_ext_text_in_colormap {nullptr}
wxStaticText * m_ams_or_ext_text_in_override {nullptr}
wxTimer * m_refresh_timer {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< wxColour > m_back_cur_colors_in_thumbnail
std::vector< bool > m_edge_pixels
StaticBox * m_two_image_panel {nullptr}
wxBoxSizer * m_two_image_panel_sizer {nullptr}
StaticBox * m_two_thumbnail_panel {nullptr}
wxBoxSizer * m_two_thumbnail_panel_sizer {nullptr}
wxBoxSizer * m_choose_plate_sizer {nullptr}
ComboBox * m_combobox_plate {nullptr}
wxArrayString m_plate_number_choices_str
std::vector< int > m_plate_choices
ScalableButton * m_swipe_left_button {nullptr}
ScalableButton * m_swipe_right_button {nullptr}
bool m_swipe_left_button_enable
bool m_swipe_right_button_enable
int m_bmp_pix_cont = 32
ScalableBitmap m_swipe_left_bmp_disable
ScalableBitmap m_swipe_left_bmp_normal
ScalableBitmap m_swipe_left_bmp_hover
ScalableBitmap m_swipe_right_bmp_disable
ScalableBitmap m_swipe_right_bmp_normal
ScalableBitmap m_swipe_right_bmp_hover
StaticBox * m_filament_panel {nullptr}
StaticBox * m_filament_left_panel {nullptr}
StaticBox * m_filament_right_panel {nullptr}
StaticBox * m_fix_filament_panel {nullptr}
wxFlexGridSizer * m_fix_sizer_ams_mapping {nullptr}
MaterialHash m_fix_materialList
wxBoxSizer * m_fix_filament_panel_sizer {nullptr}
std::vector< FilamentInfo > m_fix_filaments
bool m_generate_fix_sizer_ams_mapping = false
wxBoxSizer * m_filament_panel_sizer
wxBoxSizer * m_filament_panel_left_sizer
wxBoxSizer * m_filament_panel_right_sizer
wxBoxSizer * m_sizer_filament_2extruder
wxFlexGridSizer * m_sizer_ams_mapping {nullptr}
wxGridSizer * m_sizer_ams_mapping_left {nullptr}
wxGridSizer * m_sizer_ams_mapping_right {nullptr}
wxSimplebook * m_pages {nullptr}
wxPanel * m_loading_page {nullptr}
wxPanel * m_show_page {nullptr}
wxBoxSizer * m_sizer_show_page {nullptr}
wxAnimationCtrl * m_gif_ctrl {nullptr}

Private Types

enum  PageType { ptColorMap = 0 , ptOverride }
enum class  MapModeEnum { ColorMap = 0 , Override }

Private Member Functions

wxBoxSizer * create_sizer_thumbnail (wxButton *image_button, bool left)
void update_when_change_plate (int)
void update_when_change_map_mode (int)
void update_plate_combox ()
void update_map_when_change_map_mode ()
wxColour decode_ams_color (const std::string &color)
void update_when_change_map_mode (wxCommandEvent &e)
void update_panel_status (PageType page)
void show_color_panel (bool, bool update_layout=true)
void update_more_setting (bool layout=true, bool from_more_seting_text=false)
void add_two_image_control ()
void to_next_plate (wxCommandEvent &event)
void to_previous_plate (wxCommandEvent &event)
void update_swipe_button_state ()
void updata_ui_when_priner_not_same ()
void init_bitmaps ()
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

bool m_only_exist_ext_spool_flag {false}
int m_current_filament_id {0}
int m_print_plate_idx {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_check_flag {false}
PrintPageMode m_print_page_mode {PrintPageMode::PrintPageModePrepare}
std::string m_print_error_msg
std::string m_print_error_extra
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)}
std::shared_ptr< int > m_token = std::make_shared<int>(0)
std::map< std::string, PrintOption * > m_checkbox_list
std::vector< wxString > m_bedtype_list
std::vector< MachineObject * > m_list
std::vector< FilamentInfo > m_filaments
std::vector< FilamentInfo > m_ams_mapping_result
std::vector< FilamentInfo > m_back_ams_mapping_result
std::vector< int > m_filaments_map
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::vector< POItem > ops_auto
std::vector< POItem > ops_no_auto
SyncInfo m_input_info
SyncResult m_result
Button * m_button_ok = nullptr
Button * m_button_cancel = nullptr
AMSComboInfo m_ams_combo_info
Label * m_after_map_text {nullptr}
wxStaticText * m_attention_text {nullptr}
wxString m_tip_attention_color_map
wxString m_tip_attention_override
Label * m_tip_text {nullptr}
wxStaticText * m_warning_text {nullptr}
wxBoxSizer * m_left_sizer_thumbnail {nullptr}
wxBoxSizer * m_right_sizer_thumbnail {nullptr}
wxButton * m_left_image_button = nullptr
wxButton * m_right_image_button = nullptr
wxBoxSizer * sizer_basic_right_info = nullptr
wxBoxSizer * sizer_advanced_options_title = nullptr
Label * m_confirm_title = nullptr
wxString m_undone_str
wxString m_override_undone_str
wxStaticText * m_are_you_sure_title = nullptr
wxBoxSizer * m_mode_combox_sizer = nullptr
CapsuleButton * m_colormap_btn = nullptr
CapsuleButton * m_override_btn = nullptr
ScalableButton * m_reset_all_btn {nullptr}
wxBoxSizer * m_advace_setting_sizer = nullptr
wxStaticText * m_more_setting_tips = nullptr
wxStaticBitmap * m_advanced_options_icon {nullptr}
wxBoxSizer * m_append_color_sizer = nullptr
::CheckBox * m_append_color_checkbox = nullptr
Label * m_append_color_text = nullptr
wxBoxSizer * m_merge_color_sizer = nullptr
::CheckBox * m_merge_color_checkbox = nullptr
Label * m_merge_color_text = nullptr
bool m_is_empty_project = true
bool m_check_dirty_fialment = true
bool m_expand_more_settings = true
const int LEFT_THUMBNAIL_SIZE_WIDTH = 100
const int RIGHT_THUMBNAIL_SIZE_WIDTH = 300
int m_specify_plate_idx {0}
wxString m_printer_name
MapModeEnum m_map_mode {MapModeEnum::ColorMap}
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


Class Documentation

◆ Slic3r::GUI::SyncAmsInfoDialog::SyncInfo

struct Slic3r::GUI::SyncAmsInfoDialog::SyncInfo
Class Members
bool cancel_text_to_later = false
wxPoint dialog_pos
bool first_sync = false
bool use_dialog_pos = false

◆ Slic3r::GUI::SyncAmsInfoDialog::SyncResult

struct Slic3r::GUI::SyncAmsInfoDialog::SyncResult
Collaboration diagram for Slic3r::GUI::SyncAmsInfoDialog::SyncResult:
Class Members
bool direct_sync = true
bool is_same_printer = true
map< int, AMSMapInfo > sync_maps

Member Enumeration Documentation

◆ MapModeEnum

Enumerator
ColorMap 
Override 
355 {
356 ColorMap = 0,
357 Override,
358 };
@ Override
Definition TextureDisplacement.hpp:139

◆ PageType

Enumerator
ptColorMap 
ptOverride 
46{ ptColorMap = 0, ptOverride };
@ ptColorMap
Definition SyncAmsInfoDialog.hpp:46
@ ptOverride
Definition SyncAmsInfoDialog.hpp:46

Constructor & Destructor Documentation

◆ SyncAmsInfoDialog()

Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog ( wxWindow * parent,
SyncInfo & info )
683 :
684 DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Synchronize AMS Filament Information"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
685 , m_input_info(info)
686 , m_mapping_popup(AmsMapingPopup(this,true))
687 , m_mapping_tip_popup(AmsMapingTipPopup(this))
688 , m_mapping_tutorial_popup(AmsTutorialPopup(this))
689{
690 m_plater = wxGetApp().plater();
692#ifdef __WINDOWS__
693 SetDoubleBuffered(true);
694#endif //__WINDOWS__
695
696 ops_auto.push_back(POItem{"auto", "Auto"});
697 ops_auto.push_back(POItem{"on", "On"});
698 ops_auto.push_back(POItem{"off", "Off"});
699
700 ops_no_auto.push_back(POItem{"on", "On"});
701 ops_no_auto.push_back(POItem{"off", "Off"});
702
703 SetMinSize(wxSize(SyncAmsInfoDialogWidth, -1));
704 SetMaxSize(wxSize(SyncAmsInfoDialogWidth, -1));
705
706 // bind
707 Bind(wxEVT_CLOSE_WINDOW, &SyncAmsInfoDialog::on_cancel, this);
708
709 for (int i = 0; i < BED_TYPE_COUNT; i++) { m_bedtype_list.push_back(SelectMachineDialog::MACHINE_BED_TYPE_STRING[i]); }
710
711 // font
712 SetFont(wxGetApp().normal_font());
713
714 Freeze();
715 SetBackgroundColour(m_colour_def_color);
716
717 m_pages = new wxSimplebook(this);
718 m_pages->SetBackgroundColour(*wxWHITE);
719 m_pages->SetSize(wxSize(SyncAmsInfoDialogWidth, -1));
720
721 m_loading_page = new wxPanel(m_pages);
722 m_show_page = new wxPanel(m_pages);
723 m_loading_page->SetBackgroundColour(*wxWHITE);
724 m_show_page->SetBackgroundColour(*wxWHITE);
725 m_pages->AddPage(m_loading_page, wxEmptyString, true);
726 m_pages->AddPage(m_show_page, wxEmptyString, false);
727 {//generate m_loading_page
728 wxBoxSizer *page1Sizer = new wxBoxSizer(wxVERTICAL);
729 page1Sizer->AddStretchSpacer();
730
731 wxBoxSizer *loading_Sizer = new wxBoxSizer(wxHORIZONTAL);
732 m_gif_ctrl = new wxAnimationCtrl(m_loading_page, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxDefaultSize, wxAC_DEFAULT_STYLE);
733 const wxString gif_path = from_u8(Slic3r::var("loading.gif"));
734 if (m_gif_ctrl->LoadFile(gif_path)){
735 m_gif_ctrl->SetSize(m_gif_ctrl->GetAnimation().GetSize());
736 m_gif_ctrl->Play();
737
738 loading_Sizer->Add(m_gif_ctrl, 0, wxALIGN_CENTER | wxALL, 0);
739 loading_Sizer->AddSpacer(10);
740 }
741 auto loading_label = new Label(m_loading_page, _L("Loading"));
742 loading_label->SetFont(::Label::Head_14);
743 loading_Sizer->Add(loading_label, 0, wxALIGN_CENTER | wxALL, 0);
744
745 page1Sizer->Add(loading_Sizer, 0, wxALIGN_CENTER | wxALL, 0);
746 page1Sizer->AddStretchSpacer();
747 m_loading_page->SetSizerAndFit(page1Sizer);
748 }
749 m_sizer_show_page = new wxBoxSizer(wxVERTICAL);
750 m_sizer_this = new wxBoxSizer(wxVERTICAL);
751
752 //wxBoxSizer *m_scroll_sizer = new wxBoxSizer(wxVERTICAL);
753 m_scrolledWindow = new wxScrolledWindow(m_show_page, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxVSCROLL);
754 m_scrolledWindow->SetBackgroundColour(*wxWHITE);
755 m_scrolledWindow->SetScrollRate(0, FromDIP(20));
756 m_scrolledWindow->SetMinSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
757 m_scrolledWindow->SetMaxSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
758 m_scrolledWindow->EnableScrolling(false,true);
759 m_sizer_main = new wxBoxSizer(wxVERTICAL);
760
761 m_line_top = new wxPanel(m_scrolledWindow, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
762 m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
763 m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
764 //m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(11));
765 auto &bSizer = m_sizer_main;
766 { // content
768 //use map mode
769 m_mode_combox_sizer = new wxBoxSizer(wxHORIZONTAL);
770 m_colormap_btn = new CapsuleButton(m_scrolledWindow, PageType::ptColorMap, _L("Mapping"), true);
771 m_override_btn = new CapsuleButton(m_scrolledWindow, PageType::ptOverride, _L("Overwriting"), false);
772 m_mode_combox_sizer->AddSpacer(SyncAmsInfoDialogWidth / 2.0f - FromDIP(8) / 2.0f - m_colormap_btn->GetSize().GetX());
773 m_mode_combox_sizer->Add(m_colormap_btn, 0, wxEXPAND | wxALL, FromDIP(2));
774 m_mode_combox_sizer->AddSpacer(FromDIP(8));
775 m_mode_combox_sizer->Add(m_override_btn, 0, wxEXPAND | wxALL, FromDIP(2));
776 m_mode_combox_sizer->AddSpacer(SyncAmsInfoDialogWidth / 2.0f - FromDIP(8) / 2.0f - m_override_btn->GetSize().GetX() - FromDIP(60));
777 m_reset_all_btn = new ScalableButton(m_scrolledWindow, wxID_ANY, "reset_gray", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER,
778 true, 14);
779 m_reset_all_btn->Bind(wxEVT_BUTTON, [this](wxCommandEvent &e) { reset_all_ams_info(); });
780 m_reset_all_btn->SetBackgroundColour(*wxWHITE);
781 m_reset_all_btn->SetToolTip(_L("Reset all filament mapping"));
782
783 m_mode_combox_sizer->Add(m_reset_all_btn, 0, wxEXPAND | wxALL, FromDIP(2));
784
785 m_colormap_btn->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::update_when_change_map_mode,this); // update_when_change_map_mode(e.GetSelection());
787
788 bSizer->Add(m_mode_combox_sizer, FromDIP(0), wxEXPAND | wxTOP | wxBOTTOM, FromDIP(10));
789 }
790
791 m_basic_panel = new wxPanel(m_scrolledWindow, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
792 m_basic_panel->SetBackgroundColour(*wxWHITE);
793 m_basicl_sizer = new wxBoxSizer(wxHORIZONTAL);
794
795 /*basic info right*/
796 sizer_basic_right_info = new wxBoxSizer(wxVERTICAL);
797
799 m_text_printer_msg->SetMinSize(wxSize(FromDIP(420), FromDIP(24)));
800 m_text_printer_msg->SetMaxSize(wxSize(FromDIP(420), FromDIP(24)));
802 m_text_printer_msg->Hide();
803
804 sizer_basic_right_info->Add(m_text_printer_msg, 0, wxLEFT, 0);
805
806 m_basicl_sizer->Add(sizer_basic_right_info, 0, wxLEFT, 0);
807
808 m_basic_panel->SetSizer(m_basicl_sizer);
809 m_basic_panel->Layout();
810
811 /*filament area*/
812 //overrider fix filament
813 m_fix_filament_panel = new StaticBox(m_scrolledWindow);
814 m_fix_filament_panel->SetBorderWidth(0);
815 m_fix_filament_panel->SetMinSize(wxSize(FromDIP(637), -1));
816 m_fix_filament_panel->SetMaxSize(wxSize(FromDIP(637), -1));
817 m_fix_filament_panel_sizer = new wxBoxSizer(wxVERTICAL);
818
819 m_fix_sizer_ams_mapping = new wxFlexGridSizer(0, SYNC_FLEX_GRID_COL, FromDIP(6), FromDIP(7));
820 m_fix_filament_panel_sizer->Add(m_fix_sizer_ams_mapping, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(10));
822 m_fix_filament_panel->Layout();
824 /*1 extruder*/
825 m_filament_panel = new StaticBox(m_scrolledWindow);
826 m_filament_panel->SetBorderWidth(0);
827 m_filament_panel->SetMinSize(wxSize(FromDIP(637), -1));
828 m_filament_panel->SetMaxSize(wxSize(FromDIP(637), -1));
829 m_filament_panel_sizer = new wxBoxSizer(wxVERTICAL);
830
831 m_sizer_ams_mapping = new wxFlexGridSizer(0, SYNC_FLEX_GRID_COL, FromDIP(6), FromDIP(7));
832 m_filament_panel_sizer->Add(m_sizer_ams_mapping, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(10));
834 m_filament_panel->Layout();
835 m_filament_panel->Fit();
836
837 /*left & right extruder*/
838 m_sizer_filament_2extruder = new wxBoxSizer(wxHORIZONTAL);
839
841 m_filament_left_panel->SetBackgroundColour(wxColour("#F8F8F8"));
842 m_filament_left_panel->SetBorderWidth(0);
843 m_filament_left_panel->SetMinSize(wxSize(FromDIP(315), -1));
844 m_filament_left_panel->SetMaxSize(wxSize(FromDIP(315), -1));
845
846 m_filament_panel_left_sizer = new wxBoxSizer(wxVERTICAL);
847 auto left_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
848 auto left_recommend_title1 = new Label(m_filament_left_panel, _L("Left Extruder"));
849 left_recommend_title1->SetFont(::Label::Head_13);
850 left_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
851 auto left_recommend_title2 = new Label(m_filament_left_panel, _L("(Recommended filament)"));
852 left_recommend_title2->SetFont(::Label::Body_13);
853 left_recommend_title2->SetForegroundColour(wxColour("#6B6B6B"));
854 left_recommend_title2->SetBackgroundColour(wxColour("#F8F8F8"));
855 left_recommend_title_sizer->Add(left_recommend_title1, 0, wxALIGN_CENTER, 0);
856 left_recommend_title_sizer->Add(0, 0, 0, wxLEFT, FromDIP(4));
857 left_recommend_title_sizer->Add(left_recommend_title2, 0, wxALIGN_CENTER, 0);
858
859 m_sizer_ams_mapping_left = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
860 m_filament_panel_left_sizer->Add(left_recommend_title_sizer, 0, wxLEFT | wxRIGHT | wxTOP, FromDIP(10));
861 m_filament_panel_left_sizer->Add(m_sizer_ams_mapping_left, 0, wxEXPAND | wxALL, FromDIP(10));
863 m_filament_left_panel->Layout();
864
866 m_filament_right_panel->SetBorderWidth(0);
867 m_filament_right_panel->SetBackgroundColour(wxColour("#F8F8F8"));
868 m_filament_right_panel->SetMinSize(wxSize(FromDIP(315), -1));
869 m_filament_right_panel->SetMaxSize(wxSize(FromDIP(315), -1));
870
871 m_filament_panel_right_sizer = new wxBoxSizer(wxVERTICAL);
872 auto right_recommend_title_sizer = new wxBoxSizer(wxHORIZONTAL);
873 auto right_recommend_title1 = new Label(m_filament_right_panel, _L("Right Extruder"));
874 right_recommend_title1->SetFont(::Label::Head_13);
875 right_recommend_title1->SetBackgroundColour(wxColour("#F8F8F8"));
876
877 auto right_recommend_title2 = new Label(m_filament_right_panel, _L("(Recommended filament)"));
878 right_recommend_title2->SetFont(::Label::Body_13);
879 right_recommend_title2->SetForegroundColour(wxColour("#6B6B6B"));
880 right_recommend_title2->SetBackgroundColour(wxColour("#F8F8F8"));
881 right_recommend_title_sizer->Add(right_recommend_title1, 0, wxALIGN_CENTER, 0);
882 right_recommend_title_sizer->Add(0, 0, 0, wxLEFT, FromDIP(4));
883 right_recommend_title_sizer->Add(right_recommend_title2, 0, wxALIGN_CENTER, 0);
884
885 m_sizer_ams_mapping_right = new wxGridSizer(0, 5, FromDIP(7), FromDIP(7));
886 m_filament_panel_right_sizer->Add(right_recommend_title_sizer, 0, wxLEFT | wxRIGHT | wxTOP, FromDIP(10));
887 m_filament_panel_right_sizer->Add(m_sizer_ams_mapping_right, 0, wxEXPAND | wxALL, FromDIP(10));
889 m_filament_right_panel->Layout();
890
892 m_sizer_filament_2extruder->Add(0, 0, 1, wxEXPAND, 0);
895
896 m_filament_left_panel->Hide();//init
898 m_filament_panel->Hide();//init
899
900 sizer_advanced_options_title = new wxBoxSizer(wxHORIZONTAL);
901 auto advanced_options_title = new Label(m_scrolledWindow, _L("Advanced Options"));
902 advanced_options_title->SetFont(::Label::Head_14); // ORCA
903 advanced_options_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
904
905 sizer_advanced_options_title->Add(0, 0, 1, wxEXPAND, 0);
906 sizer_advanced_options_title->Add(advanced_options_title, 0, wxALIGN_CENTER, 0);
907
908 advanced_options_title->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) { SetCursor(wxCURSOR_HAND); });
909 advanced_options_title->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) { SetCursor(wxCURSOR_ARROW); });
910 advanced_options_title->Bind(wxEVT_LEFT_DOWN, [this](auto &e) {
911 if (m_options_other->IsShown()) {
912 m_options_other->Hide();
913 } else {
914 m_options_other->Show();
915 }
916 Layout();
917 Fit();
918 });
919
920 m_options_other = new wxPanel(m_scrolledWindow);
921 m_sizer_options_timelapse = new wxBoxSizer(wxVERTICAL);
922 m_sizer_options_other = new wxBoxSizer(wxVERTICAL);
923
924 auto option_timelapse = new PrintOption(m_scrolledWindow, _L("Timelapse"), wxEmptyString, ops_no_auto, "timelapse");
925
926 auto option_auto_bed_level =
927 new PrintOption(m_options_other, _L("Auto Bed Leveling"),
928 _L("Check heatbed flatness. Leveling makes extruded height uniform.\n*Automatic mode: Level first (about 10 seconds). Skip if surface is fine."),
929 ops_auto, "bed_leveling");
930
931
932 auto option_nozzle_offset_cali_cali =
933 new PrintOption(m_options_other, _L("Nozzle Offset Calibration"),
934 _L("Calibrate nozzle offsets to enhance print quality.\n*Automatic mode: Check for calibration before printing; skip if unnecessary."), ops_auto);
935
936 auto option_use_ams = new PrintOption(m_options_other, _L("Use AMS"), wxEmptyString, ops_no_auto);
937
938 option_use_ams->setValue("on");
939 m_sizer_options_timelapse->Add(option_timelapse, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
940 m_sizer_options_other->Add(option_use_ams, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
941 m_sizer_options_other->Add(option_auto_bed_level, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
942 m_sizer_options_other->Add(option_nozzle_offset_cali_cali, 0, wxEXPAND | wxBOTTOM, FromDIP(5));
943
945 m_options_other->SetMaxSize(wxSize(-1, FromDIP(0)));
946 m_checkbox_list["timelapse"] = option_timelapse;
947 m_checkbox_list["bed_leveling"] = option_auto_bed_level;
948 m_checkbox_list["use_ams"] = option_use_ams;
949 m_checkbox_list["nozzle_offset_cali"] = option_nozzle_offset_cali_cali;
950
951 option_timelapse->Hide();
952 option_auto_bed_level->Hide();
953 option_nozzle_offset_cali_cali->Hide();
954 option_use_ams->Hide();
955
956 // m_sizer_main->Add(m_sizer_mode_switch, 0, wxALIGN_CENTER, 0);
957 // m_sizer_main->Add(m_basic_panel, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(15));
958 //m_sizer_main->Add(sizer_split_filament, 1, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(15));
959 m_sizer_main->Add(m_filament_panel, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(15));
960 m_sizer_main->Add(m_fix_filament_panel, 0, wxALIGN_CENTER | wxLEFT | wxRIGHT, FromDIP(15));
961 m_fix_filament_panel->Show(false);
962 m_sizer_main->Add(m_sizer_filament_2extruder, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(15));
963
964
965
966 {//new content//tip confirm ok button
967 wxBoxSizer *tip_sizer = new wxBoxSizer(wxHORIZONTAL);
968 m_attention_text = new wxStaticText(m_scrolledWindow, wxID_ANY, _L("Tip") + ": ");
970 m_attention_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#009688"))); // ORCA match label colors
971 tip_sizer->Add(m_attention_text, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
972 m_tip_attention_color_map = _L("Only synchronize filament type and color, not including AMS slot information.");
973 m_tip_attention_override = _L("Replace the project filaments list sequentially based on printer filaments. And unused printer filaments will be automatically added to the end of the list.");
975 m_tip_text->SetMinSize(wxSize(SyncAttentionTipWidth, -1));
976 m_tip_text->SetMaxSize(wxSize(SyncAttentionTipWidth, -1));
977 m_tip_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
978 tip_sizer->Add(m_tip_text, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
979 tip_sizer->AddSpacer(FromDIP(20));
980 bSizer->Add(tip_sizer, 0, wxEXPAND | wxLEFT, FromDIP(25));
981
983
984 wxBoxSizer * more_setting_sizer = new wxBoxSizer(wxVERTICAL);
985
986 m_advace_setting_sizer = new wxBoxSizer(wxHORIZONTAL);
987 m_more_setting_tips = new wxStaticText(m_scrolledWindow, wxID_ANY, _L("Advanced settings"));
988 m_more_setting_tips->SetFont(::Label::Head_14); // ORCA
989 m_more_setting_tips->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
990 m_more_setting_tips->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
992 update_more_setting(true,true);
993 });
994
995 m_advace_setting_sizer->Add(m_more_setting_tips, 0, wxALIGN_LEFT | wxTOP, FromDIP(4));
996 m_advanced_options_icon = new wxStaticBitmap(m_scrolledWindow, wxID_ANY, create_scaled_bitmap("advanced_option3", m_scrolledWindow, 18), wxDefaultPosition,
997 wxSize(FromDIP(18), FromDIP(18)));
998 m_advace_setting_sizer->Add(m_advanced_options_icon, 0, wxALIGN_LEFT | wxTOP, FromDIP(4));
999 more_setting_sizer->Add(m_advace_setting_sizer, 0, wxALIGN_LEFT, FromDIP(0));
1000
1001 m_append_color_sizer = new wxBoxSizer(wxHORIZONTAL);
1002 m_append_color_sizer->AddSpacer(FromDIP(10));
1003
1004 m_append_color_checkbox = new ::CheckBox(m_scrolledWindow, wxID_ANY);
1005 //m_append_color_checkbox->SetForegroundColour(wxColour(107, 107, 107, 100));
1006 m_append_color_checkbox->SetValue(wxGetApp().app_config->get_bool("enable_append_color_by_sync_ams"));
1007 m_append_color_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &e) {
1008 auto flag = wxGetApp().app_config->get_bool("enable_append_color_by_sync_ams");
1009 wxGetApp().app_config->set_bool("enable_append_color_by_sync_ams",!flag);
1010 m_append_color_checkbox->SetValue(!flag);
1011 e.Skip();
1012 });
1014 m_append_color_sizer->Add(m_append_color_checkbox, 0, wxALIGN_LEFT | wxTOP, FromDIP(4));
1015 const int gap_between_checebox_and_text = 2;
1016 m_append_color_text = new Label(m_scrolledWindow, _L("Add unused AMS filaments to filaments list."));
1017 m_append_color_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
1018 m_append_color_text->Hide();
1019 m_append_color_sizer->AddSpacer(FromDIP(gap_between_checebox_and_text));
1020 m_append_color_sizer->Add(m_append_color_text, 0, wxALIGN_LEFT | wxTOP, FromDIP(4));
1021
1022 more_setting_sizer->Add(m_append_color_sizer, 0, wxALIGN_LEFT | wxTOP, FromDIP(4));
1023
1024 m_merge_color_sizer = new wxBoxSizer(wxHORIZONTAL);
1025 m_merge_color_sizer->AddSpacer(FromDIP(10));
1026 m_merge_color_checkbox = new ::CheckBox(m_scrolledWindow, wxID_ANY);
1027 //m_merge_color_checkbox->SetForegroundColour(wxColour(107, 107, 107, 100));
1028 m_merge_color_checkbox->SetValue(wxGetApp().app_config->get_bool("enable_merge_color_by_sync_ams"));
1029 m_merge_color_checkbox->Bind(wxEVT_TOGGLEBUTTON, [this](wxCommandEvent &e) {
1030 auto flag = wxGetApp().app_config->get_bool("enable_merge_color_by_sync_ams");
1031 wxGetApp().app_config->set_bool("enable_merge_color_by_sync_ams",!flag);
1032 m_merge_color_checkbox->SetValue(!flag);
1033 e.Skip();
1034 });
1035 m_merge_color_checkbox->Hide();
1036 m_merge_color_sizer->Add(m_merge_color_checkbox, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
1037
1038
1039 m_merge_color_text = new Label(m_scrolledWindow, _L("Automatically merge the same colors in the model after mapping."));
1040 m_merge_color_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
1041 m_merge_color_text->Hide();
1042 m_merge_color_sizer->AddSpacer(FromDIP(gap_between_checebox_and_text));
1043 m_merge_color_sizer->Add(m_merge_color_text, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
1044
1045 more_setting_sizer->Add(m_merge_color_sizer, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
1046
1047 bSizer->Add(more_setting_sizer, 0, wxEXPAND | wxLEFT, FromDIP(25));
1048
1049 wxBoxSizer *confirm_boxsizer = new wxBoxSizer(wxVERTICAL);
1050
1051 m_override_undone_str = _L("After being synced, this action cannot be undone.");
1052 m_undone_str = _L("After being synced, the project's filament presets and colors will be replaced with the mapped filament types and colors. This action cannot be undone.");
1054 m_confirm_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
1055 m_confirm_title->SetMinSize(wxSize(SyncLabelWidth, -1));
1056 m_confirm_title->SetMaxSize(wxSize(SyncLabelWidth, -1));
1057 confirm_boxsizer->Add(m_confirm_title, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP | wxRIGHT | wxBOTTOM, FromDIP(10));
1058 m_are_you_sure_title = new wxStaticText(m_scrolledWindow, wxID_ANY, _L("Are you sure to synchronize the filaments?"));
1059 m_are_you_sure_title->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
1060 //m_are_you_sure_title->SetFont(Label::Head_14);
1061 confirm_boxsizer->Add(m_are_you_sure_title, 0, wxALIGN_LEFT | wxTOP, FromDIP(0));
1062 bSizer->Add(confirm_boxsizer, 0, wxALIGN_LEFT | wxLEFT , FromDIP(25));
1063
1064 wxBoxSizer *warning_sizer = new wxBoxSizer(wxHORIZONTAL);
1065 m_warning_text = new wxStaticText(m_scrolledWindow, wxID_ANY, _L("Error") + ":");
1066 m_warning_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
1067 m_warning_text->Hide();
1068 warning_sizer->Add(m_warning_text, 0, wxALIGN_CENTER | wxTOP, FromDIP(2));
1069 bSizer->Add(warning_sizer, 0, wxEXPAND | wxLEFT, FromDIP(25));
1070
1071 m_scrolledWindow->SetSizerAndFit(m_sizer_main);
1072 m_sizer_show_page->Add(m_scrolledWindow, 1, wxEXPAND, 0);
1073
1074 auto* dlg_btns = new DialogButtons(m_show_page, {"OK", "Cancel"});
1075 m_button_ok = dlg_btns->GetOK();
1076 m_button_ok->SetLabel(_L("Synchronize now"));
1077 m_button_ok->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) {
1078 deal_ok();
1079 EndModal(wxID_YES);
1080 SetFocusIgnoringChildren();
1081 });
1082
1083 m_button_cancel = dlg_btns->GetCANCEL();
1084 m_button_cancel->SetLabel(m_input_info.cancel_text_to_later ? _L("Later") : _L("Cancel"));
1085 m_button_cancel->Bind(wxEVT_COMMAND_BUTTON_CLICKED, [this](wxCommandEvent &e) {
1086 EndModal(wxID_CANCEL);
1087 });
1088
1089 m_sizer_show_page->Add(dlg_btns, 0, wxEXPAND);
1090 m_show_page->SetSizer(m_sizer_show_page);
1091 }
1093 m_sizer_this->Add(m_pages, 0, wxEXPAND, FromDIP(0));
1094 SetSizer(m_sizer_this);
1095 Layout();
1096 Fit();
1097 Thaw();
1098
1099 init_bind();
1100 init_timer();
1101 //Centre(wxBOTH);
1102 wxGetApp().UpdateDlgDarkUI(this);
1103}
#define LB_AUTO_WRAP
Definition Label.hpp:12
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
#define SyncLabelWidth
Definition SyncAmsInfoDialog.cpp:96
#define SyncAmsInfoDialogWidth
Definition SyncAmsInfoDialog.cpp:92
#define SYNC_FLEX_GRID_COL
Definition SyncAmsInfoDialog.cpp:102
#define SyncAmsInfoDialogHeightMAX
Definition SyncAmsInfoDialog.cpp:95
#define SyncAttentionTipWidth
Definition SyncAmsInfoDialog.cpp:97
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_13
Definition Label.hpp:46
static wxFont Head_14
Definition Label.hpp:45
const wxFont & normal_font() const
Definition GUI_Utils.hpp:205
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305
static std::vector< wxString > MACHINE_BED_TYPE_STRING
Definition SelectMachine.hpp:468
static void init_machine_bed_types()
Definition SelectMachine.cpp:186
wxBoxSizer * sizer_advanced_options_title
Definition SyncAmsInfoDialog.hpp:323
void deal_ok()
Definition SyncAmsInfoDialog.cpp:253
wxBoxSizer * m_sizer_options_timelapse
Definition SyncAmsInfoDialog.hpp:92
CapsuleButton * m_colormap_btn
Definition SyncAmsInfoDialog.hpp:333
wxPanel * m_options_other
Definition SyncAmsInfoDialog.hpp:91
Plater * m_plater
Definition SyncAmsInfoDialog.hpp:90
wxBoxSizer * m_filament_panel_right_sizer
Definition SyncAmsInfoDialog.hpp:163
wxBoxSizer * m_sizer_filament_2extruder
Definition SyncAmsInfoDialog.hpp:164
wxBoxSizer * m_basicl_sizer
Definition SyncAmsInfoDialog.hpp:100
SyncInfo m_input_info
Definition SyncAmsInfoDialog.hpp:304
wxStaticText * m_are_you_sure_title
Definition SyncAmsInfoDialog.hpp:327
ScalableButton * m_reset_all_btn
Definition SyncAmsInfoDialog.hpp:335
wxBoxSizer * m_advace_setting_sizer
Definition SyncAmsInfoDialog.hpp:336
wxColour m_colour_def_color
Definition SyncAmsInfoDialog.hpp:62
Label * m_append_color_text
Definition SyncAmsInfoDialog.hpp:341
wxPanel * m_loading_page
Definition SyncAmsInfoDialog.hpp:171
wxPanel * m_show_page
Definition SyncAmsInfoDialog.hpp:172
wxString m_tip_attention_override
Definition SyncAmsInfoDialog.hpp:313
wxBoxSizer * m_sizer_options_other
Definition SyncAmsInfoDialog.hpp:93
wxSimplebook * m_pages
Definition SyncAmsInfoDialog.hpp:170
std::vector< POItem > ops_auto
Definition SyncAmsInfoDialog.hpp:81
wxBoxSizer * m_filament_panel_left_sizer
Definition SyncAmsInfoDialog.hpp:162
Label * m_confirm_title
Definition SyncAmsInfoDialog.hpp:324
AmsMapingPopup m_mapping_popup
Definition SyncAmsInfoDialog.hpp:86
void update_more_setting(bool layout=true, bool from_more_seting_text=false)
Definition SyncAmsInfoDialog.cpp:489
std::vector< wxString > m_bedtype_list
Definition SyncAmsInfoDialog.hpp:67
wxString m_override_undone_str
Definition SyncAmsInfoDialog.hpp:326
void check_empty_project()
Definition SyncAmsInfoDialog.cpp:1105
wxScrolledWindow * m_scrolledWindow
Definition SyncAmsInfoDialog.hpp:96
::CheckBox * m_merge_color_checkbox
Definition SyncAmsInfoDialog.hpp:343
std::map< std::string, PrintOption * > m_checkbox_list
Definition SyncAmsInfoDialog.hpp:66
wxFlexGridSizer * m_fix_sizer_ams_mapping
Definition SyncAmsInfoDialog.hpp:155
StaticBox * m_filament_panel
Definition SyncAmsInfoDialog.hpp:150
Label * m_merge_color_text
Definition SyncAmsInfoDialog.hpp:344
wxBoxSizer * m_filament_panel_sizer
Definition SyncAmsInfoDialog.hpp:161
Label * m_tip_text
Definition SyncAmsInfoDialog.hpp:314
wxGridSizer * m_sizer_ams_mapping_left
Definition SyncAmsInfoDialog.hpp:167
wxAnimationCtrl * m_gif_ctrl
Definition SyncAmsInfoDialog.hpp:174
StaticBox * m_filament_left_panel
Definition SyncAmsInfoDialog.hpp:151
StaticBox * m_filament_right_panel
Definition SyncAmsInfoDialog.hpp:152
Button * m_button_cancel
Definition SyncAmsInfoDialog.hpp:307
wxStaticText * m_warning_text
Definition SyncAmsInfoDialog.hpp:317
CapsuleButton * m_override_btn
Definition SyncAmsInfoDialog.hpp:334
wxBoxSizer * m_append_color_sizer
Definition SyncAmsInfoDialog.hpp:339
void show_print_failed_info(bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
Definition SyncAmsInfoDialog.cpp:1178
wxBoxSizer * sizer_basic_right_info
Definition SyncAmsInfoDialog.hpp:322
wxBoxSizer * m_sizer_this
Definition SyncAmsInfoDialog.hpp:98
void add_two_image_control()
Definition SyncAmsInfoDialog.cpp:532
AmsTutorialPopup m_mapping_tutorial_popup
Definition SyncAmsInfoDialog.hpp:88
wxBoxSizer * m_merge_color_sizer
Definition SyncAmsInfoDialog.hpp:342
wxFlexGridSizer * m_sizer_ams_mapping
Definition SyncAmsInfoDialog.hpp:166
bool m_expand_more_settings
Definition SyncAmsInfoDialog.hpp:348
wxGridSizer * m_sizer_ams_mapping_right
Definition SyncAmsInfoDialog.hpp:168
wxPanel * m_basic_panel
Definition SyncAmsInfoDialog.hpp:107
wxBoxSizer * m_sizer_main
Definition SyncAmsInfoDialog.hpp:97
wxPanel * m_line_top
Definition SyncAmsInfoDialog.hpp:108
wxBoxSizer * m_mode_combox_sizer
Definition SyncAmsInfoDialog.hpp:330
Label * m_text_printer_msg
Definition SyncAmsInfoDialog.hpp:111
wxStaticBitmap * m_advanced_options_icon
Definition SyncAmsInfoDialog.hpp:338
void reset_all_ams_info()
Definition SyncAmsInfoDialog.cpp:2466
void init_bind()
Definition SyncAmsInfoDialog.cpp:1151
std::vector< POItem > ops_no_auto
Definition SyncAmsInfoDialog.hpp:82
wxBoxSizer * m_fix_filament_panel_sizer
Definition SyncAmsInfoDialog.hpp:157
void update_when_change_map_mode(int)
Definition SyncAmsInfoDialog.cpp:368
wxString m_undone_str
Definition SyncAmsInfoDialog.hpp:325
wxBoxSizer * m_sizer_show_page
Definition SyncAmsInfoDialog.hpp:173
wxStaticText * m_attention_text
Definition SyncAmsInfoDialog.hpp:311
wxString m_tip_attention_color_map
Definition SyncAmsInfoDialog.hpp:312
AmsMapingTipPopup m_mapping_tip_popup
Definition SyncAmsInfoDialog.hpp:87
Button * m_button_ok
Definition SyncAmsInfoDialog.hpp:306
::CheckBox * m_append_color_checkbox
Definition SyncAmsInfoDialog.hpp:340
wxStaticText * m_more_setting_tips
Definition SyncAmsInfoDialog.hpp:337
void init_timer()
Definition SyncAmsInfoDialog.cpp:1906
StaticBox * m_fix_filament_panel
Definition SyncAmsInfoDialog.hpp:154
void on_cancel(wxCloseEvent &event)
Definition SyncAmsInfoDialog.cpp:1912
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219
wxMouseEvent
Definition CameraPopup.cpp:47
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
std::string var(const std::string &file_name)
Definition utils.cpp:278
@ 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, add_two_image_control(), Slic3r::BED_TYPE_COUNT, Label::Body_13, check_empty_project(), create_scaled_bitmap(), StateColor::darkModeColorFor(), deal_ok(), Slic3r::GUI::DPIDialog::EndModal(), Slic3r::GUI::from_u8(), Label::Head_13, Label::Head_14, init_bind(), Slic3r::GUI::SelectMachineDialog::init_machine_bed_types(), init_timer(), LB_AUTO_WRAP, m_advace_setting_sizer, m_advanced_options_icon, m_append_color_checkbox, m_append_color_sizer, m_append_color_text, m_are_you_sure_title, m_attention_text, m_basic_panel, m_basicl_sizer, m_bedtype_list, m_button_cancel, m_button_ok, m_checkbox_list, m_colormap_btn, m_colour_def_color, m_confirm_title, m_expand_more_settings, 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_fix_filament_panel, m_fix_filament_panel_sizer, m_fix_sizer_ams_mapping, m_gif_ctrl, m_input_info, m_line_top, m_loading_page, m_mapping_popup, m_mapping_tip_popup, m_mapping_tutorial_popup, m_merge_color_checkbox, m_merge_color_sizer, m_merge_color_text, m_mode_combox_sizer, m_more_setting_tips, m_options_other, m_override_btn, m_override_undone_str, m_pages, m_plater, m_reset_all_btn, m_scrolledWindow, m_show_page, m_sizer_ams_mapping, m_sizer_ams_mapping_left, m_sizer_ams_mapping_right, m_sizer_filament_2extruder, m_sizer_main, m_sizer_options_other, m_sizer_options_timelapse, m_sizer_show_page, m_sizer_this, m_text_printer_msg, m_tip_attention_color_map, m_tip_attention_override, m_tip_text, m_undone_str, m_warning_text, Slic3r::GUI::SelectMachineDialog::MACHINE_BED_TYPE_STRING, Slic3r::GUI::DPIAware< wxDialog >::normal_font(), on_cancel(), ops_auto, ops_no_auto, ptColorMap, ptOverride, reset_all_ams_info(), show_print_failed_info(), sizer_advanced_options_title, sizer_basic_right_info, SYNC_FLEX_GRID_COL, SyncAmsInfoDialogHeightMAX, SyncAmsInfoDialogWidth, SyncAttentionTipWidth, SyncLabelWidth, update_more_setting(), update_when_change_map_mode(), Slic3r::var(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Here is the call graph for this function:

◆ ~SyncAmsInfoDialog()

Slic3r::GUI::SyncAmsInfoDialog::~SyncAmsInfoDialog ( )
3265 {
3266 if (m_refresh_timer) {
3267 delete m_refresh_timer;
3268 }
3269 BOOST_LOG_TRIVIAL(error) << "~SyncAmsInfoDialog destruction";
3270}
wxTimer * m_refresh_timer
Definition SyncAmsInfoDialog.hpp:117

References m_refresh_timer.

Member Function Documentation

◆ add_two_image_control()

void Slic3r::GUI::SyncAmsInfoDialog::add_two_image_control ( )
private
533{// thumbnail
535 m_two_thumbnail_panel->SetBorderWidth(0);
536 //m_two_thumbnail_panel->SetMinSize(wxSize(FromDIP(637), -1));
537 //m_two_thumbnail_panel->SetMaxSize(wxSize(FromDIP(637), -1));
538 m_two_thumbnail_panel_sizer = new wxBoxSizer(wxVERTICAL);
539
540 auto view_two_thumbnail_sizer = new wxBoxSizer(wxHORIZONTAL);
541 view_two_thumbnail_sizer->AddSpacer(FromDIP(40));
542 auto swipe_left__sizer = new wxBoxSizer(wxVERTICAL);
543 swipe_left__sizer->AddStretchSpacer();
544 init_bitmaps();
545 m_swipe_left_button = new ScalableButton(m_two_thumbnail_panel, wxID_ANY, "previous_item", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true,
547 m_swipe_left_button->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
548 if (!m_swipe_left_button_enable) { return; }
550 });
551 m_swipe_left_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
552 if (!m_swipe_left_button_enable) { return; }
554 });
556 swipe_left__sizer->Add(m_swipe_left_button, 0, wxEXPAND);
557 swipe_left__sizer->AddStretchSpacer();
558 view_two_thumbnail_sizer->Add(swipe_left__sizer, 0, wxEXPAND);
559 view_two_thumbnail_sizer->AddSpacer(FromDIP(24));
560 {
562 m_two_image_panel->SetBorderWidth(0);
563 //m_two_image_panel->SetForegroundColour(wxColour(248, 248, 248, 100));
564 m_two_image_panel_sizer = new wxBoxSizer(wxHORIZONTAL);
565 m_left_image_button = new wxButton(m_two_image_panel, wxID_ANY, {}, wxDefaultPosition, wxSize(FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH), FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH)),
566 wxBORDER_NONE | wxBU_AUTODRAW);
568 m_two_image_panel_sizer->Add(m_left_sizer_thumbnail, FromDIP(0), wxEXPAND | wxLEFT | wxTOP | wxBOTTOM, FromDIP(8));
569 m_two_image_panel_sizer->AddSpacer(FromDIP(5));
570
571 m_right_image_button = new wxButton(m_two_image_panel, wxID_ANY, {}, wxDefaultPosition,
573 wxBORDER_NONE | wxBU_AUTODRAW);
575 m_two_image_panel_sizer->Add(m_right_sizer_thumbnail, FromDIP(0), wxEXPAND | wxRIGHT | wxTOP | wxBOTTOM, FromDIP(8));
577 m_two_image_panel->Layout();
578 m_two_image_panel->Fit();
579
580 view_two_thumbnail_sizer->Add(m_two_image_panel, FromDIP(0), wxEXPAND | wxTOP, FromDIP(2));
581 }
582 view_two_thumbnail_sizer->AddSpacer(FromDIP(20));
583 auto swipe_right__sizer = new wxBoxSizer(wxVERTICAL);
584 swipe_right__sizer->AddStretchSpacer();
585 m_swipe_right_button = new ScalableButton(m_two_thumbnail_panel, wxID_ANY, "next_item", wxEmptyString, wxDefaultSize, wxDefaultPosition, wxBU_EXACTFIT | wxNO_BORDER, true,
587 m_swipe_right_button->Bind(wxEVT_ENTER_WINDOW, [this](auto &e) {
588 if (!m_swipe_right_button_enable) { return; }
590 });
591 m_swipe_right_button->Bind(wxEVT_LEAVE_WINDOW, [this](auto &e) {
592 if (!m_swipe_right_button_enable) { return; }
594 });
595 m_swipe_right_button->Bind(wxEVT_BUTTON, &SyncAmsInfoDialog::to_next_plate, this);
596
597 swipe_right__sizer->Add(m_swipe_right_button, 0, wxEXPAND);
598 swipe_right__sizer->AddStretchSpacer();
599 view_two_thumbnail_sizer->Add(swipe_right__sizer, 0, wxEXPAND);
600 view_two_thumbnail_sizer->AddStretchSpacer();
601 m_two_thumbnail_panel_sizer->Add(view_two_thumbnail_sizer, 0, wxEXPAND | wxTOP, FromDIP(5));
602
603 m_choose_plate_sizer = new wxBoxSizer(wxHORIZONTAL);
604 m_choose_plate_sizer->AddStretchSpacer();
605
606 wxStaticText *chose_combox_title = new wxStaticText(m_two_thumbnail_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Plate", "Sync_AMS"), "Sync_AMS"));
607 m_choose_plate_sizer->Add(chose_combox_title, 0, wxEXPAND | wxTOP, FromDIP(6));
608 m_choose_plate_sizer->AddSpacer(FromDIP(10));
609
610 m_combobox_plate = new ComboBox(m_two_thumbnail_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(60), -1), 0, NULL, wxCB_READONLY);
611
612 m_combobox_plate->Bind(wxEVT_COMBOBOX, [this](auto &e) {
613 if (e.GetSelection() < m_plate_choices.size()) {
614 update_when_change_plate(m_plate_choices[e.GetSelection()]);
615 }
616 });
617 m_choose_plate_sizer->Add(m_combobox_plate, 0, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, FromDIP(3));
618 m_choose_plate_sizer->AddStretchSpacer();
619 m_two_thumbnail_panel_sizer->Add(m_choose_plate_sizer, 0, wxEXPAND |wxTOP, FromDIP(4));
620
622 m_two_thumbnail_panel->Layout();
624 m_sizer_main->Add(m_two_thumbnail_panel, FromDIP(0), wxEXPAND | wxLEFT | wxRIGHT, FromDIP(25));
625
627}
#define L_CONTEXT(s, context)
Definition DesignOffer.hpp:17
class WXDLLIMPEXP_FWD_CORE wxButton
Definition ProgressDialog.hpp:27
void to_previous_plate(wxCommandEvent &event)
Definition SyncAmsInfoDialog.cpp:639
void to_next_plate(wxCommandEvent &event)
Definition SyncAmsInfoDialog.cpp:629
bool m_swipe_left_button_enable
Definition SyncAmsInfoDialog.hpp:140
void update_when_change_plate(int)
Definition SyncAmsInfoDialog.cpp:355
StaticBox * m_two_image_panel
Definition SyncAmsInfoDialog.hpp:129
StaticBox * m_two_thumbnail_panel
Definition SyncAmsInfoDialog.hpp:131
void init_bitmaps()
Definition SyncAmsInfoDialog.cpp:513
wxBoxSizer * m_right_sizer_thumbnail
Definition SyncAmsInfoDialog.hpp:319
wxBoxSizer * create_sizer_thumbnail(wxButton *image_button, bool left)
Definition SyncAmsInfoDialog.cpp:334
wxBoxSizer * m_two_image_panel_sizer
Definition SyncAmsInfoDialog.hpp:130
ScalableBitmap m_swipe_right_bmp_normal
Definition SyncAmsInfoDialog.hpp:147
ComboBox * m_combobox_plate
Definition SyncAmsInfoDialog.hpp:134
void update_swipe_button_state()
Definition SyncAmsInfoDialog.cpp:649
const int RIGHT_THUMBNAIL_SIZE_WIDTH
Definition SyncAmsInfoDialog.hpp:351
ScalableButton * m_swipe_left_button
Definition SyncAmsInfoDialog.hpp:138
ScalableButton * m_swipe_right_button
Definition SyncAmsInfoDialog.hpp:139
wxBoxSizer * m_left_sizer_thumbnail
Definition SyncAmsInfoDialog.hpp:318
int m_bmp_pix_cont
Definition SyncAmsInfoDialog.hpp:142
ScalableBitmap m_swipe_left_bmp_normal
Definition SyncAmsInfoDialog.hpp:144
wxBoxSizer * m_choose_plate_sizer
Definition SyncAmsInfoDialog.hpp:133
wxButton * m_right_image_button
Definition SyncAmsInfoDialog.hpp:321
wxBoxSizer * m_two_thumbnail_panel_sizer
Definition SyncAmsInfoDialog.hpp:132
std::vector< int > m_plate_choices
Definition SyncAmsInfoDialog.hpp:137
ScalableBitmap m_swipe_right_bmp_hover
Definition SyncAmsInfoDialog.hpp:148
const int LEFT_THUMBNAIL_SIZE_WIDTH
Definition SyncAmsInfoDialog.hpp:350
bool m_swipe_right_button_enable
Definition SyncAmsInfoDialog.hpp:141
wxButton * m_left_image_button
Definition SyncAmsInfoDialog.hpp:320
ScalableBitmap m_swipe_left_bmp_hover
Definition SyncAmsInfoDialog.hpp:145
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _L_CONTEXT, create_sizer_thumbnail(), init_bitmaps(), L_CONTEXT, LEFT_THUMBNAIL_SIZE_WIDTH, m_bmp_pix_cont, m_choose_plate_sizer, m_combobox_plate, m_left_image_button, m_left_sizer_thumbnail, m_plate_choices, m_right_image_button, m_right_sizer_thumbnail, m_scrolledWindow, m_sizer_main, m_swipe_left_bmp_hover, m_swipe_left_bmp_normal, m_swipe_left_button, m_swipe_left_button_enable, m_swipe_right_bmp_hover, m_swipe_right_bmp_normal, m_swipe_right_button, m_swipe_right_button_enable, m_two_image_panel, m_two_image_panel_sizer, m_two_thumbnail_panel, m_two_thumbnail_panel_sizer, RIGHT_THUMBNAIL_SIZE_WIDTH, to_next_plate(), to_previous_plate(), update_swipe_button_state(), update_when_change_plate(), wxButton, and wxStaticText.

Referenced by SyncAmsInfoDialog().

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

◆ adjust_color_for_render()

wxColour Slic3r::GUI::SyncAmsInfoDialog::adjust_color_for_render ( const wxColour & color)
3072{
3073 Slic3r::ColorRGBA _temp_color_color = {color.Red() / 255.0f, color.Green() / 255.0f, color.Blue() / 255.0f, color.Alpha() / 255.0f};
3074 auto _temp_color_color_ = adjust_color_for_rendering(_temp_color_color);
3075 wxColour render_color((int) (_temp_color_color_[0] * 255.0f), (int) (_temp_color_color_[1] * 255.0f), (int) (_temp_color_color_[2] * 255.0f),
3076 (int) (_temp_color_color_[3] * 255.0f));
3077 return render_color;
3078}
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::SyncAmsInfoDialog::auto_supply_with_ext ( std::vector< DevAmsTray > slots)
1524{
1525 if (slots.size() <= 0) return;
1526
1527 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1528 auto it = m_ams_mapping_result[i];
1529 if (it.ams_id == "") {
1530 DevAmsTray slot("");
1531 if (m_filaments_map[it.id] == 1 && slots.size() > 1)
1532 slot = slots[1];
1533 else if (m_filaments_map[it.id] == 2)
1534 slot = slots[0];
1535 if (slot.id.empty()) continue;
1536 m_ams_mapping_result[i].ams_id = slot.id;
1537 m_ams_mapping_result[i].color = slot.color;
1538 m_ams_mapping_result[i].type = slot.m_fila_type;
1539 m_ams_mapping_result[i].colors = slot.cols;
1540 m_ams_mapping_result[i].tray_id = atoi(slot.id.c_str());
1541 m_ams_mapping_result[i].slot_id = "0";
1542 }
1543 }
1544}
std::vector< int > m_filaments_map
Definition SyncAmsInfoDialog.hpp:72
std::vector< FilamentInfo > m_ams_mapping_result
Definition SyncAmsInfoDialog.hpp:70

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::SyncAmsInfoDialog::build_nozzles_info ( std::string & nozzles_info)
1482{
1483 /* init nozzles info */
1484 json nozzle_info_json = json::array();
1485 nozzles_info = nozzle_info_json.dump();
1486
1487 PresetBundle *preset_bundle = wxGetApp().preset_bundle;
1488 if (!preset_bundle) return false;
1489 auto opt_nozzle_diameters = preset_bundle->printers.get_edited_preset().config.option<ConfigOptionFloats>("nozzle_diameter");
1490 if (opt_nozzle_diameters == nullptr) {
1491 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, opt_nozzle_diameters is nullptr";
1492 return false;
1493 }
1494 auto opt_nozzle_volume_type = preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
1495 if (opt_nozzle_volume_type == nullptr) {
1496 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, opt_nozzle_volume_type is nullptr";
1497 return false;
1498 }
1499 json nozzle_item;
1500 /* only o1d two nozzles has build_nozzles info now */
1501 if (opt_nozzle_diameters->size() != 2) { return false; }
1502 for (size_t i = 0; i < opt_nozzle_diameters->size(); i++) {
1503 if (i == (size_t) ConfigNozzleIdx::NOZZLE_LEFT) {
1504 nozzle_item["id"] = CloudTaskNozzleId::NOZZLE_LEFT;
1505 } else if (i == (size_t) ConfigNozzleIdx::NOZZLE_RIGHT) {
1506 nozzle_item["id"] = CloudTaskNozzleId::NOZZLE_RIGHT;
1507 } else {
1508 /* unknown ConfigNozzleIdx */
1509 BOOST_LOG_TRIVIAL(error) << "build_nozzles_info, unknown ConfigNozzleIdx = " << i;
1510 assert(false);
1511 continue;
1512 }
1513 nozzle_item["type"] = nullptr;
1514 if (i >= 0 && i < opt_nozzle_volume_type->size()) { nozzle_item["flowSize"] = get_nozzle_volume_type_cloud_string((NozzleVolumeType) opt_nozzle_volume_type->get_at(i)); }
1515 if (i >= 0 && i < opt_nozzle_diameters->size()) { nozzle_item["diameter"] = opt_nozzle_diameters->get_at(i); }
1516 nozzle_info_json.push_back(nozzle_item);
1517 }
1518 nozzles_info = nozzle_info_json.dump();
1519 return true;
1520}
@ 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.

Here is the call graph for this function:

◆ change_default_normal()

void Slic3r::GUI::SyncAmsInfoDialog::change_default_normal ( int old_filament_id,
wxColour temp_ams_color )
3201{
3202 if (m_cur_colors_in_thumbnail.size() == 0) {
3203 BOOST_LOG_TRIVIAL(error) << "SyncAmsInfoDialog::change_default_normal:error:m_cur_colors_in_thumbnail.size() == 0";
3204 return;
3205 }
3206 if (old_filament_id >= 0) {
3207 if (old_filament_id < m_cur_colors_in_thumbnail.size()) {
3208 m_cur_colors_in_thumbnail[old_filament_id] = temp_ams_color;
3209 } else {
3210 BOOST_LOG_TRIVIAL(error) << "SyncAmsInfoDialog::change_default_normal:error:old_filament_id > m_cur_colors_in_thumbnail.size()";
3211 return;
3212 }
3213 }
3214 // Recompute mixed slot colors after physical slot color change
3215 const auto& cfg = wxGetApp().preset_bundle->project_config;
3217
3218 ThumbnailData &data = m_cur_input_thumbnail_data;
3219 ThumbnailData &no_light_data = m_cur_no_light_thumbnail_data;
3220 if (data.width > 0 && data.height > 0 && data.width == no_light_data.width && data.height == no_light_data.height) {
3221 for (unsigned int r = 0; r < data.height; ++r) {
3222 unsigned int rr = (data.height - 1 - r) * data.width;
3223 for (unsigned int c = 0; c < data.width; ++c) {
3224 unsigned char *no_light_px = (unsigned char *) no_light_data.pixels.data() + 4 * (rr + c);
3225 unsigned char *origin_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
3226 unsigned char *new_px = (unsigned char *) m_preview_thumbnail_data.pixels.data() + 4 * (rr + c);
3227 if (origin_px[3] > 0 && m_edge_pixels[r * data.width + c] == false) {
3228 auto filament_id = 255 - no_light_px[3];
3229 if (filament_id >= m_cur_colors_in_thumbnail.size()) { continue; }
3230 wxColour temp_ams_color_in_loop = m_cur_colors_in_thumbnail[filament_id];
3231 wxColour ams_color = adjust_color_for_render(temp_ams_color_in_loop);
3232 // change color
3233 new_px[3] = ams_color.Alpha(); //origin_px[3]; // alpha
3234 int origin_rgb = origin_px[0] + origin_px[1] + origin_px[2];
3235 int no_light_px_rgb = no_light_px[0] + no_light_px[1] + no_light_px[2];
3236 unsigned char i = 0;
3237 if (origin_rgb >= no_light_px_rgb) { // Brighten up
3238 unsigned char cur_single_color = ams_color.Red();
3239 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
3240 i++;
3241 cur_single_color = ams_color.Green();
3242 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
3243 i++;
3244 cur_single_color = ams_color.Blue();
3245 new_px[i] = std::clamp(cur_single_color + (origin_px[i] - no_light_px[i]), 0, 255);
3246 } else { // Dimming
3247 float ratio = origin_rgb / (float) no_light_px_rgb;
3248 unsigned char cur_single_color = ams_color.Red();
3249 new_px[i] = std::clamp((int) (cur_single_color * ratio), 0, 255);
3250 i++;
3251 cur_single_color = ams_color.Green();
3252 new_px[i] = std::clamp((int) (cur_single_color * ratio), 0, 255);
3253 i++;
3254 cur_single_color = ams_color.Blue();
3255 new_px[i] = std::clamp((int) (cur_single_color * ratio), 0, 255);
3256 }
3257 }
3258 }
3259 }
3260 } else {
3261 BOOST_LOG_TRIVIAL(error) << "SyncAmsInfoDialog::change_defa:no_light_data is empty,error";
3262 }
3263}
std::vector< bool > m_edge_pixels
Definition SyncAmsInfoDialog.hpp:127
wxColour adjust_color_for_render(const wxColour &color)
Definition SyncAmsInfoDialog.cpp:3071
std::vector< wxColour > m_cur_colors_in_thumbnail
Definition SyncAmsInfoDialog.hpp:125
ThumbnailData m_cur_no_light_thumbnail_data
Definition SyncAmsInfoDialog.hpp:122
ThumbnailData m_preview_thumbnail_data
Definition SyncAmsInfoDialog.hpp:123
ThumbnailData m_cur_input_thumbnail_data
Definition SyncAmsInfoDialog.hpp:121
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:

◆ check_empty_project()

void Slic3r::GUI::SyncAmsInfoDialog::check_empty_project ( )
1106{
1107 GUI::PartPlateList &plate_list = wxGetApp().plater()->get_partplate_list();
1108 GUI::PartPlate * curr_plate = GUI::wxGetApp().plater()->get_partplate_list().get_selected_plate();
1109 m_is_empty_project = true;
1111 m_plate_choices.clear();
1112
1113 for (size_t i = 0; i < plate_list.get_plate_count(); i++) {
1114 auto temp_plate = GUI::wxGetApp().plater()->get_partplate_list().get_plate(i);
1115 if (!temp_plate->get_objects_on_this_plate().empty()) {
1116 if (m_is_empty_project) { m_is_empty_project = false; }
1117 if (i < 9) {
1118 m_plate_number_choices_str.Add(wxString("0") + std::to_wstring(i + 1));
1119 }
1120 else if (i == 9) {
1122 }
1123 else {
1124 m_plate_number_choices_str.Add(std::to_wstring(i + 1));
1125 }
1126 m_plate_choices.emplace_back(i);
1127 }
1128 }
1129 if (!m_is_empty_project) {
1130 m_specify_plate_idx = GUI::wxGetApp().plater()->get_partplate_list().get_curr_plate_index();
1131 bool not_exist = std::find(m_plate_choices.begin(), m_plate_choices.end(), m_specify_plate_idx) == m_plate_choices.end();
1132 if (not_exist) {
1134 }
1135 }
1136}
bool m_is_empty_project
Definition SyncAmsInfoDialog.hpp:345
wxArrayString m_plate_number_choices_str
Definition SyncAmsInfoDialog.hpp:136
int m_specify_plate_idx
Definition SyncAmsInfoDialog.hpp:352

References Slic3r::GUI::PartPlateList::get_plate_count(), m_is_empty_project, m_plate_choices, m_plate_number_choices_str, and m_specify_plate_idx.

Referenced by SyncAmsInfoDialog(), and is_need_show().

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

◆ check_fcous_state()

void Slic3r::GUI::SyncAmsInfoDialog::check_fcous_state ( wxWindow * window)
1184{
1185 auto children = window->GetChildren();
1186 for (auto child : children) { check_fcous_state(child); }
1187}
void check_fcous_state(wxWindow *window)
Definition SyncAmsInfoDialog.cpp:1183

References check_fcous_state().

Referenced by check_fcous_state(), and init_bind().

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

◆ clone_thumbnail_data()

void Slic3r::GUI::SyncAmsInfoDialog::clone_thumbnail_data ( )
2977{
2978 // record preview_colors
2979 if (m_preview_colors_in_thumbnail.empty()) {
2980 MaterialHash::iterator iter = m_materialList.begin();
2981 if (m_preview_colors_in_thumbnail.size() != m_materialList.size()) {
2983 }
2984 while (iter != m_materialList.end()) {
2985 int id = iter->first;
2986 Material *item = iter->second;
2987 if (item) {
2988 auto m = item->item;
2989 if (m) {
2990 // exist empty or unrecognized type ams in machine
2991 if (item->id >= m_cur_colors_in_thumbnail.size()) {
2992 m_cur_colors_in_thumbnail.resize(item->id + 1);
2993 }
2994 if (item->id >= m_preview_colors_in_thumbnail.size()) {
2995 m_preview_colors_in_thumbnail.resize(item->id + 1);
2996 }
2997
2998 if (m->m_ams_name == "-") {
2999 m_cur_colors_in_thumbnail[item->id] = m->m_material_coloul;
3000 } else {
3001 m_cur_colors_in_thumbnail[item->id] = m->m_ams_coloul;
3002 }
3003 m_preview_colors_in_thumbnail[item->id] = m->m_material_coloul;
3004 }
3005 }
3006 else {
3007 BOOST_LOG_TRIVIAL(error) << "check error:SyncAmsInfoDialog::clone_thumbnail_data:item is nullptr";
3008 }
3009 iter++;
3010 }
3011 }
3012
3013 // Expand color arrays to cover mixed (virtual) slots and compute their blended colors
3014 const auto& cfg = wxGetApp().preset_bundle->project_config;
3015 size_t total = 0;
3016 if (auto* opt = cfg.option<ConfigOptionBools>("filament_is_mixed"))
3017 total = opt->values.size();
3018 size_t target = std::max(total, m_cur_colors_in_thumbnail.size());
3019 if (m_cur_colors_in_thumbnail.size() < target)
3020 m_cur_colors_in_thumbnail.resize(target);
3021 if (m_preview_colors_in_thumbnail.size() < target)
3022 m_preview_colors_in_thumbnail.resize(target);
3025
3026 // copy data
3027 auto &data = m_cur_input_thumbnail_data;
3029 m_preview_thumbnail_data.set(data.width, data.height);
3030 if (data.width > 0 && data.height > 0) {
3031 for (unsigned int r = 0; r < data.height; ++r) {
3032 unsigned int rr = (data.height - 1 - r) * data.width;
3033 for (unsigned int c = 0; c < data.width; ++c) {
3034 unsigned char *origin_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
3035 unsigned char *new_px = (unsigned char *) m_preview_thumbnail_data.pixels.data() + 4 * (rr + c);
3036 for (size_t i = 0; i < 4; i++) { new_px[i] = origin_px[i]; }
3037 }
3038 }
3039 }
3040 // record_edge_pixels_data
3042}
void record_edge_pixels_data()
Definition SyncAmsInfoDialog.cpp:3044
MaterialHash m_materialList
Definition SyncAmsInfoDialog.hpp:89
std::vector< wxColour > m_preview_colors_in_thumbnail
Definition SyncAmsInfoDialog.hpp:124
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:2066

References Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, m_cur_colors_in_thumbnail, m_cur_input_thumbnail_data, 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::SyncAmsInfoDialog::convert_filament_map_nozzle_id_to_task_nozzle_id ( int nozzle_id)
1627{
1628 if (nozzle_id == (int) FilamentMapNozzleId::NOZZLE_LEFT) {
1629 return (int) CloudTaskNozzleId::NOZZLE_LEFT;
1630 } else if (nozzle_id == (int) FilamentMapNozzleId::NOZZLE_RIGHT) {
1632 } else {
1633 /* unsupported nozzle id */
1634 assert(false);
1635 return nozzle_id;
1636 }
1637}
@ 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:

◆ create_sizer_thumbnail()

wxBoxSizer * Slic3r::GUI::SyncAmsInfoDialog::create_sizer_thumbnail ( wxButton * image_button,
bool left )
private
335{
336 auto sizer_thumbnail = new wxBoxSizer(wxVERTICAL);
337 if (left) {
338 wxBoxSizer *text_sizer = new wxBoxSizer(wxHORIZONTAL);
339 auto sync_text = new Label(image_button->GetParent(), _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS"));
340 sync_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
341 text_sizer->Add(sync_text, 0, wxALIGN_CENTER | wxALL, 0);
342 sizer_thumbnail->Add(sync_text, FromDIP(0), wxALIGN_CENTER | wxALL, FromDIP(4));
343 }
344 else {
345 wxBoxSizer *text_sizer = new wxBoxSizer(wxHORIZONTAL);
346 m_after_map_text = new Label(image_button->GetParent(), _L("After mapping"));
347 m_after_map_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
348 text_sizer->Add(m_after_map_text, 0, wxALIGN_CENTER | wxALL, 0);
349 sizer_thumbnail->Add(m_after_map_text, FromDIP(0), wxALIGN_CENTER | wxALL, FromDIP(4));
350 }
351 sizer_thumbnail->Add(image_button, 0, wxALIGN_CENTER, 0);
352 return sizer_thumbnail;
353}
Label * m_after_map_text
Definition SyncAmsInfoDialog.hpp:310

References _L, _L_CONTEXT, StateColor::darkModeColorFor(), L_CONTEXT, m_after_map_text, and wxButton.

Referenced by add_two_image_control().

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

◆ deal_ok()

void Slic3r::GUI::SyncAmsInfoDialog::deal_ok ( )
254{
255 if (!m_is_empty_project) {
256 if (m_map_mode == MapModeEnum::Override || !m_result.is_same_printer) {
257 m_is_empty_project = true;
258 m_result.direct_sync = true;
259 return;
260 }
261 m_result.direct_sync = false;
262 m_result.sync_maps.clear();
263 for (size_t i = 0; i < m_ams_mapping_result.size(); i++) {
264 auto temp_idx = m_ams_mapping_result[i].id;
265 if (temp_idx >= 0) {
266 auto &temp = m_result.sync_maps[temp_idx];
267 temp.ams_id = m_ams_mapping_result[i].ams_id;
268 temp.slot_id = m_ams_mapping_result[i].slot_id;
269 }
270 else{
271 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "check error: m_result.sync_maps:" << temp_idx;
272 }
273 }
274 }
275}
SyncResult m_result
Definition SyncAmsInfoDialog.hpp:305
@ Override
Definition SyncAmsInfoDialog.hpp:357
MapModeEnum m_map_mode
Definition SyncAmsInfoDialog.hpp:359

References m_ams_mapping_result, m_is_empty_project, m_map_mode, m_result, and Override.

Referenced by SyncAmsInfoDialog().

Here is the caller graph for this function:

◆ deal_only_exist_ext_spool()

void Slic3r::GUI::SyncAmsInfoDialog::deal_only_exist_ext_spool ( MachineObject * obj_)
1361 {
1362 if (!obj_)
1363 return;
1364 if (!m_append_color_text) { return; }
1365 bool only_exist_ext_spool_flag = m_only_exist_ext_spool_flag = !obj_->GetFilaSystem()->HasAms();
1366 SetTitle(only_exist_ext_spool_flag ? _L("Synchronize Filament Information") : _L("Synchronize AMS Filament Information"));
1367 m_append_color_text->SetLabel(only_exist_ext_spool_flag ? _L("Add unused filaments to filaments list.") :
1368 _L("Add unused AMS filaments to filaments list."));
1370 m_tip_attention_color_map = only_exist_ext_spool_flag ? _L("Only synchronize filament type and color, not including slot information.") :
1371 _L("Only synchronize filament type and color, not including AMS slot information.");
1373
1374 }
1376 m_ams_or_ext_text_in_colormap->SetLabel((only_exist_ext_spool_flag ? _L("Ext spool") : _L("AMS")) + ":");
1377 }
1379 m_ams_or_ext_text_in_override->SetLabel((only_exist_ext_spool_flag ? _L("Ext spool") : _L("AMS")) + ":");
1380 }
1381}
wxStaticText * m_ams_or_ext_text_in_colormap
Definition SyncAmsInfoDialog.hpp:115
@ ColorMap
Definition SyncAmsInfoDialog.hpp:356
bool m_only_exist_ext_spool_flag
Definition SyncAmsInfoDialog.hpp:47
wxStaticText * m_ams_or_ext_text_in_override
Definition SyncAmsInfoDialog.hpp:116

References _L, ColorMap, Slic3r::MachineObject::GetFilaSystem(), m_ams_or_ext_text_in_colormap, m_ams_or_ext_text_in_override, m_append_color_text, m_map_mode, m_only_exist_ext_spool_flag, m_tip_attention_color_map, and m_tip_text.

Referenced by do_ams_mapping().

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

◆ decode_ams_color()

wxColour Slic3r::GUI::SyncAmsInfoDialog::decode_ams_color ( const std::string & color)
private
411 {
412 auto temp_str = color_str;
413 if (temp_str.front() == '#') {
414 temp_str = temp_str.substr(1);
415 }
416 if (temp_str.size() == 6) {
417 temp_str += "FF";
418 }
419 return DevAmsTray::decode_color(temp_str);
420}
static wxColour decode_color(const std::string &color)
Definition DevFilaSystem.cpp:38

References Slic3r::DevAmsTray::decode_color().

Referenced by generate_override_fix_ams_list(), and update_map_when_change_map_mode().

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

◆ do_ams_mapping()

bool Slic3r::GUI::SyncAmsInfoDialog::do_ams_mapping ( MachineObject * obj_)
1293{
1294 if (!obj_) return false;
1295 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " begin do_ams_mapping result";
1296 obj_->get_ams_colors(m_cur_colors_in_thumbnail);
1297 // try color and type mapping
1298
1299 const auto &full_config = wxGetApp().preset_bundle->full_config();
1300 const auto &project_config = wxGetApp().preset_bundle->project_config;
1301 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
1302 m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
1303
1304 int filament_result = 0;
1305 std::vector<bool> map_opt; // four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1306 if (nozzle_nums > 1) {
1307 map_opt = {true, true, true, true}; // four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1308 if (has_selector(obj_)) { // Orca: with a Filament Track Switch the ext spools route through the switch — don't map them
1309 map_opt[2] = false;
1310 map_opt[3] = false;
1311 }
1312 filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt, std::vector<int>(),
1313 wxGetApp().app_config->get_bool("ams_sync_match_full_use_color_dist") ? false : true);
1314 }
1315 // single nozzle
1316 else {
1317 map_opt = {false, true, false, true}; // four values: use_left_ams, use_right_ams, use_left_ext, use_right_ext
1318 filament_result = DevMappingUtil::ams_filament_mapping(obj_, m_filaments, m_ams_mapping_result, map_opt, std::vector<int>(),
1319 wxGetApp().app_config->get_bool("ams_sync_match_full_use_color_dist") ? false : true);
1320 // auto_supply_with_ext(obj_->vt_slot);
1321 }
1322
1323 if (filament_result == 0) {
1325 std::string ams_array;
1326 std::string ams_array2;
1327 std::string mapping_info;
1328 get_ams_mapping_result(ams_array, ams_array2, mapping_info);
1330 if (ams_array.empty()) {
1332 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=[]";
1333 } else {
1334 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array=" << ams_array;
1335 BOOST_LOG_TRIVIAL(info) << "ams_mapping_array2=" << ams_array2;
1336 BOOST_LOG_TRIVIAL(info) << "ams_mapping_info=" << mapping_info;
1337 }
1341 } else {
1342 BOOST_LOG_TRIVIAL(info) << "filament_result != 0";
1343 // do not support ams mapping try to use order mapping
1345 if (filament_result != 1 && !is_valid) {
1346 // reset invalid result
1347 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1348 m_ams_mapping_result[i].tray_id = -1;
1349 m_ams_mapping_result[i].distance = 99999;
1350 }
1351 }
1355 return is_valid;
1356 }
1357
1358 return true;
1359}
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
void deal_only_exist_ext_spool(MachineObject *obj_)
Definition SyncAmsInfoDialog.cpp:1361
void sync_ams_mapping_result(std::vector< FilamentInfo > &result)
Definition SyncAmsInfoDialog.cpp:1223
bool has_selector(MachineObject *obj_) const
Definition SyncAmsInfoDialog.cpp:1281
const std::vector< FilamentInfo > & get_ams_mapping_result()
Definition SyncAmsInfoDialog.hpp:248
std::vector< FilamentInfo > m_filaments
Definition SyncAmsInfoDialog.hpp:69
void reset_ams_material()
Definition SyncAmsInfoDialog.cpp:2454
void show_thumbnail_page()
Definition SyncAmsInfoDialog.cpp:1383
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(), deal_only_exist_ext_spool(), Slic3r::MachineObject::get_ams_colors(), get_ams_mapping_result(), has_selector(), Slic3r::DevMappingUtil::is_valid_mapping_result(), m_ams_mapping_result, m_cur_colors_in_thumbnail, m_filaments, m_filaments_map, Slic3r::GUI::print_ams_mapping_result(), reset_ams_material(), show_thumbnail_page(), and sync_ams_mapping_result().

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::SyncAmsInfoDialog::Enable_Auto_Refill ( bool enable)
2011{
2012 if (!m_ams_backup_tip) { return; }
2013 if (enable) {
2014 m_ams_backup_tip->SetForegroundColour(wxColour("#009688"));
2015 } else {
2016 m_ams_backup_tip->SetForegroundColour(wxColour(0x90, 0x90, 0x90));
2017 }
2018 m_ams_backup_tip->Refresh();
2019}
Label * m_ams_backup_tip
Definition SyncAmsInfoDialog.hpp:109

References m_ams_backup_tip.

Referenced by prepare_mode().

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; }

◆ 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::SyncAmsInfoDialog::final_deal_edge_pixels_data ( ThumbnailData & data)
3081{
3082 if (data.width > 0 && data.height > 0 && m_edge_pixels.size() > 0) {
3083 for (unsigned int r = 0; r < data.height; ++r) {
3084 unsigned int rr = (data.height - 1 - r) * data.width;
3085 bool exist_rr_up = r >= 1 ? true : false;
3086 bool exist_rr_down = r <= data.height - 2 ? true : false;
3087 unsigned int rr_up = exist_rr_up ? (data.height - 1 - (r - 1)) * data.width : 0;
3088 unsigned int rr_down = exist_rr_down ? (data.height - 1 - (r + 1)) * data.width : 0;
3089 for (unsigned int c = 0; c < data.width; ++c) {
3090 bool exist_c_left = c >= 1 ? true : false;
3091 bool exist_c_right = c <= data.width - 2 ? true : false;
3092 unsigned int c_left = exist_c_left ? c - 1 : 0;
3093 unsigned int c_right = exist_c_right ? c + 1 : 0;
3094 unsigned char *cur_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
3095 unsigned char *relational_pxs[8] = {nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr};
3096 if (exist_rr_up && exist_c_left) { relational_pxs[0] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c_left); }
3097 if (exist_rr_up) { relational_pxs[1] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c); }
3098 if (exist_rr_up && exist_c_right) { relational_pxs[2] = (unsigned char *) data.pixels.data() + 4 * (rr_up + c_right); }
3099 if (exist_c_left) { relational_pxs[3] = (unsigned char *) data.pixels.data() + 4 * (rr + c_left); }
3100 if (exist_c_right) { relational_pxs[4] = (unsigned char *) data.pixels.data() + 4 * (rr + c_right); }
3101 if (exist_rr_down && exist_c_left) { relational_pxs[5] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c_left); }
3102 if (exist_rr_down) { relational_pxs[6] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c); }
3103 if (exist_rr_down && exist_c_right) { relational_pxs[7] = (unsigned char *) data.pixels.data() + 4 * (rr_down + c_right); }
3104 if (cur_px[3] > 0 && m_edge_pixels[r * data.width + c]) {
3105 int rgba_sum[4] = {0, 0, 0, 0};
3106 int valid_count = 0;
3107 for (size_t k = 0; k < 8; k++) {
3108 if (relational_pxs[k]) {
3109 if (k == 0 && m_edge_pixels[(r - 1) * data.width + c_left]) { continue; }
3110 if (k == 1 && m_edge_pixels[(r - 1) * data.width + c]) { continue; }
3111 if (k == 2 && m_edge_pixels[(r - 1) * data.width + c_right]) { continue; }
3112 if (k == 3 && m_edge_pixels[r * data.width + c_left]) { continue; }
3113 if (k == 4 && m_edge_pixels[r * data.width + c_right]) { continue; }
3114 if (k == 5 && m_edge_pixels[(r + 1) * data.width + c_left]) { continue; }
3115 if (k == 6 && m_edge_pixels[(r + 1) * data.width + c]) { continue; }
3116 if (k == 7 && m_edge_pixels[(r + 1) * data.width + c_right]) { continue; }
3117 for (size_t m = 0; m < 4; m++) { rgba_sum[m] += relational_pxs[k][m]; }
3118 valid_count++;
3119 }
3120 }
3121 if (valid_count > 0) {
3122 for (size_t m = 0; m < 4; m++) { cur_px[m] = std::clamp(int(rgba_sum[m] / (float) valid_count), 0, 255); }
3123 }
3124 }
3125 }
3126 }
3127 }
3128}

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::SyncAmsInfoDialog::finish_mode ( )
1216{
1218 m_is_in_sending_mode = false;
1219 Layout();
1220 Fit();
1221}
bool m_is_in_sending_mode
Definition SyncAmsInfoDialog.hpp:52
PrintPageMode m_print_page_mode
Definition SyncAmsInfoDialog.hpp:56
@ PrintPageModeFinish
Definition SelectMachine.hpp:91

References m_is_in_sending_mode, m_print_page_mode, and Slic3r::GUI::PrintPageModeFinish.

◆ force_rescale()

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

◆ format_text()

wxString Slic3r::GUI::SyncAmsInfoDialog::format_text ( wxString & m_msg)
1692{
1693 if (wxGetApp().app_config->get("language") != "zh_CN") {
1694 return m_msg;
1695 }
1696 if (!m_statictext_ams_msg) { return m_msg; }
1697 wxString out_txt = m_msg;
1698 wxString count_txt = "";
1699 int new_line_pos = 0;
1700
1701 for (int i = 0; i < m_msg.length(); i++) {
1702 auto text_size = m_statictext_ams_msg->GetTextExtent(count_txt);
1703 if (text_size.x < (FromDIP(400))) {
1704 count_txt += m_msg[i];
1705 } else {
1706 out_txt.insert(i - 1, '\n');
1707 count_txt = "";
1708 }
1709 }
1710 return out_txt;
1711}
Label * m_statictext_ams_msg
Definition SyncAmsInfoDialog.hpp:110

References m_statictext_ams_msg.

Referenced by update_ams_status_msg(), and update_priner_status_msg().

Here is the caller graph for this function:

◆ generate_override_fix_ams_list()

void Slic3r::GUI::SyncAmsInfoDialog::generate_override_fix_ams_list ( )
2814{
2816 return;
2817 }
2819 // for black list
2820 std::vector<std::string> materials;
2821 std::vector<std::string> brands;
2822 std::vector<std::string> display_materials;
2823 std::vector<std::string> m_filaments_id;
2824 auto preset_bundle = wxGetApp().preset_bundle;
2825
2826 for (auto filament_name : preset_bundle->filament_presets) {
2827 for (int f_index = 0; f_index < preset_bundle->filaments.size(); f_index++) {
2828 PresetCollection *filament_presets = &wxGetApp().preset_bundle->filaments;
2829 Preset * preset = &filament_presets->preset(f_index);
2830 int size = preset_bundle->filaments.size();
2831 if (preset && filament_name.compare(preset->name) == 0) {
2832 std::string display_filament_type;
2833 std::string filament_type = preset->config.get_filament_type(display_filament_type);
2834 std::string m_filament_id = preset->filament_id;
2835 display_materials.push_back(display_filament_type);
2836 materials.push_back(filament_type);
2837 m_filaments_id.push_back(m_filament_id);
2838
2839 std::string m_vendor_name = "";
2840 auto vendor = dynamic_cast<ConfigOptionStrings *>(preset->config.option("filament_vendor"));
2841 if (vendor && (vendor->values.size() > 0)) {
2842 std::string vendor_name = vendor->values[0];
2843 m_vendor_name = vendor_name;
2844 }
2845 brands.push_back(m_vendor_name);
2846 }
2847 }
2848 }
2849 if (m_ams_combo_info.empty()) {
2850 wxGetApp().preset_bundle->get_ams_cobox_infos(m_ams_combo_info);
2851 }
2852 std::vector<int> extruders(wxGetApp().plater()->get_extruders_colors().size());
2853 std::iota(extruders.begin(), extruders.end(), 1);
2854 BitmapCache bmcache;
2855 MaterialHash::iterator iter = m_fix_materialList.begin();
2856 while (iter != m_fix_materialList.end()) {
2857 int id = iter->first;
2858 Material *item = iter->second;
2859 item->item->Destroy();
2860 delete item;
2861 iter++;
2862 }
2863
2864 m_fix_sizer_ams_mapping->Clear();
2865 m_fix_materialList.clear();
2866 m_fix_filaments.clear();
2867
2868 // Mixed-color slots are virtual: they never occupy a tray, so they must not appear as
2869 // AMS sync targets.
2870 auto* is_mixed_opt = preset_bundle->project_config.option<ConfigOptionBools>("filament_is_mixed");
2871
2872 bool use_double_extruder = get_is_double_extruder();
2873 if (use_double_extruder) {
2874 const auto &project_config = preset_bundle->project_config;
2875 m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
2876 }
2877 auto contronal_index = 0;
2878 int item_index = 1;
2879 bool is_first_row = true;
2880 for (auto i = 0; i < extruders.size(); i++) {
2881 auto extruder = extruders[i] - 1;
2882 auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
2883 unsigned char rgb[4];
2884 bmcache.parse_color4(colour, rgb);
2885
2886 auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
2887 if (extruder >= extruders.size() || extruder < 0 || extruder >= m_ams_combo_info.ams_filament_colors.size())
2888 continue;
2889 if (is_mixed_opt && extruder < (int) is_mixed_opt->values.size() && is_mixed_opt->values[extruder])
2890 continue;
2891
2892 if (contronal_index % SYNC_FLEX_GRID_COL == 0) {
2893 wxBoxSizer *ams_tip_sizer = new wxBoxSizer(wxVERTICAL);
2894 if (is_first_row) {
2895 is_first_row = false;
2897 m_original_in_override = new wxStaticText(m_fix_filament_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
2898 m_original_in_override->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
2900 }
2901 ams_tip_sizer->Add(m_original_in_override, 0, wxALIGN_LEFT | wxTOP, FromDIP(6));
2902
2904 auto text = (m_only_exist_ext_spool_flag ? _L("Ext spool") : _L("AMS")) + ":";
2906 m_ams_or_ext_text_in_override->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
2908 }
2909 ams_tip_sizer->Add(m_ams_or_ext_text_in_override, 0, wxALIGN_LEFT | wxTOP, FromDIP(9));
2910 }
2911 m_fix_sizer_ams_mapping->Add(ams_tip_sizer, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
2912 contronal_index++;
2913 }
2914
2915 MaterialSyncItem *item = nullptr;
2916 if (use_double_extruder) {
2917 if (m_filaments_map[extruder] == 1) {
2918 item = new MaterialSyncItem(m_fix_filament_panel, colour_rgb, _L(display_materials[extruder])); // m_filament_left_panel//special
2919 m_fix_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5)); // m_sizer_ams_mapping_left
2920 } else if (m_filaments_map[extruder] == 2) {
2921 item = new MaterialSyncItem(m_fix_filament_panel, colour_rgb, _L(display_materials[extruder])); // m_filament_right_panel
2922 m_fix_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5)); // m_sizer_ams_mapping_right
2923 } else {
2924 BOOST_LOG_TRIVIAL(error) << "check error:MaterialItem *item = nullptr";
2925 continue;
2926 }
2927 } else {
2928 item = new MaterialSyncItem(m_fix_filament_panel, colour_rgb, _L(display_materials[extruder]));
2929 m_fix_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
2930 }
2931 item->set_material_index_str(std::to_string(item_index));
2932 item_index++;
2933 contronal_index++;
2934 item->allow_paint_dropdown(false);
2935
2936 Material *material_item = new Material();
2937 material_item->id = extruder;
2938 material_item->item = item;
2939 m_fix_materialList[i] = material_item;
2940
2941 // build for ams mapping
2942 if (extruder < materials.size() && extruder >= 0) {
2943 FilamentInfo info;
2944 info.id = extruder;
2945 info.type = materials[extruder];
2946 info.brand = brands[extruder];
2947 info.filament_id = m_filaments_id[extruder];
2948 info.color = wxString::Format("#%02X%02X%02X%02X", colour_rgb.Red(), colour_rgb.Green(), colour_rgb.Blue(), colour_rgb.Alpha()).ToStdString();
2949 m_fix_filaments.push_back(info);
2950 }
2951 }
2952 {
2953 if (!m_ams_combo_info.empty()) {
2954 auto index = 0;
2955 for (auto it = m_fix_materialList.begin(); it != m_fix_materialList.end(); it++) {
2956 if (index >= m_ams_combo_info.ams_filament_colors.size() || index >= extruders.size()) {
2957 break;
2958 }
2959 auto ams_color = decode_ams_color(m_ams_combo_info.ams_filament_colors[index]);
2960 wxString ams_id = m_ams_combo_info.ams_names[index];
2961 std::vector<wxColour> cols;
2962 for (auto col : m_ams_combo_info.ams_multi_color_filment[index]) {
2963 cols.push_back(decode_ams_color(col));
2964 }
2965 it->second->item->set_ams_info(ams_color, ams_id, 0, cols);//generate_override_fix_ams_list
2966 index++;
2967 }
2968 }
2969 }
2970 m_fix_filament_panel->Show(); // SyncAmsInfoDialog::reset_and_sync_ams_list()
2972 m_fix_sizer_ams_mapping->Layout();
2974}
static wxFont Head_12
Definition Label.hpp:47
MaterialHash m_fix_materialList
Definition SyncAmsInfoDialog.hpp:156
std::vector< FilamentInfo > m_fix_filaments
Definition SyncAmsInfoDialog.hpp:158
bool get_is_double_extruder()
Definition SyncAmsInfoDialog.cpp:277
wxStaticText * m_original_in_override
Definition SyncAmsInfoDialog.hpp:114
AMSComboInfo m_ams_combo_info
Definition SyncAmsInfoDialog.hpp:309
wxColour decode_ams_color(const std::string &color)
Definition SyncAmsInfoDialog.cpp:411
bool m_generate_fix_sizer_ams_mapping
Definition SyncAmsInfoDialog.hpp:159
static Plater * plater()
Definition GUI_Factories.cpp:400
zaa_minimize_perimeter_height filament_type((ConfigOptionBools, filament_soluble))((ConfigOptionStrings
@ Preset
Definition calib.hpp:39
size_t cols(const T &raster)
Definition MarchingSquares.hpp:173

References _L, _L_CONTEXT, Slic3r::GUI::MaterialItem::allow_paint_dropdown(), Slic3r::FilamentGroupUtils::FilamentInfo::color, Slic3r::Preset::config, StateColor::darkModeColorFor(), decode_ams_color(), Slic3r::Preset::filament_id, Slic3r::filament_type(), Slic3r::DynamicPrintConfig::get_filament_type(), get_is_double_extruder(), Label::Head_12, Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, L_CONTEXT, m_ams_combo_info, m_ams_or_ext_text_in_override, m_filaments_map, m_fix_filament_panel, m_fix_filament_panel_sizer, m_fix_filaments, m_fix_materialList, m_fix_sizer_ams_mapping, m_generate_fix_sizer_ams_mapping, m_only_exist_ext_spool_flag, m_original_in_override, Slic3r::Preset::name, Slic3r::ConfigBase::option(), Slic3r::GUI::BitmapCache::parse_color4(), Slic3r::GUI::plater(), Slic3r::PresetCollection::preset(), Slic3r::GUI::MaterialSyncItem::set_material_index_str(), SYNC_FLEX_GRID_COL, Slic3r::FilamentGroupUtils::FilamentInfo::type, and wxStaticText.

Referenced by update_thumbnail_data_accord_plate_index().

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

◆ get_ams_mapping_result() [1/2]

const std::vector< FilamentInfo > & Slic3r::GUI::SyncAmsInfoDialog::get_ams_mapping_result ( )
inline
248{ return m_ams_mapping_result; }

References m_ams_mapping_result.

Referenced by do_ams_mapping().

Here is the caller graph for this function:

◆ get_ams_mapping_result() [2/2]

bool Slic3r::GUI::SyncAmsInfoDialog::get_ams_mapping_result ( std::string & mapping_array_str,
std::string & mapping_array_str2,
std::string & ams_mapping_info )
1391{
1392 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "m_ams_mapping_result.size:" << m_ams_mapping_result.empty();
1393 if (m_ams_mapping_result.empty())
1394 return false;
1395
1396 bool valid_mapping_result = true;
1397 int invalid_count = 0;
1398 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
1399 if (m_ams_mapping_result[i].tray_id == -1) {
1400 valid_mapping_result = false;
1401 invalid_count++;
1402 }
1403 }
1404
1405 if (invalid_count == m_ams_mapping_result.size()) {
1406 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "invalid_count == m_ams_mapping_result.size()";
1407 return false;
1408 } else {
1409 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "check mapping_v0_json";
1410 json mapping_v0_json = json::array();
1411 json mapping_v1_json = json::array();
1412 json mapping_info_json = json::array();
1413
1414 /* get filament maps */
1415 std::vector<int> filament_maps;
1416 Plater * plater = wxGetApp().plater();
1417 if (plater) {
1418 PartPlate *curr_plate = plater->get_partplate_list().get_curr_plate();
1419 if (curr_plate) {
1420 filament_maps = curr_plate->get_filament_maps();
1421 } else {
1422 BOOST_LOG_TRIVIAL(error) << "get_ams_mapping_result, curr_plate is nullptr";
1423 }
1424 } else {
1425 BOOST_LOG_TRIVIAL(error) << "get_ams_mapping_result, plater is nullptr";
1426 }
1427
1428 for (int i = 0; i < wxGetApp().preset_bundle->filament_presets.size(); i++) {
1429 int tray_id = -1;
1430 json mapping_item_v1;
1431 mapping_item_v1["ams_id"] = 0xff;
1432 mapping_item_v1["slot_id"] = 0xff;
1433 json mapping_item;
1434 mapping_item["ams"] = tray_id;
1435 mapping_item["targetColor"] = "";
1436 mapping_item["filamentId"] = "";
1437 mapping_item["filamentType"] = "";
1438 for (int k = 0; k < m_ams_mapping_result.size(); k++) {
1439 if (m_ams_mapping_result[k].id == i) {
1440 tray_id = m_ams_mapping_result[k].tray_id;
1441 mapping_item["ams"] = tray_id;
1442 mapping_item["filamentType"] = m_filaments[k].type;
1443 if (i >= 0 && i < wxGetApp().preset_bundle->filament_presets.size()) {
1444 auto it = wxGetApp().preset_bundle->filaments.find_preset(wxGetApp().preset_bundle->filament_presets[i]);
1445 if (it != nullptr) { mapping_item["filamentId"] = it->filament_id; }
1446 }
1447 /* nozzle id */
1448 if (i >= 0 && i < filament_maps.size()) { mapping_item["nozzleId"] = convert_filament_map_nozzle_id_to_task_nozzle_id(filament_maps[i]); }
1449 // convert #RRGGBB to RRGGBBAA
1450 mapping_item["sourceColor"] = m_filaments[k].color;
1451 mapping_item["targetColor"] = m_ams_mapping_result[k].color;
1452 if (tray_id == VIRTUAL_TRAY_MAIN_ID || tray_id == VIRTUAL_TRAY_DEPUTY_ID) { tray_id = -1; }
1453
1454 /*new ams mapping data*/
1455 try {
1456 if (m_ams_mapping_result[k].ams_id.empty() || m_ams_mapping_result[k].slot_id.empty()) { // invalid case
1457 mapping_item_v1["ams_id"] = VIRTUAL_TRAY_MAIN_ID;
1458 mapping_item_v1["slot_id"] = VIRTUAL_TRAY_MAIN_ID;
1459 } else {
1460 mapping_item_v1["ams_id"] = std::stoi(m_ams_mapping_result[k].ams_id);
1461 mapping_item_v1["slot_id"] = std::stoi(m_ams_mapping_result[k].slot_id);
1462 }
1463 } catch (...) {}
1464 }
1465 }
1466 mapping_v0_json.push_back(tray_id);
1467 mapping_v1_json.push_back(mapping_item_v1);
1468 mapping_info_json.push_back(mapping_item);
1469 }
1470
1471 mapping_array_str = mapping_v0_json.dump();
1472 mapping_array_str2 = mapping_v1_json.dump();
1473
1474 ams_mapping_info = mapping_info_json.dump();
1475 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "mapping_array_str:" << mapping_array_str;
1476 return valid_mapping_result;
1477 }
1478 return true;
1479}
#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)
Definition SyncAmsInfoDialog.cpp:1626
@ Plater
Definition Shortcuts.hpp:21

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

Here is the call graph for this function:

◆ get_is_double_extruder()

bool Slic3r::GUI::SyncAmsInfoDialog::get_is_double_extruder ( )
278{
279 const auto &full_config = wxGetApp().preset_bundle->full_config();
280 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
281 // This dialog has dedicated left/right layout logic only for true 2-nozzle printers.
282 // For toolchangers with 3+ tools (or any filament_map beyond {1,2}),
283 // fall back to the generic list flow so all tools are shown.
284 if (nozzle_nums != 2)
285 return false;
286
287 auto *plater = wxGetApp().plater();
288 if (!plater)
289 return true;
290 auto *plate = plater->get_partplate_list().get_curr_plate();
291 if (!plate)
292 return true;
293
294 const auto &project_config = wxGetApp().preset_bundle->project_config;
295 auto filament_maps = plate->get_real_filament_maps(project_config);
296 for (int map_id : filament_maps) {
297 if (map_id != 1 && map_id != 2) {
298 return false;
299 }
300 }
301 return true;
302}
std::vector< int > get_real_filament_maps(const DynamicConfig &g_config, bool *use_global_param=nullptr) const
Definition PartPlate.cpp:384

References Slic3r::GUI::plater().

Referenced by generate_override_fix_ams_list(), reset_and_sync_ams_list(), 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::SyncAmsInfoDialog::get_print_type ( )
inline
243{ return m_print_type; };
PrintFromType m_print_type
Definition SyncAmsInfoDialog.hpp:85

References m_print_type.

◆ get_result()

const SyncResult & Slic3r::GUI::SyncAmsInfoDialog::get_result ( )
inline
268{ return m_result; }

References m_result.

◆ get_status()

PrintDialogStatus Slic3r::GUI::SyncAmsInfoDialog::get_status ( )
inline
245{ return m_print_status; }
PrintDialogStatus m_print_status
Definition SyncAmsInfoDialog.hpp:61

References m_print_status.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ has_selector()

bool Slic3r::GUI::SyncAmsInfoDialog::has_selector ( MachineObject * obj_) const
1282{
1283 if (!obj_) {
1284 DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
1285 if (!dev_manager)
1286 return false;
1287 obj_ = dev_manager->get_selected_machine();
1288 }
1289 return obj_ && obj_->GetFilaSwitch()->IsInstalled() && obj_->GetFilaSwitch()->IsReady();
1290}

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

Referenced by do_ams_mapping(), and reset_and_sync_ams_list().

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

◆ has_timelapse_warning()

bool Slic3r::GUI::SyncAmsInfoDialog::has_timelapse_warning ( )
2429{
2430 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
2431 for (auto warning : plate->get_slice_result()->warnings) {
2432 if (warning.msg == NOT_GENERATE_TIMELAPSE) { return true; }
2433 }
2434
2435 return false;
2436}
#define NOT_GENERATE_TIMELAPSE
Definition GCodeProcessor.hpp:48

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

Referenced by update_timelapse_enable_status().

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

◆ hide_no_use_controls()

void Slic3r::GUI::SyncAmsInfoDialog::hide_no_use_controls ( )
232 {
235 //show_sizer(sizer_split_filament, false);
239 //m_statictext_ams_msg->Hide();
240}
void show_sizer(wxSizer *sizer, bool show)
Definition SyncAmsInfoDialog.cpp:242

References m_basicl_sizer, m_sizer_options_other, m_sizer_options_timelapse, show_sizer(), sizer_advanced_options_title, and sizer_basic_right_info.

Referenced by Show().

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

◆ init_bind()

void Slic3r::GUI::SyncAmsInfoDialog::init_bind ( )
1152{
1153 Bind(wxEVT_TIMER, &SyncAmsInfoDialog::on_timer, this);
1154 Bind(EVT_SHOW_ERROR_INFO, [this](auto &e) { show_print_failed_info(true); });
1155 Bind(EVT_UPDATE_USER_MACHINE_LIST, &SyncAmsInfoDialog::update_printer_combobox, this);
1156 Bind(EVT_PRINT_JOB_CANCEL, &SyncAmsInfoDialog::on_print_job_cancel, this);
1157 Bind(EVT_SET_FINISH_MAPPING, &SyncAmsInfoDialog::on_set_finish_mapping, this);
1158 Bind(wxEVT_LEFT_DOWN, [this](auto &e) {
1159 check_fcous_state(this);
1160 e.Skip();
1161 });
1162 m_basic_panel->Bind(wxEVT_LEFT_DOWN, [this](auto &e) {
1163 check_fcous_state(this);
1164 e.Skip();
1165 });
1166
1167 Bind(EVT_CONNECT_LAN_MODE_PRINT, [](wxCommandEvent &e) {
1168 if (e.GetInt() == 0) {
1169 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1170 if (!dev) return;
1171 MachineObject *obj = dev->get_selected_machine();
1172 if (!obj)
1173 return;
1174 }
1175 });
1176}
void on_timer(wxTimerEvent &event)
Definition SyncAmsInfoDialog.cpp:2229
void on_print_job_cancel(wxCommandEvent &evt)
Definition SyncAmsInfoDialog.cpp:2125
void update_printer_combobox(wxCommandEvent &event)
Definition SyncAmsInfoDialog.cpp:2223
void on_set_finish_mapping(wxCommandEvent &evt)
Definition SyncAmsInfoDialog.cpp:2061

References check_fcous_state(), Slic3r::DeviceManager::get_selected_machine(), m_basic_panel, on_print_job_cancel(), on_set_finish_mapping(), on_timer(), show_print_failed_info(), and update_printer_combobox().

Referenced by SyncAmsInfoDialog().

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

◆ init_bitmaps()

void Slic3r::GUI::SyncAmsInfoDialog::init_bitmaps ( )
private
514{
515 if (wxGetApp().dark_mode()) {
516 m_swipe_left_bmp_normal = ScalableBitmap(m_scrolledWindow, "previous_item", m_bmp_pix_cont);
517 m_swipe_left_bmp_hover = ScalableBitmap(m_scrolledWindow, "previous_item_disable", m_bmp_pix_cont);
518 m_swipe_left_bmp_disable = ScalableBitmap(m_scrolledWindow, "previous_item_dark_disable", m_bmp_pix_cont);
519 m_swipe_right_bmp_normal = ScalableBitmap(m_scrolledWindow, "next_item", m_bmp_pix_cont);
520 m_swipe_right_bmp_hover = ScalableBitmap(m_scrolledWindow, "next_item_disable", m_bmp_pix_cont);
521 m_swipe_right_bmp_disable = ScalableBitmap(m_scrolledWindow, "next_item_dark_disable", m_bmp_pix_cont);
522 } else {
523 m_swipe_left_bmp_normal = ScalableBitmap(m_scrolledWindow, "previous_item", m_bmp_pix_cont);
524 m_swipe_left_bmp_hover = ScalableBitmap(m_scrolledWindow, "previous_item_hover", m_bmp_pix_cont);
525 m_swipe_left_bmp_disable = ScalableBitmap(m_scrolledWindow, "previous_item_disable", m_bmp_pix_cont);
526 m_swipe_right_bmp_normal = ScalableBitmap(m_scrolledWindow, "next_item", m_bmp_pix_cont);
527 m_swipe_right_bmp_hover = ScalableBitmap(m_scrolledWindow, "next_item_hover", m_bmp_pix_cont);
528 m_swipe_right_bmp_disable = ScalableBitmap(m_scrolledWindow, "next_item_disable", m_bmp_pix_cont);
529 }
530}
ScalableBitmap m_swipe_left_bmp_disable
Definition SyncAmsInfoDialog.hpp:143
ScalableBitmap m_swipe_right_bmp_disable
Definition SyncAmsInfoDialog.hpp:146

References m_bmp_pix_cont, m_scrolledWindow, m_swipe_left_bmp_disable, m_swipe_left_bmp_hover, m_swipe_left_bmp_normal, m_swipe_right_bmp_disable, m_swipe_right_bmp_hover, and m_swipe_right_bmp_normal.

Referenced by add_two_image_control(), and Show().

Here is the caller graph for this function:

◆ init_timer()

void Slic3r::GUI::SyncAmsInfoDialog::init_timer ( )
1907{
1908 m_refresh_timer = new wxTimer();
1909 m_refresh_timer->SetOwner(this);
1910}

References m_refresh_timer.

Referenced by SyncAmsInfoDialog().

Here is the caller graph for this function:

◆ is_blocking_printing()

bool Slic3r::GUI::SyncAmsInfoDialog::is_blocking_printing ( MachineObject * obj_)
1921{
1923 return wxGetApp().is_blocking_printing(obj_);
1924
1925 std::string source_model;
1927 source_model = m_required_data_plate_data_list[m_print_plate_idx]->printer_model_id;
1928 return wxGetApp().is_blocking_printing(obj_, source_model);
1929}
Slic3r::PlateDataPtrs m_required_data_plate_data_list
Definition SyncAmsInfoDialog.hpp:77
int m_print_plate_idx
Definition SyncAmsInfoDialog.hpp:49
@ FROM_SDCARD_VIEW
Definition DevDefs.h:174
@ FROM_NORMAL
Definition DevDefs.h:173

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_dirty_filament()

bool Slic3r::GUI::SyncAmsInfoDialog::is_dirty_filament ( )
304 {
305 PresetCollection *m_presets = &wxGetApp().preset_bundle->filaments;
306 if (m_check_dirty_fialment && m_presets && m_presets->get_edited_preset().is_dirty) {
307 return true;
308 }
309 return false;
310}
bool m_check_dirty_fialment
Definition SyncAmsInfoDialog.hpp:347

References Slic3r::PresetCollection::get_edited_preset(), Slic3r::Preset::is_dirty, and m_check_dirty_fialment.

Referenced by is_need_show(), Show(), and updata_ui_data_after_connected_printer().

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

◆ is_must_finish_slice_then_connected_printer()

bool Slic3r::GUI::SyncAmsInfoDialog::is_must_finish_slice_then_connected_printer ( )
225 {
226 if (m_specify_plate_idx >= 0) {
227 return false;
228 }
229 return true;
230}

References m_specify_plate_idx.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ is_need_show()

bool Slic3r::GUI::SyncAmsInfoDialog::is_need_show ( )
313{
314 //init begin
315 m_result.direct_sync = true;
317 m_ams_combo_info.clear();
318 // init end
321 return false;
322 }
323 auto mode = PageType::ptColorMap;
324 if (m_colormap_btn) {
325 m_pages->ChangeSelection(0);
330 }
331 return true;
332}
void update_panel_status(PageType page)
Definition SyncAmsInfoDialog.cpp:453
bool is_dirty_filament()
Definition SyncAmsInfoDialog.cpp:304
void update_plate_combox()
Definition SyncAmsInfoDialog.cpp:396

References check_empty_project(), is_dirty_filament(), m_ams_combo_info, m_colormap_btn, m_generate_fix_sizer_ams_mapping, m_is_empty_project, m_pages, m_result, ptColorMap, update_panel_status(), update_plate_combox(), update_swipe_button_state(), and update_when_change_map_mode().

Here is the call 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_type_match()

bool Slic3r::GUI::SyncAmsInfoDialog::is_nozzle_type_match ( DevExtderSystem data,
wxString & error_message ) const
1547{
1548 if (data.GetTotalExtderCount() <= 1 || !wxGetApp().preset_bundle) return false;
1549
1550 const auto &project_config = wxGetApp().preset_bundle->project_config;
1551 // check nozzle used
1552 auto used_filaments = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_filaments(); // 1 based
1553 auto filament_maps = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config); // 1 based
1554 std::map<int, std::string> used_extruders_flow;
1555 std::vector<int> used_extruders; // 0 based
1556 for (auto f : used_filaments) {
1557 int filament_extruder = filament_maps[f - 1] - 1;
1558 if (std::find(used_extruders.begin(), used_extruders.end(), filament_extruder) == used_extruders.end()) used_extruders.emplace_back(filament_extruder);
1559 }
1560
1561 std::sort(used_extruders.begin(), used_extruders.end());
1562
1563 auto nozzle_volume_type_opt = dynamic_cast<const ConfigOptionEnumsGeneric *>(wxGetApp().preset_bundle->project_config.option("nozzle_volume_type"));
1564 for (auto i = 0; i < used_extruders.size(); i++) {
1565 if (nozzle_volume_type_opt) {
1566 NozzleVolumeType nozzle_volume_type = (NozzleVolumeType) (nozzle_volume_type_opt->get_at(used_extruders[i]));
1568 used_extruders_flow[used_extruders[i]] = L("Standard");
1570 used_extruders_flow[used_extruders[i]] = L("TPU High Flow");
1572 used_extruders_flow[used_extruders[i]] = L("E3D High Flow");
1573 } else {
1574 used_extruders_flow[used_extruders[i]] = L("High Flow");
1575 }
1576 }
1577 }
1578
1579 std::vector<int> map_extruders = {1, 0};
1580
1581 // The default two extruders are left, right, but the order of the extruders on the machine is right, left.
1582 std::vector<std::string> flow_type_of_machine;
1583 for (auto it = data.GetExtruders().begin(); it != data.GetExtruders().end(); it++) {
1584 if (it->GetNozzleFlowType() == NozzleFlowType::H_FLOW) {
1585 flow_type_of_machine.push_back(L("High Flow"));
1586 } else if (it->GetNozzleFlowType() == NozzleFlowType::S_FLOW) {
1587 flow_type_of_machine.push_back(L("Standard"));
1588 } else if (it->GetNozzleFlowType() == NozzleFlowType::U_FLOW) {
1589 flow_type_of_machine.push_back(L("TPU High Flow"));
1590 } else if (it->GetNozzleFlowType() == NozzleFlowType::E_FLOW) {
1591 flow_type_of_machine.push_back(L("E3D High Flow"));
1592 }
1593 }
1594
1595 // Only when all preset nozzle types and machine nozzle types are exactly the same, return true.
1596 for (std::map<int, std::string>::iterator it = used_extruders_flow.begin(); it != used_extruders_flow.end(); it++) {
1597 if (it->first >= 0 && it->first < map_extruders.size()) {
1598 int target_machine_nozzle_id = map_extruders[it->first];
1599
1600 if (target_machine_nozzle_id < flow_type_of_machine.size()) {
1601 if (flow_type_of_machine[target_machine_nozzle_id] != used_extruders_flow[it->first]) {
1602 wxString pos;
1603 auto sai_nz_pt = wxGetApp().preset_bundle->printers.get_edited_preset().get_printer_type(wxGetApp().preset_bundle);
1604 if (target_machine_nozzle_id == DEPUTY_EXTRUDER_ID) {
1606 } else if (target_machine_nozzle_id == MAIN_EXTRUDER_ID) {
1608 }
1609
1610 error_message = wxString::Format(_L("The nozzle flow setting of %s(%s) doesn't match with the slicing file(%s). "
1611 "Please make sure the nozzle installed matches with settings in printer, "
1612 "then set the corresponding printer preset while slicing."),
1613 pos, _L(flow_type_of_machine[target_machine_nozzle_id]), _L(used_extruders_flow[it->first]));
1614 return false;
1615 }
1616 }
1617 }
1618 else {
1619 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "check error:array bound in map_extruders" << it->first;
1620 return false;
1621 }
1622 }
1623 return true;
1624}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101
#define L(s)
Definition ExtrusionEntity.cpp:25
static std::string get_toolhead_display_name(const std::string &type_str, int ext_id, ToolHeadComponent component, ToolHeadNameCase name_case=ToolHeadNameCase::TitleCase, bool short_name=false)
Definition DevConfigUtil.cpp:379
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16
@ nvtE3DHighFlow
Definition PrintConfig.hpp:626
@ nvtTPUHighFlow
Definition PrintConfig.hpp:624
@ nvtStandard
Definition PrintConfig.hpp:619
@ Nozzle
Definition DevConfigUtil.h:35
@ E_FLOW
Definition DevDefs.h:121
@ H_FLOW
Definition DevDefs.h:119
@ U_FLOW
Definition DevDefs.h:120
@ S_FLOW
Definition DevDefs.h:118
static double f(double x, double z_sin, double z_cos, bool vertical, bool flip)
Definition FillGyroid.cpp:124
zaa_minimize_perimeter_height nozzle_volume_type((ConfigOptionStrings, extruder_ams_count))((ConfigOptionStrings
@ LowerCase
Definition DevConfigUtil.h:43

References _L, DEPUTY_EXTRUDER_ID, Slic3r::E_FLOW, Slic3r::f(), Slic3r::DevPrinterConfigUtil::get_toolhead_display_name(), Slic3r::DevExtderSystem::GetExtruders(), Slic3r::DevExtderSystem::GetTotalExtderCount(), Slic3r::H_FLOW, L, Slic3r::LowerCase, MAIN_EXTRUDER_ID, Slic3r::Nozzle, Slic3r::nozzle_volume_type(), Slic3r::nvtE3DHighFlow, Slic3r::nvtStandard, Slic3r::nvtTPUHighFlow, Slic3r::S_FLOW, and Slic3r::U_FLOW.

Referenced by update_show_status().

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

◆ is_same_nozzle_type()

bool Slic3r::GUI::SyncAmsInfoDialog::is_same_nozzle_type ( std::string & filament_type,
NozzleType & tag_nozzle_type )
1932{
1933 bool is_same_nozzle_type = true;
1934
1935 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1936 if (!dev) return true;
1937
1938 MachineObject *obj_ = dev->get_selected_machine();
1939 if (obj_ == nullptr) return true;
1940
1941 NozzleType nozzle_type = obj_->GetExtderSystem()->GetNozzleType(0);
1942 auto printer_nozzle_hrc = Print::get_hrc_by_nozzle_type(nozzle_type);
1943
1944 auto preset_bundle = wxGetApp().preset_bundle;
1945 MaterialHash::iterator iter = m_materialList.begin();
1946 while (iter != m_materialList.end()) {
1947 Material * item = iter->second;
1948 auto m = item->item;
1949 auto filament_nozzle_hrc = preset_bundle->get_required_hrc_by_filament_type(m->m_material_name.ToStdString());
1950
1951 if (abs(filament_nozzle_hrc) > abs(printer_nozzle_hrc)) {
1952 filament_type = m->m_material_name.ToStdString();
1953 BOOST_LOG_TRIVIAL(info) << "filaments hardness mismatch: filament = " << filament_type << " printer_nozzle_hrc = " << printer_nozzle_hrc;
1954 is_same_nozzle_type = false;
1955 tag_nozzle_type = NozzleType::ntHardenedSteel;
1956 return is_same_nozzle_type;
1957 } else {
1958 tag_nozzle_type = obj_->GetExtderSystem()->GetNozzleType(0);
1959 }
1960
1961 iter++;
1962 }
1963
1964 return is_same_nozzle_type;
1965}
bool is_same_nozzle_type(std::string &filament_type, NozzleType &tag_nozzle_type)
Definition SyncAmsInfoDialog.cpp:1931
static int get_hrc_by_nozzle_type(const NozzleType &type)
Definition Print.cpp:4570
NozzleType
Definition CommonDefs.hpp:13
@ ntHardenedSteel
Definition CommonDefs.hpp:15
zaa_minimize_perimeter_height nozzle_type((ConfigOptionInt, nozzle_hrc))((ConfigOptionBool

References Slic3r::filament_type(), Slic3r::Print::get_hrc_by_nozzle_type(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::DevExtderSystem::GetNozzleType(), is_same_nozzle_type(), Slic3r::GUI::Material::item, m_materialList, Slic3r::nozzle_type(), and Slic3r::ntHardenedSteel.

Referenced by is_same_nozzle_type().

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

◆ is_same_printer_model()

bool Slic3r::GUI::SyncAmsInfoDialog::is_same_printer_model ( )
1968{
1969 bool result = true;
1970 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1971 if (!dev) return result;
1972
1973 MachineObject *obj_ = dev->get_selected_machine();
1974
1975 if (obj_ == nullptr) { return result; }
1976
1977 PresetBundle *preset_bundle = wxGetApp().preset_bundle;
1978 const std::string source_model = preset_bundle ? preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) : std::string();
1981 return true;
1982 }
1983
1984 if (preset_bundle && source_model != obj_->printer_type) {
1985 if ((obj_->is_support_upgrade_kit && obj_->installed_upgrade_kit) && (preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle) == "C12")) {
1986 return true;
1987 }
1988
1989 BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
1990 BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << obj_->printer_type;
1991 return false;
1992 }
1993
1994 if (obj_->is_support_upgrade_kit && obj_->installed_upgrade_kit) {
1995 BOOST_LOG_TRIVIAL(info) << "printer_model: source = " << preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
1996 BOOST_LOG_TRIVIAL(info) << "printer_model: target = " << obj_->printer_type << " (plus)";
1997 return false;
1998 }
1999
2000 return true;
2001}
static bool is_optional_printer_model_id(const std::string &model_id)
Definition DevConfigUtil.h:69

References 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, Slic3r::MachineObject::printer_type, and Slic3r::PresetBundle::printers.

Here is the call graph for this function:

◆ is_timeout()

bool Slic3r::GUI::SyncAmsInfoDialog::is_timeout ( )
2144{
2145 if (m_timeout_count > 15 * 1000 / LIST_REFRESH_INTERVAL) { return true; }
2146 return false;
2147}
#define LIST_REFRESH_INTERVAL
Definition CalibrationPanel.cpp:46
int m_timeout_count
Definition SyncAmsInfoDialog.hpp:50

References LIST_REFRESH_INTERVAL, and m_timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ normal_font()

◆ on_cancel()

void Slic3r::GUI::SyncAmsInfoDialog::on_cancel ( wxCloseEvent & event)
1913{
1914 if (m_mapping_popup.IsShown())
1915 m_mapping_popup.Dismiss();
1916
1917 this->EndModal(wxID_CANCEL);
1918}

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

Referenced by SyncAmsInfoDialog().

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

◆ on_dpi_changed()

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

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

2508{
2509 if (ams_mapping_help_icon != nullptr) {
2510 ams_mapping_help_icon->msw_rescale();
2512 img_amsmapping_tip->SetBitmap(ams_mapping_help_icon->bmp());
2513 }
2514
2515 for (auto material1 : m_materialList) {
2516 material1.second->item->msw_rescale();
2517 }
2518 m_swipe_left_button->msw_rescale();
2519 m_swipe_right_button->msw_rescale();
2520 //m_button_ok->SetMinSize(OK_BUTTON_SIZE); // ORCA DialogButtons automatically manages style and size
2521 //m_button_ok->SetCornerRadius(FromDIP(12));
2522 //m_button_cancel->SetMinSize(CANCEL_BUTTON_SIZE);
2523 //m_button_cancel->SetCornerRadius(FromDIP(12));
2524 m_merge_color_checkbox->Rescale();
2525 m_append_color_checkbox->Rescale();
2526 m_combobox_plate->Rescale();
2527 Fit();
2528 Refresh();
2529}
ScalableBitmap * ams_mapping_help_icon
Definition SyncAmsInfoDialog.hpp:119
wxStaticBitmap * img_amsmapping_tip
Definition SyncAmsInfoDialog.hpp:104

References ams_mapping_help_icon, img_amsmapping_tip, m_append_color_checkbox, m_combobox_plate, m_materialList, m_merge_color_checkbox, m_swipe_left_button, and m_swipe_right_button.

◆ on_print_job_cancel()

void Slic3r::GUI::SyncAmsInfoDialog::on_print_job_cancel ( wxCommandEvent & evt)
2126{
2127 BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
2129 // enter prepare mode
2130 prepare_mode();
2131}
void prepare_mode(bool refresh_button=true)
Definition SyncAmsInfoDialog.cpp:1200
void show_status(PrintDialogStatus status, std::vector< wxString > params=std::vector< wxString >())
Definition SyncAmsInfoDialog.cpp:1766
@ PrintStatusInit
Definition PrePrintChecker.hpp:56

References 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::SyncAmsInfoDialog::on_refresh ( wxCommandEvent & event)
2051{
2052 if (m_is_empty_project) {
2053 return;
2054 }
2055 BOOST_LOG_TRIVIAL(info) << "m_printer_last_select: on_refresh";
2057
2059}
void update_user_machine_list()
Definition SyncAmsInfoDialog.cpp:2021
@ PrintStatusRefreshingMachineList
Definition PrePrintChecker.hpp:74

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

Here is the call graph for this function:

◆ on_set_finish_mapping()

void Slic3r::GUI::SyncAmsInfoDialog::on_set_finish_mapping ( wxCommandEvent & evt)
2062{
2063 auto selection_data = evt.GetString();
2064 auto selection_data_arr = wxSplit(selection_data, '|');
2065
2066 BOOST_LOG_TRIVIAL(info) << "The ams mapping selection result: data is " << selection_data;
2067
2068 if (selection_data_arr.size() == 8) {
2069 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
2070 int old_filament_id = (int) wxAtoi(selection_data_arr[5]);
2071 if (m_print_type == PrintFromType::FROM_NORMAL) { // todo:support sd card
2072 change_default_normal(old_filament_id, ams_colour);
2075 if (!m_reset_all_btn->IsShown()) {
2076 m_reset_all_btn->Show();
2077 Layout();
2078 Fit();
2079 }
2080 }
2081
2082 int ctype = 0;
2083 std::vector<wxColour> material_cols;
2084 std::vector<std::string> tray_cols;
2085 for (auto mapping_item : m_mapping_popup.m_mapping_item_list) {
2086 if (mapping_item->m_tray_data.id == evt.GetInt()) {
2087 ctype = mapping_item->m_tray_data.ctype;
2088 material_cols = mapping_item->m_tray_data.material_cols;
2089 for (auto col : mapping_item->m_tray_data.material_cols) {
2090 wxString color = wxString::Format("#%02X%02X%02X%02X", col.Red(), col.Green(), col.Blue(), col.Alpha());
2091 tray_cols.push_back(color.ToStdString());
2092 }
2093 break;
2094 }
2095 }
2096
2097 for (auto i = 0; i < m_ams_mapping_result.size(); i++) {
2098 if (m_ams_mapping_result[i].id == wxAtoi(selection_data_arr[5])) {
2099 m_ams_mapping_result[i].tray_id = evt.GetInt();
2100 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
2101 wxString color = wxString::Format("#%02X%02X%02X%02X", ams_colour.Red(), ams_colour.Green(), ams_colour.Blue(), ams_colour.Alpha());
2102 m_ams_mapping_result[i].color = color.ToStdString();
2103 m_ams_mapping_result[i].ctype = ctype;
2104 m_ams_mapping_result[i].colors = tray_cols;
2105
2106 m_ams_mapping_result[i].ams_id = selection_data_arr[6].ToStdString();
2107 m_ams_mapping_result[i].slot_id = selection_data_arr[7].ToStdString();
2108 }
2109 BOOST_LOG_TRIVIAL(info) << "The ams mapping result: id is " << m_ams_mapping_result[i].id << "tray_id is " << m_ams_mapping_result[i].tray_id;
2110 }
2111
2112 MaterialHash::iterator iter = m_materialList.begin();
2113 while (iter != m_materialList.end()) {
2114 Material * item = iter->second;
2115 auto m = item->item;
2116 if (item->id == m_current_filament_id) {
2117 auto ams_colour = wxColour(wxAtoi(selection_data_arr[0]), wxAtoi(selection_data_arr[1]), wxAtoi(selection_data_arr[2]), wxAtoi(selection_data_arr[3]));
2118 m->set_ams_info(ams_colour, selection_data_arr[4], ctype, material_cols);//finish
2119 }
2120 iter++;
2121 }
2122 }
2123}
void final_deal_edge_pixels_data(ThumbnailData &data)
Definition SyncAmsInfoDialog.cpp:3080
void change_default_normal(int old_filament_id, wxColour temp_ams_color)
Definition SyncAmsInfoDialog.cpp:3200
int m_current_filament_id
Definition SyncAmsInfoDialog.hpp:48
void set_default_normal(const ThumbnailData &)
Definition SyncAmsInfoDialog.cpp:179

References change_default_normal(), final_deal_edge_pixels_data(), Slic3r::GUI::FROM_NORMAL, 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, m_reset_all_btn, and set_default_normal().

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_timer()

void Slic3r::GUI::SyncAmsInfoDialog::on_timer ( wxTimerEvent & event)

show auto refill

2230{
2232
2234 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2235 if (!dev) return;
2236 MachineObject *obj_ = dev->get_selected_machine();
2237 if (!obj_) return;
2238
2239 if (!m_check_flag && obj_->is_info_ready()) {
2241 m_check_flag = true;
2242 }
2243
2244 if (!obj_ || !obj_->GetFilaSystem()->HasAms() || obj_->ams_exist_bits == 0 || !obj_->is_support_filament_backup || !obj_->GetExtderSystem()->HasFilamentBackup() ||
2245 !obj_->GetFilaSystem()->IsAutoRefillEnabled() || m_checkbox_list["use_ams"]->getValue() != "on") {
2246 if (m_ams_backup_tip && m_ams_backup_tip->IsShown()) {
2247 m_ams_backup_tip->Hide();
2248 img_ams_backup->Hide();
2249 Layout();
2250 Fit();
2251 }
2252 } else {
2253 if (m_ams_backup_tip && !m_ams_backup_tip->IsShown()) {
2254 m_ams_backup_tip->Show();
2255 img_ams_backup->Show();
2256 Layout();
2257 Fit();
2258 }
2259 }
2260}
bool m_check_flag
Definition SyncAmsInfoDialog.hpp:55
void update_select_layout(MachineObject *obj)
Definition SyncAmsInfoDialog.cpp:174
void update_show_status()
Definition SyncAmsInfoDialog.cpp:2262
wxStaticBitmap * img_ams_backup
Definition SyncAmsInfoDialog.hpp:120

References Slic3r::MachineObject::ams_exist_bits, Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetFilaSystem(), Slic3r::DevExtderSystem::HasFilamentBackup(), img_ams_backup, Slic3r::MachineObject::is_info_ready(), Slic3r::MachineObject::is_support_filament_backup, m_ams_backup_tip, m_check_flag, m_checkbox_list, update_select_layout(), 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::SyncAmsInfoDialog::popup_filament_backup ( )
1190{
1191 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1192 if (!dev) return;
1193 if (dev->get_selected_machine() /* && dev->get_selected_machine()->filam_bak.size() > 0*/) {
1194 AmsReplaceMaterialDialog *m_replace_material_popup = new AmsReplaceMaterialDialog(this);
1195 m_replace_material_popup->update_machine_obj(dev->get_selected_machine());
1196 m_replace_material_popup->ShowModal();
1197 }
1198}

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

Here is the call graph for this function:

◆ prepare()

void Slic3r::GUI::SyncAmsInfoDialog::prepare ( int print_plate_idx)
1639{ m_print_plate_idx = print_plate_idx; }

References m_print_plate_idx.

◆ prepare_mode()

void Slic3r::GUI::SyncAmsInfoDialog::prepare_mode ( bool refresh_button = true)
1201{
1202 // disable combobox
1203 Enable_Auto_Refill(true);
1205
1206 m_is_in_sending_mode = false;
1207 if (wxIsBusy()) wxEndBusyCursor();
1208
1211 for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) { it->second->item->enable(); }
1212 }
1213}
void Enable_Auto_Refill(bool enable)
Definition SyncAmsInfoDialog.cpp:2010
@ PrintPageModePrepare
Definition SelectMachine.hpp:89

References Enable_Auto_Refill(), m_is_in_sending_mode, m_materialList, m_print_page_mode, Slic3r::GUI::PrintPageModePrepare, and show_print_failed_info().

Referenced by 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::SyncAmsInfoDialog::record_edge_pixels_data ( )
3045{
3046 auto is_not_in_preview_colors = [this](unsigned char r, unsigned char g, unsigned char b, unsigned char a) {
3047 for (size_t i = 0; i < m_preview_colors_in_thumbnail.size(); i++) {
3048 wxColour render_color = adjust_color_for_render(m_preview_colors_in_thumbnail[i]);
3049 if (render_color.Red() == r && render_color.Green() == g && render_color.Blue() == b /*&& render_color.Alpha() == a*/) { return false; }
3050 }
3051 return true;
3052 };
3053 ThumbnailData &data = m_cur_no_light_thumbnail_data;
3054 ThumbnailData &origin_data = m_cur_input_thumbnail_data;
3055 if (data.width > 0 && data.height > 0) {
3056 m_edge_pixels.resize(data.width * data.height);
3057 for (unsigned int r = 0; r < data.height; ++r) {
3058 unsigned int rr = (data.height - 1 - r) * data.width;
3059 for (unsigned int c = 0; c < data.width; ++c) {
3060 unsigned char *no_light_px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
3061 unsigned char *origin_px = (unsigned char *) origin_data.pixels.data() + 4 * (rr + c);
3062 m_edge_pixels[r * data.width + c] = false;
3063 if (origin_px[3] > 0) {
3064 if (is_not_in_preview_colors(no_light_px[0], no_light_px[1], no_light_px[2], origin_px[3])) { m_edge_pixels[r * data.width + c] = true; }
3065 }
3066 }
3067 }
3068 }
3069}

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:

◆ reinit_dialog()

void Slic3r::GUI::SyncAmsInfoDialog::reinit_dialog ( )
1139{
1140 /* reset timeout and reading printer info */
1141 m_timeout_count = 0;
1142 m_ams_mapping_res = false;
1143 m_ams_mapping_valid = false;
1144 m_ams_mapping_result.clear();
1146
1149}
bool m_ams_mapping_valid
Definition SyncAmsInfoDialog.hpp:54
bool m_ams_mapping_res
Definition SyncAmsInfoDialog.hpp:53

References m_ams_mapping_res, m_ams_mapping_result, m_ams_mapping_valid, m_preview_colors_in_thumbnail, m_timeout_count, Slic3r::GUI::PrintStatusInit, show_status(), and update_show_status().

Referenced by set_info(), and Show().

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_all_ams_info()

void Slic3r::GUI::SyncAmsInfoDialog::reset_all_ams_info ( )
2467{
2468 for (int i = 0; i < m_ams_mapping_result.size(); i++) {
2469 reset_one_ams_material(std::to_string(i+1),true);
2470 }
2473 m_reset_all_btn->Hide();
2474 Refresh();
2475}
void update_final_thumbnail_data()
Definition SyncAmsInfoDialog.cpp:3176
void reset_one_ams_material(const std::string &index_str, bool reset_to_first=false)
Definition SyncAmsInfoDialog.cpp:2477

References m_ams_mapping_result, m_reset_all_btn, reset_one_ams_material(), sync_ams_mapping_result(), and update_final_thumbnail_data().

Referenced by SyncAmsInfoDialog().

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

◆ reset_ams_material()

void Slic3r::GUI::SyncAmsInfoDialog::reset_ams_material ( )
2455{
2456 MaterialHash::iterator iter = m_materialList.begin();
2457 while (iter != m_materialList.end()) {
2458 int id = iter->first;
2459 Material * item = iter->second;
2460 auto m = item->item;
2461 m->reset_ams_info();
2462 iter++;
2463 }
2464}

References Slic3r::GUI::Material::item, m_materialList, and Slic3r::GUI::MaterialItem::reset_ams_info().

Referenced by do_ams_mapping().

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

◆ reset_and_sync_ams_list()

void Slic3r::GUI::SyncAmsInfoDialog::reset_and_sync_ams_list ( )
2590{
2591 BOOST_LOG_TRIVIAL(info) <<__FUNCTION__;
2592 // for black list
2593 std::vector<std::string> materials;
2594 std::vector<std::string> brands;
2595 std::vector<std::string> display_materials;
2596 std::vector<std::string> m_filaments_id;
2597 auto preset_bundle = wxGetApp().preset_bundle;
2598
2599 for (auto filament_name : preset_bundle->filament_presets) {
2600 for (int f_index = 0; f_index < preset_bundle->filaments.size(); f_index++) {
2601 PresetCollection *filament_presets = &wxGetApp().preset_bundle->filaments;
2602 Preset * preset = &filament_presets->preset(f_index);
2603 int size = preset_bundle->filaments.size();
2604 if (preset && filament_name.compare(preset->name) == 0) {
2605 std::string display_filament_type;
2606 std::string filament_type = preset->config.get_filament_type(display_filament_type);
2607 std::string m_filament_id = preset->filament_id;
2608 display_materials.push_back(display_filament_type);
2609 materials.push_back(filament_type);
2610 m_filaments_id.push_back(m_filament_id);
2611
2612 std::string m_vendor_name = "";
2613 auto vendor = dynamic_cast<ConfigOptionStrings *>(preset->config.option("filament_vendor"));
2614 if (vendor && (vendor->values.size() > 0)) {
2615 std::string vendor_name = vendor->values[0];
2616 m_vendor_name = vendor_name;
2617 }
2618 brands.push_back(m_vendor_name);
2619 }
2620 }
2621 }
2622 /*std::vector<int> extruders;
2623 if (m_specify_plate_idx == -1) {
2624 extruders = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_used_extruders();
2625 } else {
2626 extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders();
2627 }*/
2628 std::vector<int> extruders(wxGetApp().plater()->get_extruders_colors().size());
2629 std::iota(extruders.begin(), extruders.end(), 1);
2630 BitmapCache bmcache;
2631 MaterialHash::iterator iter = m_materialList.begin();
2632 while (iter != m_materialList.end()) {
2633 int id = iter->first;
2634 Material *item = iter->second;
2635 item->item->Destroy();
2636 delete item;
2637 iter++;
2638 }
2639
2640 m_sizer_ams_mapping->Clear();
2641 m_materialList.clear();
2642 m_filaments.clear();
2643
2644 // Mixed-color slots are virtual: they never occupy a tray, so they must not appear as
2645 // AMS sync targets.
2646 auto* is_mixed_opt = preset_bundle->project_config.option<ConfigOptionBools>("filament_is_mixed");
2647
2648 bool use_double_extruder = get_is_double_extruder();
2649 if (use_double_extruder) {
2650 const auto &project_config = preset_bundle->project_config;
2651 m_filaments_map = wxGetApp().plater()->get_partplate_list().get_curr_plate()->get_real_filament_maps(project_config);
2652 }
2653 auto contronal_index = 0;
2654 int item_index = 1;
2655 bool is_first_row = true;
2656 for (auto i = 0; i < extruders.size(); i++) {
2657 auto extruder = extruders[i] - 1;
2658 auto colour = wxGetApp().preset_bundle->project_config.opt_string("filament_colour", (unsigned int) extruder);
2659 unsigned char rgb[4];
2660 bmcache.parse_color4(colour, rgb);
2661
2662 auto colour_rgb = wxColour((int) rgb[0], (int) rgb[1], (int) rgb[2], (int) rgb[3]);
2663 if (extruder >= materials.size() || extruder < 0 || extruder >= display_materials.size())
2664 continue;
2665 if (is_mixed_opt && extruder < (int) is_mixed_opt->values.size() && is_mixed_opt->values[extruder])
2666 continue;
2667
2668 if (contronal_index % SYNC_FLEX_GRID_COL == 0) {
2669 wxBoxSizer *ams_tip_sizer = new wxBoxSizer(wxVERTICAL);
2670 if (is_first_row) {
2671 is_first_row = false;
2673 m_original_in_colormap = new wxStaticText(m_filament_panel, wxID_ANY, _L_CONTEXT(L_CONTEXT("Original", "Sync_AMS"), "Sync_AMS") + ":");
2674 m_original_in_colormap->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
2676 }
2677 ams_tip_sizer->Add(m_original_in_colormap, 0, wxALIGN_LEFT | wxTOP, FromDIP(6));
2678
2680 m_ams_or_ext_text_in_colormap = new wxStaticText(m_filament_panel, wxID_ANY, _L("AMS") + ":");
2681 m_ams_or_ext_text_in_colormap->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#363636"))); // ORCA match label colors
2683 }
2684 ams_tip_sizer->Add(m_ams_or_ext_text_in_colormap, 0, wxALIGN_LEFT | wxTOP, FromDIP(9));
2685 }
2686 m_sizer_ams_mapping->Add(ams_tip_sizer, 0, wxALIGN_LEFT | wxTOP, FromDIP(2));
2687 contronal_index++;
2688 }
2689
2690 MaterialSyncItem *item = nullptr;
2691 if (use_double_extruder) {
2692 if (m_filaments_map[extruder] == 1) {
2693 item = new MaterialSyncItem(m_filament_panel, colour_rgb, _L(display_materials[extruder])); // m_filament_left_panel//special
2694 m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5)); // m_sizer_ams_mapping_left
2695 } else if (m_filaments_map[extruder] == 2) {
2696 item = new MaterialSyncItem(m_filament_panel, colour_rgb, _L(display_materials[extruder])); // m_filament_right_panel
2697 m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5)); // m_sizer_ams_mapping_right
2698 }
2699 else {
2700 BOOST_LOG_TRIVIAL(error) << "check error:MaterialItem *item = nullptr";
2701 continue;
2702 }
2703 } else {
2704 item = new MaterialSyncItem(m_filament_panel, colour_rgb, _L(display_materials[extruder]));
2705 m_sizer_ams_mapping->Add(item, 0, wxALL, FromDIP(5));
2706 }
2707 auto item_index_str = std::to_string(item_index);
2708 item->set_material_index_str(item_index_str);
2709 item_index++;
2710
2711 contronal_index++;
2712 item->Bind(wxEVT_LEFT_UP, [materials](wxMouseEvent &e) {});
2713 item->Bind(wxEVT_LEFT_DOWN, [this, item, materials, extruder, item_index_str](wxMouseEvent &e) {
2714 MaterialHash::iterator iter = m_materialList.begin();
2715 while (iter != m_materialList.end()) {
2716 int id = iter->first;
2717 Material * item = iter->second;
2718 auto m = item->item;
2719 m->on_normal();
2720 iter++;
2721 }
2722
2723 m_current_filament_id = extruder;
2724 item->on_selected();
2725
2726 auto mouse_pos = ClientToScreen(e.GetPosition());
2727 wxPoint rect = item->ClientToScreen(wxPoint(0, 0));
2728
2729 // update ams data
2730 DeviceManager *dev_manager = Slic3r::GUI::wxGetApp().getDeviceManager();
2731 if (!dev_manager) return;
2732 MachineObject *obj_ = dev_manager->get_selected_machine();
2733 bool is_selector = false;
2734 if (get_is_double_extruder()) {
2735 if (has_selector(obj_)) { // FTS combined view — one dynamic panel when a switch is installed+ready
2737 is_selector = true;
2738 } else {
2739 m_mapping_popup.set_show_type(ShowType::LEFT_AND_RIGHT);//special
2740 }
2741 }
2742 // m_mapping_popup.set_show_type(ShowType::RIGHT);
2743 if (obj_) {
2744 if (m_mapping_popup.IsShown())
2745 return;
2746 wxPoint pos = item->ClientToScreen(wxPoint(0, 0));
2747 pos.y += item->GetRect().height;
2748 m_mapping_popup.Move(pos);
2749
2750 if (obj_ && m_checkbox_list["use_ams"]->getValue() == "on") {
2751 m_mapping_popup.set_parent_item(item);
2752 m_mapping_popup.set_current_filament_id(extruder);
2753 m_mapping_popup.set_material_index_str(item_index_str);
2754 m_mapping_popup.show_reset_button();
2755 auto reset_call_back = [this](const std::string &item_index_str) {
2756 reset_one_ams_material(item_index_str);
2758 m_mapping_popup.update_items_check_state(m_ams_mapping_result);
2759 m_mapping_popup.Refresh();
2760 if (!m_reset_all_btn->IsShown()) {
2761 m_reset_all_btn->Show();
2762 }
2763 };
2764 m_mapping_popup.set_reset_callback(reset_call_back);
2765 m_mapping_popup.set_tag_texture(materials[extruder]);
2766 m_mapping_popup.set_send_win(this);
2767 m_mapping_popup.update(obj_, m_ams_mapping_result, is_selector); // Orca: dynamic combined view when FTS installed
2768 m_mapping_popup.Popup();
2769 }
2770 }
2771 });
2772
2773 Material *material_item = new Material();
2774 material_item->id = extruder;
2775 material_item->item = item;
2776 m_materialList[i] = material_item;
2777
2778 // build for ams mapping
2779 if (extruder < materials.size() && extruder >= 0) {
2780 FilamentInfo info;
2781 info.id = extruder;
2782 info.type = materials[extruder];
2783 info.brand = brands[extruder];
2784 info.filament_id = m_filaments_id[extruder];
2785 info.color = wxString::Format("#%02X%02X%02X%02X", colour_rgb.Red(), colour_rgb.Green(), colour_rgb.Blue(), colour_rgb.Alpha()).ToStdString();
2786 m_filaments.push_back(info);
2787 }
2788 }
2789 if (use_double_extruder) {
2790 //m_filament_left_panel->Show();//SyncAmsInfoDialog::reset_and_sync_ams_list()
2791 //m_filament_right_panel->Show();
2792 m_filament_panel->Show(); // SyncAmsInfoDialog::reset_and_sync_ams_list()//special
2793 m_sizer_ams_mapping_left->SetCols(4);
2794 m_sizer_ams_mapping_left->Layout();
2796 m_filament_left_panel->Layout();
2797
2798 m_sizer_ams_mapping_right->SetCols(4);
2799 m_sizer_ams_mapping_right->Layout();
2801 m_filament_right_panel->Layout();
2802 } else {
2803 //m_filament_left_panel->Hide();//SyncAmsInfoDialog::reset_and_sync_ams_list()
2804 //m_filament_right_panel->Hide();
2805 m_filament_panel->Show();//SyncAmsInfoDialog::reset_and_sync_ams_list()
2807 m_sizer_ams_mapping->Layout();
2808 m_filament_panel_sizer->Layout();
2809 }
2810 // reset_ams_material();//show "-"
2811}
wxStaticText * m_original_in_colormap
Definition SyncAmsInfoDialog.hpp:113
@ LEFT_AND_RIGHT_DYNAMIC
Definition AmsMappingPopup.hpp:81
@ LEFT_AND_RIGHT
Definition AmsMappingPopup.hpp:80

References _L, _L_CONTEXT, Slic3r::FilamentGroupUtils::FilamentInfo::color, Slic3r::Preset::config, StateColor::darkModeColorFor(), Slic3r::Preset::filament_id, Slic3r::filament_type(), Slic3r::DynamicPrintConfig::get_filament_type(), get_is_double_extruder(), Slic3r::DeviceManager::get_selected_machine(), has_selector(), Label::Head_12, Slic3r::GUI::Material::id, Slic3r::GUI::Material::item, L_CONTEXT, Slic3r::GUI::LEFT_AND_RIGHT, Slic3r::GUI::LEFT_AND_RIGHT_DYNAMIC, m_ams_mapping_result, m_ams_or_ext_text_in_colormap, m_checkbox_list, m_current_filament_id, 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_original_in_colormap, m_reset_all_btn, 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::GUI::plater(), Slic3r::PresetCollection::preset(), reset_one_ams_material(), Slic3r::GUI::MaterialSyncItem::set_material_index_str(), SYNC_FLEX_GRID_COL, Slic3r::FilamentGroupUtils::FilamentInfo::type, update_final_thumbnail_data(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by set_default().

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

◆ reset_one_ams_material()

void Slic3r::GUI::SyncAmsInfoDialog::reset_one_ams_material ( const std::string & index_str,
bool reset_to_first = false )
2478{
2479 MaterialHash::iterator iter = m_materialList.begin();
2480 while (iter != m_materialList.end()) {
2481 int id = iter->first;
2482 Material *item = iter->second;
2483 auto m = dynamic_cast<MaterialSyncItem*> (item->item);
2484 if (m && m->get_material_index_str() == index_str) {
2485 if (reset_to_first) {
2486 m->reset_valid_info();
2487 } else {
2488 m->reset_ams_info();
2489 }
2490
2491 int index = std::atoi(index_str.c_str()) - 1;
2492 if (index >=0 && index < m_back_ams_mapping_result.size()) {
2493 if (reset_to_first) {
2495 } else {
2496 m_ams_mapping_result[index].ams_id = "";
2497 m_ams_mapping_result[index].slot_id = "";
2498 m_ams_mapping_result[index].color = "";
2499 }
2500 }
2501 break;
2502 }
2503 iter++;
2504 }
2505}
std::vector< FilamentInfo > m_back_ams_mapping_result
Definition SyncAmsInfoDialog.hpp:71

References Slic3r::GUI::Material::item, m_ams_mapping_result, m_back_ams_mapping_result, and m_materialList.

Referenced by reset_all_ams_info(), and reset_and_sync_ams_list().

Here is the caller graph for this function:

◆ reset_timeout()

void Slic3r::GUI::SyncAmsInfoDialog::reset_timeout ( )
2165{ m_timeout_count = 0; }

References m_timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ scale_factor()

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

◆ set_check_dirty_fialment()

void Slic3r::GUI::SyncAmsInfoDialog::set_check_dirty_fialment ( bool flag)
inline
283{ m_check_dirty_fialment = flag; };

References m_check_dirty_fialment.

◆ set_default()

void Slic3r::GUI::SyncAmsInfoDialog::set_default ( bool hide_some = false)
2532{
2534 bool is_show = true;
2536 bool is_show = false;
2537 }
2538
2539 wxString filename = m_plater->get_export_gcode_filename("", true, m_print_plate_idx == PLATE_ALL_IDX ? true : false);
2540 if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) { filename = _L("Untitled"); }
2541
2542 if (filename.empty()) {
2543 filename = m_plater->get_export_gcode_filename("", true);
2544 if (filename.empty()) filename = _L("Untitled");
2545 }
2546
2547 fs::path filename_path(filename.c_str());
2548 std::string file_name = filename_path.filename().string();
2549 if (from_u8(file_name).find(_L("Untitled")) != wxString::npos) {
2550 PartPlate *part_plate = m_plater->get_partplate_list().get_plate(m_print_plate_idx);
2551 if (part_plate) {
2552 if (std::vector<ModelObject *> objects = part_plate->get_objects_on_this_plate(); objects.size() > 0) {
2553 file_name = objects[0]->name;
2554 for (int i = 1; i < objects.size(); i++) { file_name += (" + " + objects[i]->name); }
2555 }
2556 if (file_name.size() > 100) { file_name = file_name.substr(0, 97) + "..."; }
2557 }
2558 }
2559 m_current_project_name = wxString::FromUTF8(file_name);
2560
2561 // unsupported character filter
2562 m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
2563
2564 // clear combobox
2565 m_list.clear();
2566 m_print_info = "";
2567 // rset status bar
2568
2569 NetworkAgent *agent = wxGetApp().getAgent();
2570 if (agent) {
2571 if (!hide_some) {
2572 if (agent->is_user_login(wxGetApp().get_printer_cloud_provider())) {
2574 }
2575 }
2576 }
2577
2580 m_cur_input_thumbnail_data = m_specify_plate_idx == -1 ? m_plater->get_partplate_list().get_curr_plate()->thumbnail_data :
2581 m_plater->get_partplate_list().get_plate(m_specify_plate_idx)->thumbnail_data;
2583 }
2584
2585 Layout();
2586 Fit();
2587}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
std::vector< MachineObject * > m_list
Definition SyncAmsInfoDialog.hpp:68
wxString m_current_project_name
Definition SyncAmsInfoDialog.hpp:60
std::string m_print_info
Definition SyncAmsInfoDialog.hpp:59
void reset_and_sync_ams_list()
Definition SyncAmsInfoDialog.cpp:2589
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_cur_input_thumbnail_data, m_current_project_name, m_list, m_plater, m_print_info, m_print_plate_idx, m_print_type, m_specify_plate_idx, PLATE_ALL_IDX, Slic3r::GUI::PrintStatusInit, reset_and_sync_ams_list(), set_default_normal(), and show_status().

Referenced by Show().

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

◆ set_default_normal()

void Slic3r::GUI::SyncAmsInfoDialog::set_default_normal ( const ThumbnailData & data)
180{
182 auto & temp_data = m_cur_input_thumbnail_data;
183 wxImage image(temp_data.width, temp_data.height);
184 image.InitAlpha();
185 for (unsigned int r = 0; r < temp_data.height; ++r) {
186 unsigned int rr = (temp_data.height - 1 - r) * temp_data.width;
187 for (unsigned int c = 0; c < temp_data.width; ++c) {
188 unsigned char *px = (unsigned char *) temp_data.pixels.data() + 4 * (rr + c);
189 image.SetRGB((int) c, (int) r, px[0], px[1], px[2]);
190 image.SetAlpha((int) c, (int) r, px[3]);
191 }
192 }
193 //image.SaveFile("preview-left.png", wxBITMAP_TYPE_PNG);
194 image = image.Rescale(FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH), FromDIP(LEFT_THUMBNAIL_SIZE_WIDTH), wxIMAGE_QUALITY_BOX_AVERAGE);
195 m_left_image_button->SetBitmap(image);
196 }
197 if (data.is_valid() && m_right_image_button) {
198 wxImage image(data.width, data.height);
199 image.InitAlpha();
200 for (unsigned int r = 0; r < data.height; ++r) {
201 unsigned int rr = (data.height - 1 - r) * data.width;
202 for (unsigned int c = 0; c < data.width; ++c) {
203 unsigned char *px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
204 image.SetRGB((int) c, (int) r, px[0], px[1], px[2]);
205 image.SetAlpha((int) c, (int) r, px[3]);
206 }
207 }
208 //image.SaveFile("preview-right.png", wxBITMAP_TYPE_PNG);
209 image = image.Rescale(FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), FromDIP(RIGHT_THUMBNAIL_SIZE_WIDTH), wxIMAGE_QUALITY_BOX_AVERAGE);
210 m_right_image_button->SetBitmap(image);
211 auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders();
212 if (wxGetApp().plater()->get_extruders_colors().size() == extruders.size()) {
213 //m_used_colors_tip_text->Hide();
214 }
215 else {
216 //m_used_colors_tip_text->Show();
217 //m_used_colors_tip_text->SetLabel(" (" + std::to_string(extruders.size()) + " " + _L("colors used") + ")");
218 }
219 }
222 }
223}
std::vector< wxColour > m_back_cur_colors_in_thumbnail
Definition SyncAmsInfoDialog.hpp:126
int64_t px(const Point &pt)
Definition ClipperUtils.cpp:207

References ColorMap, Slic3r::ThumbnailData::height, Slic3r::ThumbnailData::is_valid(), LEFT_THUMBNAIL_SIZE_WIDTH, m_back_cur_colors_in_thumbnail, m_cur_colors_in_thumbnail, m_cur_input_thumbnail_data, m_left_image_button, m_map_mode, m_right_image_button, m_specify_plate_idx, Slic3r::ThumbnailData::pixels, Slic3r::GUI::plater(), RIGHT_THUMBNAIL_SIZE_WIDTH, 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_info()

void Slic3r::GUI::SyncAmsInfoDialog::set_info ( SyncInfo & info)
3273{
3274 m_input_info = info;
3275 reinit_dialog();
3276}
void reinit_dialog()
Definition SyncAmsInfoDialog.cpp:1138

References m_input_info, and reinit_dialog().

Here is the call graph for this function:

◆ set_prev_scale_factor()

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

◆ set_print_type()

void Slic3r::GUI::SyncAmsInfoDialog::set_print_type ( PrintFromType type)
inline
231{ 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::SyncAmsInfoDialog::Show ( bool show)
override
104{
105 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " SyncAmsInfoDialog begin show";
106 if (show) {
107 if (m_two_image_panel) {
108 m_two_image_panel->SetBackgroundColor(wxGetApp().dark_mode() ? wxColour(48, 48, 48, 100) : wxColour(246, 246, 246, 100));
109 m_left_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
110 m_right_image_button->SetBackgroundColour(wxGetApp().dark_mode() ? wxColour(61, 61, 61, 0) : wxColour(238, 238, 238, 0));
111 init_bitmaps();
112 }
113 if (m_options_other) { m_options_other->Hide(); }
115 } else {
116 m_refresh_timer->Stop();
117 return DPIDialog::Show(false);
118 }
119 // set default value when show this dialog
120 wxGetApp().UpdateDlgDarkUI(this);
121 set_default(true);
124 { // hide and hide
125 m_basic_panel->Hide();
127 }
128 bool dirty_filament = is_dirty_filament();
129 if (m_is_empty_project || dirty_filament) {
130 show_color_panel(false);
131 show_ams_controls(false);
132 m_filament_left_panel->Show(false); // empty_project
133 m_filament_right_panel->Show(false);
134 m_are_you_sure_title->Show(false);
136 m_mode_combox_sizer->Show(false);
137 }
138 }
139 if (dirty_filament) {
140 m_two_thumbnail_panel->Hide();
141 m_confirm_title->Show();
142 m_confirm_title->SetLabel(_L("Synchronizing AMS filaments will discard your modified but unsaved filament presets.\nAre you sure you want to continue?"));
143 } else if (!m_check_dirty_fialment) {
144 show_color_panel(true);
145 m_filament_left_panel->Show(false); // empty_project
146 m_filament_right_panel->Show(false);
147 m_are_you_sure_title->Show(true);
149 m_mode_combox_sizer->Show(true);
150 m_reset_all_btn->Hide();
151 }
152 m_confirm_title->SetLabel(m_undone_str);
153 }
154 m_scrolledWindow->FitInside();
155 m_scrolledWindow->Scroll(0, 0);
156 Layout();
157 Fit();
158 CenterOnScreen();
159
160 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " SyncAmsInfoDialog finish show";
161 return DPIDialog::Show(show);
162}
void set_default(bool hide_some=false)
Definition SyncAmsInfoDialog.cpp:2531
void show_ams_controls(bool flag)
Definition SyncAmsInfoDialog.cpp:3147
void hide_no_use_controls()
Definition SyncAmsInfoDialog.cpp:232
void show_color_panel(bool, bool update_layout=true)
Definition SyncAmsInfoDialog.cpp:469

References _L, hide_no_use_controls(), init_bitmaps(), is_dirty_filament(), LIST_REFRESH_INTERVAL, m_are_you_sure_title, m_basic_panel, m_check_dirty_fialment, m_confirm_title, m_filament_left_panel, m_filament_right_panel, m_is_empty_project, m_left_image_button, m_mode_combox_sizer, m_options_other, m_refresh_timer, m_reset_all_btn, m_right_image_button, m_scrolledWindow, m_two_image_panel, m_two_thumbnail_panel, m_undone_str, reinit_dialog(), set_default(), show_ams_controls(), show_color_panel(), and update_user_machine_list().

Here is the call graph for this function:

◆ show_advanced_settings()

void Slic3r::GUI::SyncAmsInfoDialog::show_advanced_settings ( bool flag,
bool update_layout = true )
3137{
3139 if (!flag) {
3142 } else {
3143 update_more_setting(update_layout);
3144 }
3145}

References m_advace_setting_sizer, m_append_color_sizer, m_merge_color_sizer, show_sizer(), and update_more_setting().

Referenced by show_color_panel(), and update_thumbnail_data_accord_plate_index().

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

◆ show_ams_controls()

void Slic3r::GUI::SyncAmsInfoDialog::show_ams_controls ( bool flag)
3148{
3149 m_filament_panel->Show(flag);
3150 if (flag) { m_filament_panel->Fit(); }
3151 m_attention_text->Show(flag);
3152 m_tip_text->Show(flag);
3153}

References m_attention_text, m_filament_panel, and m_tip_text.

Referenced by Show(), updata_ui_data_after_connected_printer(), and update_when_change_map_mode().

Here is the caller graph for this function:

◆ show_color_panel()

void Slic3r::GUI::SyncAmsInfoDialog::show_color_panel ( bool flag,
bool update_layout = true )
private
470{
471 //show_sizer(m_plate_combox_sizer, flag);
472 show_advanced_settings(flag, update_layout);
473 m_confirm_title->Show(flag);
474 m_are_you_sure_title->Show(flag);
475 if (flag) {
476 auto extruders = wxGetApp().plater()->get_partplate_list().get_plate(m_specify_plate_idx)->get_extruders();
477 /*if (wxGetApp().plater()->get_extruders_colors().size() != extruders.size()) {
478 m_used_colors_tip_text->Show();
479 }*/
480 } else {
481 //m_used_colors_tip_text->Hide();
482 }
483 if (update_layout){
484 Layout();
485 Fit();
486 }
487}
void show_advanced_settings(bool flag, bool update_layout=true)
Definition SyncAmsInfoDialog.cpp:3136

References m_are_you_sure_title, m_confirm_title, m_specify_plate_idx, and show_advanced_settings().

Referenced by Show(), updata_ui_when_priner_not_same(), and update_when_change_map_mode().

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

◆ show_errors()

void Slic3r::GUI::SyncAmsInfoDialog::show_errors ( wxString & info)
2004{
2005 ConfirmBeforeSendDialog confirm_dlg(this, wxID_ANY, _L("Errors"));
2006 confirm_dlg.update_text(info);
2007 confirm_dlg.on_show();
2008}

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

Here is the call graph for this function:

◆ show_print_failed_info()

void Slic3r::GUI::SyncAmsInfoDialog::show_print_failed_info ( bool show,
int code = 0,
wxString description = wxEmptyString,
wxString extra = wxEmptyString )
1179{
1180 //todo
1181}

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

Here is the caller graph for this function:

◆ show_sizer()

void Slic3r::GUI::SyncAmsInfoDialog::show_sizer ( wxSizer * sizer,
bool show )
243{
244 if (!sizer) { return; }
245 wxSizerItemList items = sizer->GetChildren();
246 for (wxSizerItemList::iterator it = items.begin(); it != items.end(); ++it) {
247 wxSizerItem *item = *it;
248 if (wxWindow *window = item->GetWindow()) { window->Show(show); }
249 if (wxSizer *son_sizer = item->GetSizer()) { show_sizer(son_sizer, show); }
250 }
251}

References show_sizer().

Referenced by hide_no_use_controls(), show_advanced_settings(), show_sizer(), and update_more_setting().

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

◆ show_status()

void Slic3r::GUI::SyncAmsInfoDialog::show_status ( PrintDialogStatus status,
std::vector< wxString > params = std::vector<wxString>() )
1767{
1768 if (m_print_status != status) {
1769 m_result.is_same_printer = true;
1770 BOOST_LOG_TRIVIAL(info) << "select_machine_dialog: show_status = " << status << "(" << PrePrintChecker::get_print_status_info(status) << ")";
1771 }
1772 m_print_status = status;
1773
1774 // other
1775 if (status == PrintDialogStatus::PrintStatusInit) {
1776 update_print_status_msg(wxEmptyString, false, false);
1777 } else if (status == PrintDialogStatus::PrintStatusInvalidPrinter) {
1778 update_print_status_msg(wxEmptyString, true, true);
1780 wxString msg_text = _L("Connecting to server...");
1781 update_print_status_msg(msg_text, true, true);
1782 } else if (status == PrintDialogStatus::PrintStatusReading) {
1783 wxString msg_text = _L("Synchronizing device information...");
1784 update_print_status_msg(msg_text, false, true);
1785 } else if (status == PrintDialogStatus::PrintStatusReadingFinished) {
1786 update_print_status_msg(wxEmptyString, false, true);
1787 } else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
1788 wxString msg_text = _L("Synchronizing device information timed out.");
1789 update_print_status_msg(msg_text, true, true);
1790 } else if (status == PrintDialogStatus::PrintStatusInUpgrading) {
1791 wxString msg_text = _L("Cannot send a print job while the printer is updating firmware.");
1792 update_print_status_msg(msg_text, true, true);
1794 wxString msg_text = _L("The printer is executing instructions. Please restart printing after it ends.");
1795 update_print_status_msg(msg_text, true, true);
1796 } else if (status == PrintDialogStatus::PrintStatusInPrinting) {
1797 wxString msg_text = _L("The printer is busy with another print job.");
1798 update_print_status_msg(msg_text, true, true);
1800 update_print_status_msg(wxEmptyString, false, false);
1804 update_print_status_msg(wxEmptyString, true, false);
1806 wxString msg_text = _L("Please do not mix-use the Ext with AMS.");
1807 update_print_status_msg(msg_text, true, false);
1809 wxString msg_text = _L("Invalid nozzle information, please refresh or manually set nozzle information.");
1810 update_print_status_msg(msg_text, true, false);
1812 wxString msg_text = _L("Please check whether the nozzle type of the device is the same as the preset nozzle type.");
1813 update_print_status_msg(msg_text, true, false);
1815 wxString msg_text;
1816 if (params.size() > 1)
1817 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."),
1818 params[0], params[1]);
1819 else
1820 msg_text = _L("Filament does not match the filament in AMS slot. Please update the printer firmware to support AMS slot assignment.");
1822 update_print_status_msg(wxEmptyString, false, true);
1823 } else if (status == PrintDialogStatus::PrintStatusSending) {
1824 } else if (status == PrintDialogStatus::PrintStatusSendingCanceled) {
1825 } else if (status == PrintDialogStatus::PrintStatusLanModeNoSdcard) {
1826 wxString msg_text = _L("Storage needs to be inserted before printing via LAN.");
1827 update_print_status_msg(msg_text, true, true);
1829 wxString msg_text = _L("Storage is not available or is in read-only mode.");
1830 update_print_status_msg(msg_text, true, true);
1831 } else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
1832 wxString msg_text = _L("Storage needs to be inserted before printing.");
1833 update_print_status_msg(msg_text, true, true);
1835 wxString msg_text;
1836 try {
1837 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1838 if (!dev) return;
1839
1840 // source print
1841 MachineObject *obj_ = dev->get_selected_machine();
1842 if (obj_ == nullptr) return;
1843 auto sourcet_print_name = obj_->get_printer_type_display_str();
1844 sourcet_print_name.Replace(wxT("Bambu Lab "), wxEmptyString);
1845
1846 // target print
1847 std::string target_model_id;
1849 PresetBundle *preset_bundle = wxGetApp().preset_bundle;
1850 target_model_id = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
1852 if (m_required_data_plate_data_list.size() > 0) { target_model_id = m_required_data_plate_data_list[m_print_plate_idx]->printer_model_id; }
1853 }
1854
1855 auto target_print_name = wxString(DevPrinterConfigUtil::get_printer_display_name(target_model_id));
1856 target_print_name.Replace(wxT("Bambu Lab "), wxEmptyString);
1857 msg_text = wxString::Format(_L("The selected printer (%s) is incompatible with the chosen printer profile in the slicer (%s)."), sourcet_print_name,
1858 target_print_name);
1859 if (m_result.is_same_printer) {
1860 m_result.is_same_printer = false;
1862 }
1863 return;
1864 } catch (...) {}
1866 wxString msg_text = _L("Storage needs to be inserted to record timelapse.");
1867 update_print_status_msg(msg_text, true, true);
1869 wxString msg_text = _L("Cannot send the print job to a printer whose firmware must be updated.");
1870 update_print_status_msg(msg_text, true, true);
1872 wxString msg_text = _L("Cannot send the print job to a printer whose firmware must be updated.");
1873 update_print_status_msg(msg_text, true, true);
1874 } else if (status == PrintDialogStatus::PrintStatusBlankPlate) {
1875 wxString msg_text = _L("Cannot send a print job for an empty plate.");
1876 update_print_status_msg(msg_text, true, true);
1878 wxString msg_text = _L("This printer does not support printing all plates.");
1879 update_print_status_msg(msg_text, true, true);
1881 wxString msg_text;
1882 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
1883 for (auto warning : plate->get_slice_result()->warnings) {
1884 if (warning.msg == NOT_GENERATE_TIMELAPSE) {
1885 if (warning.error_code == "10014001") {
1886 msg_text = _L("When spiral vase mode is enabled, machines with I3 structure will not generate timelapse videos.");
1887 } else if (warning.error_code == "10014002") {
1888 msg_text = _L("Timelapse is not supported because Print sequence is set to \"By object\".");
1889 }
1890 }
1891 }
1892 update_print_status_msg(msg_text, true, true);
1893 } else if (status == PrintStatusMixAmsAndVtSlotWarning) {
1894 wxString msg_text = _L("You selected external and AMS filament at the same time in an extruder, you will need manually change external filament.");
1895 update_print_status_msg(msg_text, true, false);
1896 }
1897
1898 // m_panel_warn m_simplebook
1900 ; //
1901 } else {
1902 prepare_mode(false);
1903 }
1904}
static std::string get_printer_display_name(const std::string &type_str)
Definition DevConfigUtil.h:71
static wxString get_pre_state_msg(PrintDialogStatus status)
Definition PrePrintChecker.cpp:100
::std::string get_print_status_info(PrintDialogStatus status)
Definition PrePrintChecker.cpp:23
void updata_ui_when_priner_not_same()
Definition SyncAmsInfoDialog.cpp:667
void update_print_status_msg(wxString msg, bool is_warning=false, bool is_printer=true)
Definition SyncAmsInfoDialog.cpp:1748
@ PrintStatusNeedForceUpgrading
Definition PrePrintChecker.hpp:79
@ PrintStatusReadingTimeout
Definition PrePrintChecker.hpp:60
@ PrintStatusInSystemPrinting
Definition PrePrintChecker.hpp:67
@ PrintStatusAmsMappingMixInvalid
Definition PrePrintChecker.hpp:95
@ PrintStatusReadingFinished
Definition PrePrintChecker.hpp:148
@ PrintStatusAmsMappingInvalid
Definition PrePrintChecker.hpp:93
@ PrintStatusInvalidPrinter
Definition PrePrintChecker.hpp:58
@ PrintStatusUnsupportedPrinter
Definition PrePrintChecker.hpp:83
@ PrintStatusNozzleMatchInvalid
Definition PrePrintChecker.hpp:69
@ PrintStatusNozzleDataInvalid
Definition PrePrintChecker.hpp:70
@ PrintStatusNoSdcard
Definition PrePrintChecker.hpp:77
@ PrintStatusMixAmsAndVtSlotWarning
Definition PrePrintChecker.hpp:111
@ PrintStatusBlankPlate
Definition PrePrintChecker.hpp:82
@ PrintStatusLanModeNoSdcard
Definition PrePrintChecker.hpp:76
@ PrintStatusInPrinting
Definition PrePrintChecker.hpp:68
@ PrintStatusTimelapseWarning
Definition PrePrintChecker.hpp:109
@ PrintStatusConnectingServer
Definition PrePrintChecker.hpp:59
@ PrintStatusAmsMappingSuccess
Definition PrePrintChecker.hpp:153
@ PrintStatusSendingCanceled
Definition PrePrintChecker.hpp:149
@ PrintStatusSending
Definition PrePrintChecker.hpp:75
@ PrintStatusAmsMappingU0Invalid
Definition PrePrintChecker.hpp:94
@ PrintStatusReading
Definition PrePrintChecker.hpp:61
@ PrintStatusNeedConsistencyUpgrading
Definition PrePrintChecker.hpp:80
@ PrintStatusTimelapseNoSdcard
Definition PrePrintChecker.hpp:108
@ PrintStatusLanModeSDcardNotAvailable
Definition PrePrintChecker.hpp:78
@ PrintStatusNotSupportedPrintAll
Definition PrePrintChecker.hpp:81
@ PrintStatusOptionalPrinterModel
Definition PrePrintChecker.hpp:120
@ PrintStatusInUpgrading
Definition PrePrintChecker.hpp:64

References _L, Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::PresetCollection::get_edited_preset(), Slic3r::GUI::PrePrintChecker::get_pre_state_msg(), 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_plater, m_print_plate_idx, m_print_status, m_print_type, m_required_data_plate_data_list, m_result, NOT_GENERATE_TIMELAPSE, prepare_mode(), Slic3r::PresetBundle::printers, Slic3r::GUI::PrintStatusAmsMappingInvalid, Slic3r::GUI::PrintStatusAmsMappingMixInvalid, Slic3r::GUI::PrintStatusAmsMappingSuccess, Slic3r::GUI::PrintStatusAmsMappingU0Invalid, Slic3r::GUI::PrintStatusBlankPlate, Slic3r::GUI::PrintStatusConnectingServer, 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::PrintStatusNeedConsistencyUpgrading, Slic3r::GUI::PrintStatusNeedForceUpgrading, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotSupportedPrintAll, Slic3r::GUI::PrintStatusNozzleDataInvalid, Slic3r::GUI::PrintStatusNozzleMatchInvalid, Slic3r::GUI::PrintStatusOptionalPrinterModel, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingFinished, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusRefreshingMachineList, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::PrintStatusSendingCanceled, Slic3r::GUI::PrintStatusTimelapseNoSdcard, Slic3r::GUI::PrintStatusTimelapseWarning, Slic3r::GUI::PrintStatusUnsupportedPrinter, updata_ui_when_priner_not_same(), update_print_status_msg(), and Slic3r::GCodeProcessorResult::warnings.

Referenced by on_print_job_cancel(), on_refresh(), reinit_dialog(), set_default(), update_printer_combobox(), and update_show_status().

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

◆ show_thumbnail_page()

void Slic3r::GUI::SyncAmsInfoDialog::show_thumbnail_page ( )
1384{
1385 m_pages->ChangeSelection(1);
1386 m_pages->SetMinSize(wxSize(SyncAmsInfoDialogWidth, -1));
1387 m_pages->SetMaxSize(wxSize(SyncAmsInfoDialogWidth, -1));
1388}

References m_pages, and SyncAmsInfoDialogWidth.

Referenced by do_ams_mapping().

Here is the caller graph for this function:

◆ ShowModal()

◆ sort_string()

std::vector< std::string > Slic3r::GUI::SyncAmsInfoDialog::sort_string ( std::vector< std::string > strArray)
2134{
2135 std::vector<std::string> outputArray;
2136 std::sort(strArray.begin(), strArray.end());
2137 std::vector<std::string>::iterator st;
2138 for (st = strArray.begin(); st != strArray.end(); st++) { outputArray.push_back(*st); }
2139
2140 return outputArray;
2141}

Referenced by update_user_printer().

Here is the caller graph for this function:

◆ stripWhiteSpace()

void Slic3r::GUI::SyncAmsInfoDialog::stripWhiteSpace ( std::string & str)
1676{
1677 if (str == "") { return; }
1678
1679 std::string::iterator cur_it;
1680 cur_it = str.begin();
1681
1682 while (cur_it != str.end()) {
1683 if ((*cur_it) == '\n' || (*cur_it) == ' ') {
1684 cur_it = str.erase(cur_it);
1685 } else {
1686 cur_it++;
1687 }
1688 }
1689}

Referenced by update_ams_status_msg(), and update_priner_status_msg().

Here is the caller graph for this function:

◆ sync_ams_mapping_result()

void Slic3r::GUI::SyncAmsInfoDialog::sync_ams_mapping_result ( std::vector< FilamentInfo > & result)
1224{
1226 if (result.empty()) {
1227 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "ams_mapping result is empty";
1228 for (auto it = m_materialList.begin(); it != m_materialList.end(); it++) {
1229 wxString ams_id = _L("Ext");
1230 wxColour ams_col = wxColour(0xCE, 0xCE, 0xCE);
1231 it->second->item->set_ams_info(ams_col, ams_id, true); // sync_ams_mapping_result
1232 }
1233 return;
1234 }
1235 for (auto f = result.begin(); f != result.end(); f++) {
1236 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "ams_mapping f id = " << f->id << ", tray_id = " << f->tray_id << ", color = " << f->color << ", type = " << f->type;
1237
1238 MaterialHash::iterator iter = m_materialList.begin();
1239 while (iter != m_materialList.end()) {
1240 int id = iter->second->id;
1241 Material * item = iter->second;
1242 auto m = item->item;
1243
1244 if (f->id == id) {
1245 wxString ams_id;
1246 wxColour ams_col;
1247
1248 if (f->tray_id == VIRTUAL_TRAY_MAIN_ID || f->tray_id == VIRTUAL_TRAY_DEPUTY_ID) {
1249 ams_id = _L("Ext");
1250 }
1251
1252 else if (f->tray_id >= 0) {
1253 ams_id = wxGetApp().transition_tridid(f->tray_id);
1254 // ams_id = wxString::Format("%02d", f->tray_id + 1);
1255 } else {
1256 ams_id = "-";
1257 }
1258
1259 if (!f->color.empty()) {
1260 ams_col = DevAmsTray::decode_color(f->color);
1261 } else {
1262 // default color
1263 ams_col = wxColour(0xCE, 0xCE, 0xCE);
1264 }
1265 std::vector<wxColour> cols;
1266 for (auto col : f->colors) { cols.push_back(DevAmsTray::decode_color(col)); }
1267 m->set_ams_info(ams_col, ams_id, f->ctype, cols,true);//sync_ams_mapping_result
1268 break;
1269 }
1270 iter++;
1271 }
1272 }
1273 wxString tab_name = wxGetApp().tab_panel()->GetSelectedPageName();
1274 if (tab_name == TAB_ID_PREPARE || tab_name == TAB_ID_PREVIEW) {
1276 }
1277}
#define TAB_ID_PREPARE
Definition MainFrame.hpp:60
#define TAB_ID_PREVIEW
Definition MainFrame.hpp:61
void updata_thumbnail_data_after_connected_printer()
Definition SyncAmsInfoDialog.cpp:3130

References _L, Slic3r::DevAmsTray::decode_color(), Slic3r::f(), Slic3r::GUI::Material::item, m_back_ams_mapping_result, m_materialList, TAB_ID_PREPARE, TAB_ID_PREVIEW, updata_thumbnail_data_after_connected_printer(), VIRTUAL_TRAY_DEPUTY_ID, and VIRTUAL_TRAY_MAIN_ID.

Referenced by do_ams_mapping(), reset_all_ams_info(), and update_show_status().

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

◆ to_next_plate()

void Slic3r::GUI::SyncAmsInfoDialog::to_next_plate ( wxCommandEvent & event)
private
629 {
630 auto cobox_idx = m_combobox_plate->GetSelection();
631 cobox_idx++;
632 if (cobox_idx >= m_combobox_plate->GetCount()) {
633 return;
634 }
635 m_combobox_plate->SetSelection(cobox_idx);
637}

References m_combobox_plate, m_plate_choices, and update_when_change_plate().

Referenced by add_two_image_control().

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

◆ to_previous_plate()

void Slic3r::GUI::SyncAmsInfoDialog::to_previous_plate ( wxCommandEvent & event)
private
639 {
640 auto cobox_idx = m_combobox_plate->GetSelection();
641 cobox_idx--;
642 if (cobox_idx < 0) {
643 return;
644 }
645 m_combobox_plate->SetSelection(cobox_idx);
647}

References m_combobox_plate, m_plate_choices, and update_when_change_plate().

Referenced by add_two_image_control().

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

◆ unify_deal_thumbnail_data()

void Slic3r::GUI::SyncAmsInfoDialog::unify_deal_thumbnail_data ( ThumbnailData & input_data,
ThumbnailData & no_light_data,
bool allow_clone_ams_color )
3182{
3183 if (input_data.width == 0 || input_data.height == 0 || no_light_data.width == 0 || no_light_data.height == 0) {
3184 BOOST_LOG_TRIVIAL(error) << "SyncAmsInfoDialog::no_light_data is empty,error";
3185 return;
3186 }
3187 m_cur_input_thumbnail_data = input_data;
3188 m_cur_no_light_thumbnail_data = no_light_data;
3190 if (m_cur_colors_in_thumbnail.size() > 0) {
3191 change_default_normal(-1, wxColour());
3194 }
3195 else {
3196 set_default_normal(input_data);
3197 }
3198}
void clone_thumbnail_data()
Definition SyncAmsInfoDialog.cpp:2976

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_preview_thumbnail_data, set_default_normal(), and Slic3r::ThumbnailData::width.

Referenced by update_final_thumbnail_data(), and update_thumbnail_data_accord_plate_index().

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::SyncAmsInfoDialog::updata_thumbnail_data_after_connected_printer ( )
3131{
3134}
void update_thumbnail_data_accord_plate_index(bool allow_clone_ams_color)
Definition SyncAmsInfoDialog.cpp:3155
void updata_ui_data_after_connected_printer()
Definition SyncAmsInfoDialog.cpp:164

References updata_ui_data_after_connected_printer(), and update_thumbnail_data_accord_plate_index().

Referenced by sync_ams_mapping_result().

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

◆ updata_ui_data_after_connected_printer()

void Slic3r::GUI::SyncAmsInfoDialog::updata_ui_data_after_connected_printer ( )
164 {
165 if (is_dirty_filament()) { return; }
166
167 m_two_thumbnail_panel->Show(true);
168
169 show_ams_controls(true);
170 //m_specify_color_cluster_title->Show();
171 m_button_cancel->Show();
172}

References is_dirty_filament(), m_button_cancel, m_two_thumbnail_panel, and show_ams_controls().

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_ui_when_priner_not_same()

void Slic3r::GUI::SyncAmsInfoDialog::updata_ui_when_priner_not_same ( )
private
667 {
668 show_color_panel(false);
669 m_are_you_sure_title->Show(false);
671 m_mode_combox_sizer->Show(false);
672
673 m_button_cancel->Hide();
674 m_button_ok->Show();
675 m_button_ok->SetLabel(_L("OK"));
676 m_confirm_title->Show();
677 m_confirm_title->SetLabel(_L("The connected printer does not match the currently selected printer. Please change the selected printer."));
678
679 Layout();
680 Fit();
681}

References _L, m_are_you_sure_title, m_button_cancel, m_button_ok, m_confirm_title, m_mode_combox_sizer, and show_color_panel().

Referenced by show_status().

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

◆ update_ams_status_msg()

void Slic3r::GUI::SyncAmsInfoDialog::update_ams_status_msg ( wxString msg,
bool is_warning = false )
1642{
1643 if (!m_statictext_ams_msg) { return; }
1644 auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B);
1645 m_statictext_ams_msg->SetForegroundColour(colour);
1646
1647 if (msg.empty()) {
1648 if (!m_statictext_ams_msg->GetLabel().empty()) {
1649 m_statictext_ams_msg->SetLabel(wxEmptyString);
1650 m_statictext_ams_msg->Hide();
1651 Layout();
1652 Fit();
1653 }
1654 } else {
1655 msg = format_text(msg);
1656
1657 auto str_new = msg.utf8_string();
1658 stripWhiteSpace(str_new);
1659
1660 auto str_old = m_statictext_ams_msg->GetLabel().utf8_string();
1661 stripWhiteSpace(str_old);
1662
1663 if (str_new != str_old) {
1664 if (m_statictext_ams_msg->GetLabel() != msg) {
1665 m_statictext_ams_msg->SetLabel(msg);
1666 m_statictext_ams_msg->Wrap(FromDIP(600));
1667 m_statictext_ams_msg->Show();
1668 Layout();
1669 Fit();
1670 }
1671 }
1672 }
1673}
void stripWhiteSpace(std::string &str)
Definition SyncAmsInfoDialog.cpp:1675
wxString format_text(wxString &m_msg)
Definition SyncAmsInfoDialog.cpp:1691

References format_text(), m_statictext_ams_msg, and stripWhiteSpace().

Referenced by update_print_status_msg().

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

◆ update_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_final_thumbnail_data()

void Slic3r::GUI::SyncAmsInfoDialog::update_final_thumbnail_data ( )
3176 {
3177 m_preview_colors_in_thumbnail.clear();//to update m_cur_colors_in_thumbnail
3179}
void unify_deal_thumbnail_data(ThumbnailData &input_data, ThumbnailData &no_light_data, bool allow_clone_ams_color)
Definition SyncAmsInfoDialog.cpp:3181

References m_cur_input_thumbnail_data, m_cur_no_light_thumbnail_data, m_preview_colors_in_thumbnail, and unify_deal_thumbnail_data().

Referenced by reset_all_ams_info(), and reset_and_sync_ams_list().

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

◆ update_lan_machine_list()

void Slic3r::GUI::SyncAmsInfoDialog::update_lan_machine_list ( )
3279{
3280 DeviceManager *dev = wxGetApp().getDeviceManager();
3281 if (!dev) return;
3282 auto m_free_machine_list = dev->get_local_machinelist();
3283
3284 BOOST_LOG_TRIVIAL(info) << "SelectMachinePopup update_other_devices start";
3285
3286 for (auto &elem : m_free_machine_list) {
3287 MachineObject *mobj = elem.second;
3288
3289 /* do not show printer bind state is empty */
3290 if (!mobj->is_avaliable()) continue;
3291 if (!mobj->is_online()) continue;
3292 if (!mobj->is_lan_mode_printer()) continue;
3293
3294 if (mobj->has_access_right()) {
3295 auto b = mobj->get_dev_name();
3296
3297 // clear machine list
3298
3299 // m_comboBox_printer->Clear();
3300 std::vector<std::string> machine_list;
3301 wxArrayString machine_list_name;
3302 std::map<std::string, MachineObject *> option_list;
3303 }
3304 }
3305 BOOST_LOG_TRIVIAL(info) << "SyncAmsInfoDialog update_lan_devices end";
3306}

References Slic3r::MachineObject::get_dev_name(), Slic3r::DeviceManager::get_local_machinelist(), Slic3r::MachineObject::has_access_right(), Slic3r::MachineObject::is_avaliable(), Slic3r::MachineObject::is_lan_mode_printer(), and Slic3r::MachineObject::is_online().

Here is the call graph for this function:

◆ update_map_when_change_map_mode()

void Slic3r::GUI::SyncAmsInfoDialog::update_map_when_change_map_mode ( )
private
423{
426 } else if (m_map_mode == MapModeEnum::Override) {
427 if (m_ams_combo_info.empty()) {
428 // Orca: the reference's has_selector overload (skips ext-spool colors in Override mode) is
429 // not ported, so with an FTS installed, ext-spool colors still appear in the Override combo.
430 wxGetApp().preset_bundle->get_ams_cobox_infos(m_ams_combo_info);
431 }
432 for (size_t i = 0; i < m_ams_combo_info.ams_filament_colors.size(); i++) {
433 auto result = decode_ams_color(m_ams_combo_info.ams_filament_colors[i]);
434 if (i < m_cur_colors_in_thumbnail.size()) {
435 m_cur_colors_in_thumbnail[i] = result;
436 } else {
437 m_cur_colors_in_thumbnail.resize(i + 1);
438 m_cur_colors_in_thumbnail[i] = result;
439 }
440 }
441 }
443}

References ColorMap, decode_ams_color(), m_ams_combo_info, m_back_cur_colors_in_thumbnail, m_cur_colors_in_thumbnail, m_map_mode, Override, and update_thumbnail_data_accord_plate_index().

Referenced by update_when_change_map_mode().

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

◆ update_more_setting()

void Slic3r::GUI::SyncAmsInfoDialog::update_more_setting ( bool layout = true,
bool from_more_seting_text = false )
private
490{
492 m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option3", m_scrolledWindow, 18));
493 if (from_more_seting_text) {
494 m_scrolledWindow->SetMinSize(wxSize(-1, SyncAmsInfoDialogHeightMIDDLE));
495 m_scrolledWindow->SetMaxSize(wxSize(-1, SyncAmsInfoDialogHeightMIDDLE));
496 }
497 } else {
498 m_advanced_options_icon->SetBitmap(create_scaled_bitmap("advanced_option4", m_scrolledWindow, 18));
499 if (from_more_seting_text) {
500 m_scrolledWindow->SetMinSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
501 m_scrolledWindow->SetMaxSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
502 }
503 }
506 if (layout) {
507 m_scrolledWindow->FitInside();
508 Layout();
509 Fit();
510 }
511}
#define SyncAmsInfoDialogHeightMIDDLE
Definition SyncAmsInfoDialog.cpp:94

References create_scaled_bitmap(), m_advanced_options_icon, m_append_color_sizer, m_expand_more_settings, m_merge_color_sizer, m_scrolledWindow, show_sizer(), SyncAmsInfoDialogHeightMAX, and SyncAmsInfoDialogHeightMIDDLE.

Referenced by SyncAmsInfoDialog(), and show_advanced_settings().

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

◆ update_panel_status()

void Slic3r::GUI::SyncAmsInfoDialog::update_panel_status ( PageType page)
private
454{
455 std::vector<CapsuleButton *> button_list = {m_colormap_btn, m_override_btn};
456 for (auto p : button_list) {
457 if (p && p->IsSelected()) {
458 p->Select(false);
459 }
460 }
461 for (size_t i = 0; i < button_list.size(); i++) {
462 if (i == int(page)) {
463 button_list[i]->Select(true);
464 break;
465 }
466 }
467}

References m_colormap_btn, and m_override_btn.

Referenced by is_need_show(), and update_when_change_map_mode().

Here is the caller graph for this function:

◆ update_plate_combox()

void Slic3r::GUI::SyncAmsInfoDialog::update_plate_combox ( )
private
397{
398 if (m_combobox_plate) {
399 m_combobox_plate->Clear();
400 for (size_t i = 0; i < m_plate_number_choices_str.size(); i++) {
402 }
403 auto iter = std::find(m_plate_choices.begin(), m_plate_choices.end(), m_specify_plate_idx);
404 if (iter != m_plate_choices.end()) {
405 auto index = iter - m_plate_choices.begin();
406 m_combobox_plate->SetSelection(index);
407 }
408 }
409}

References m_combobox_plate, m_plate_choices, m_plate_number_choices_str, and m_specify_plate_idx.

Referenced by is_need_show().

Here is the caller graph for this function:

◆ update_priner_status_msg()

void Slic3r::GUI::SyncAmsInfoDialog::update_priner_status_msg ( wxString msg,
bool is_warning = false )
1714{
1715 auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B);
1716 m_text_printer_msg->SetForegroundColour(colour);
1717
1718 if (msg.empty()) {
1719 if (!m_text_printer_msg->GetLabel().empty()) {
1720 m_text_printer_msg->SetLabel(wxEmptyString);
1721 m_text_printer_msg->Hide();
1722 Layout();
1723 Fit();
1724 }
1725 } else {
1726 msg = format_text(msg);
1727
1728 auto str_new = msg.utf8_string();
1729 stripWhiteSpace(str_new);
1730
1731 auto str_old = m_text_printer_msg->GetLabel().utf8_string();
1732 stripWhiteSpace(str_old);
1733
1734 if (str_new != str_old) {
1735 if (m_text_printer_msg->GetLabel() != msg) {
1736 m_text_printer_msg->SetLabel(msg);
1737 m_text_printer_msg->SetMinSize(wxSize(FromDIP(420), -1));
1738 m_text_printer_msg->SetMaxSize(wxSize(FromDIP(420), -1));
1739 m_text_printer_msg->Wrap(FromDIP(420));
1740 m_text_printer_msg->Show();
1741 Layout();
1742 Fit();
1743 }
1744 }
1745 }
1746}

References format_text(), m_text_printer_msg, and stripWhiteSpace().

Referenced by update_print_status_msg().

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

◆ update_print_error_info()

void Slic3r::GUI::SyncAmsInfoDialog::update_print_error_info ( int code,
std::string msg,
std::string extra )
1760{
1761 m_print_error_code = code;
1762 m_print_error_msg = msg;
1763 m_print_error_extra = extra;
1764}
std::string m_print_error_extra
Definition SyncAmsInfoDialog.hpp:58
std::string m_print_error_msg
Definition SyncAmsInfoDialog.hpp:57
int m_print_error_code
Definition SyncAmsInfoDialog.hpp:51

References m_print_error_code, m_print_error_extra, and m_print_error_msg.

◆ update_print_required_data()

int Slic3r::GUI::SyncAmsInfoDialog::update_print_required_data ( Slic3r::DynamicPrintConfig config,
Slic3r::Model model,
Slic3r::PlateDataPtrs plate_data_list,
std::string file_name,
std::string file_path )
2151{
2153 m_required_data_config = config;
2154 m_required_data_model = model;
2155 // m_required_data_plate_data_list = plate_data_list;
2156 for (auto i = 0; i < plate_data_list.size(); i++) {
2157 if (!plate_data_list[i]->gcode_file.empty()) { m_required_data_plate_data_list.push_back(plate_data_list[i]); }
2158 }
2159
2160 m_required_data_file_name = file_name;
2161 m_required_data_file_path = file_path;
2162 return m_required_data_plate_data_list.size();
2163}
Slic3r::DynamicPrintConfig m_required_data_config
Definition SyncAmsInfoDialog.hpp:75
Slic3r::Model m_required_data_model
Definition SyncAmsInfoDialog.hpp:76
std::string m_required_data_file_name
Definition SyncAmsInfoDialog.hpp:78
std::string m_required_data_file_path
Definition SyncAmsInfoDialog.hpp:79

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::SyncAmsInfoDialog::update_print_status_msg ( wxString msg,
bool is_warning = false,
bool is_printer = true )
1749{
1750 if (is_printer_msg) {
1751 update_ams_status_msg(wxEmptyString, false);
1752 update_priner_status_msg(msg, is_warning);
1753 } else {
1754 update_ams_status_msg(msg, is_warning);
1755 update_priner_status_msg(wxEmptyString, false);
1756 }
1757}
void update_priner_status_msg(wxString msg, bool is_warning=false)
Definition SyncAmsInfoDialog.cpp:1713
void update_ams_status_msg(wxString msg, bool is_warning=false)
Definition SyncAmsInfoDialog.cpp:1641

References update_ams_status_msg(), and update_priner_status_msg().

Referenced by show_status().

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

◆ update_printer_combobox()

void Slic3r::GUI::SyncAmsInfoDialog::update_printer_combobox ( wxCommandEvent & event)
2224{
2227}
void update_user_printer()
Definition SyncAmsInfoDialog.cpp:2167

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_select_layout()

void Slic3r::GUI::SyncAmsInfoDialog::update_select_layout ( MachineObject * obj)
175{
176 m_checkbox_list["use_ams"]->Hide();
177}

References m_checkbox_list.

Referenced by on_timer().

Here is the caller graph for this function:

◆ update_show_status()

void Slic3r::GUI::SyncAmsInfoDialog::update_show_status ( )
2263{
2264 // refreshing return
2266 return;
2268 return;
2270 return;
2271
2272 NetworkAgent * agent = Slic3r::GUI::wxGetApp().getAgent();
2273 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2274 if (!agent) {
2275 return;
2276 }
2277 if (!dev) return;
2278 const std::string provider = wxGetApp().get_printer_cloud_provider();
2279
2280 // blank plate has no valid gcode file
2282 MachineObject * obj_ = dev->get_selected_machine();
2283 if (!obj_) {
2284 if (agent) {
2285 if (agent->is_user_login(provider)) {
2287 }
2288 }
2289 return;
2290 }
2291
2292 /* check cloud machine connections */
2293 if (!obj_->is_lan_mode_printer()) {
2294 if (!agent->is_server_connected(provider)) {
2296 reset_timeout();
2297 return;
2298 }
2299 }
2300
2301 if (!obj_->is_info_ready()) {
2302 if (is_timeout()) {
2303 BOOST_LOG_TRIVIAL(error) << "check error:machine timeout";
2304 m_ams_mapping_result.clear();
2307 return;
2308 } else {
2311 return;
2312 }
2313 return;
2314 }
2315
2316 reset_timeout();
2317
2318 bool has_optional_printer_model = DevPrinterConfigUtil::is_optional_printer_model_id(obj_->printer_type);
2320 if (PresetBundle *preset_bundle = wxGetApp().preset_bundle) {
2321 has_optional_printer_model = has_optional_printer_model ||
2323 preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle));
2324 }
2326 has_optional_printer_model = has_optional_printer_model ||
2328 }
2329
2330 if (!obj_->GetConfig()->SupportPrintAllPlates() && m_print_plate_idx == PLATE_ALL_IDX) {
2332 return;
2333 }
2334
2335 // do ams mapping if no ams result
2336 if (m_ams_mapping_result.empty()) {
2337 do_ams_mapping(obj_);
2338 }
2339
2340
2341 // reading done
2342 if (wxGetApp().app_config) {
2343 if (obj_->upgrade_force_upgrade) {
2345 return;
2346 }
2347
2348 if (obj_->upgrade_consistency_request) {
2350 return;
2351 }
2352 }
2353
2354 if (is_blocking_printing(obj_)) {
2356 return;
2357 } else if (obj_->is_in_upgrading()) {
2359 return;
2360 } else if (obj_->is_system_printing()) {
2362 return;
2363 } else if (obj_->is_in_printing() || obj_->ams_status_main == AMS_STATUS_MAIN_FILAMENT_CHANGE) {
2365 return;
2366 } else if (!obj_->GetConfig()->SupportPrintWithoutSD() && (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD)) {
2368 return;
2369 }
2370
2371 // check sdcard when if lan mode printer
2372 if (obj_->is_lan_mode_printer()) {
2373 if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD) {
2375 return;
2376 } else if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_ABNORMAL || obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::HAS_SDCARD_READONLY) {
2378 return;
2379 }
2380 }
2381
2382 // do ams mapping if no ams result
2383 if (m_ams_mapping_result.empty()) { do_ams_mapping(obj_); }
2384
2385 const auto &full_config = wxGetApp().preset_bundle->full_config();
2386 size_t nozzle_nums = full_config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
2387
2388 // the nozzle type of preset and machine are different
2389 if (get_is_double_extruder()) {
2390 wxString error_message;
2391 if (!is_nozzle_type_match(*obj_->GetExtderSystem(), error_message)) {
2392 std::vector<wxString> params{error_message};
2393 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."));
2395 return;
2396 }
2397 }
2398
2399 // check ams and vt_slot mix use status
2400 {
2401 struct ExtruderStatus
2402 {
2403 bool has_ams{false};
2404 bool has_vt_slot{false};
2405 };
2406 std::vector<ExtruderStatus> extruder_status(nozzle_nums);
2407 for (const FilamentInfo &item : m_ams_mapping_result) {
2408 if (item.ams_id.empty()) continue;
2409
2410 int extruder_id = obj_->get_extruder_id_by_ams_id(item.ams_id);
2411 if (devPrinterUtil::IsVirtualSlot(item.ams_id))
2412 extruder_status[extruder_id].has_vt_slot = true;
2413 else
2414 extruder_status[extruder_id].has_ams = true;
2415 }
2416 for (auto extruder : extruder_status) {
2417 if (extruder.has_ams && extruder.has_vt_slot) {
2419 return;
2420 }
2421 }
2422 }
2423
2424 if (has_optional_printer_model)
2426}
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
@ HAS_SDCARD_READONLY
Definition DevStorage.h:21
@ NO_SDCARD
Definition DevStorage.h:18
bool do_ams_mapping(MachineObject *obj_)
Definition SyncAmsInfoDialog.cpp:1292
bool is_nozzle_type_match(DevExtderSystem data, wxString &error_message) const
Definition SyncAmsInfoDialog.cpp:1546
bool is_must_finish_slice_then_connected_printer()
Definition SyncAmsInfoDialog.cpp:225
void reset_timeout()
Definition SyncAmsInfoDialog.cpp:2165
bool is_blocking_printing(MachineObject *obj_)
Definition SyncAmsInfoDialog.cpp:1920
PrintDialogStatus get_status()
Definition SyncAmsInfoDialog.hpp:245
bool is_timeout()
Definition SyncAmsInfoDialog.cpp:2143
static bool IsVirtualSlot(int ams_id)
Definition DevDefs.h:165
@ AMS_STATUS_MAIN_FILAMENT_CHANGE
Definition DevDefs.h:47

References _L, Slic3r::MachineObject::ams_status_main, Slic3r::AMS_STATUS_MAIN_FILAMENT_CHANGE, do_ams_mapping(), Slic3r::GUI::FROM_NORMAL, Slic3r::GUI::FROM_SDCARD_VIEW, Slic3r::MachineObject::get_extruder_id_by_ams_id(), get_is_double_extruder(), Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), get_status(), Slic3r::MachineObject::GetConfig(), Slic3r::MachineObject::GetExtderSystem(), Slic3r::MachineObject::GetStorage(), Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, is_blocking_printing(), Slic3r::MachineObject::is_in_printing(), Slic3r::MachineObject::is_in_upgrading(), Slic3r::MachineObject::is_info_ready(), Slic3r::MachineObject::is_lan_mode_printer(), is_must_finish_slice_then_connected_printer(), is_nozzle_type_match(), Slic3r::DevPrinterConfigUtil::is_optional_printer_model_id(), Slic3r::NetworkAgent::is_server_connected(), Slic3r::MachineObject::is_system_printing(), is_timeout(), Slic3r::NetworkAgent::is_user_login(), Slic3r::devPrinterUtil::IsVirtualSlot(), m_ams_mapping_result, m_print_plate_idx, m_print_type, m_required_data_plate_data_list, m_timeout_count, Slic3r::DevStorage::NO_SDCARD, PLATE_ALL_IDX, Slic3r::MachineObject::printer_type, Slic3r::GUI::PrintStatusConnectingServer, Slic3r::GUI::PrintStatusInPrinting, Slic3r::GUI::PrintStatusInSystemPrinting, Slic3r::GUI::PrintStatusInUpgrading, Slic3r::GUI::PrintStatusInvalidPrinter, Slic3r::GUI::PrintStatusLanModeNoSdcard, Slic3r::GUI::PrintStatusLanModeSDcardNotAvailable, Slic3r::GUI::PrintStatusMixAmsAndVtSlotWarning, Slic3r::GUI::PrintStatusNeedConsistencyUpgrading, Slic3r::GUI::PrintStatusNeedForceUpgrading, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotSupportedPrintAll, Slic3r::GUI::PrintStatusNozzleMatchInvalid, Slic3r::GUI::PrintStatusOptionalPrinterModel, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusRefreshingMachineList, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::PrintStatusSendingCanceled, Slic3r::GUI::PrintStatusUnsupportedPrinter, reset_timeout(), show_status(), Slic3r::DevConfig::SupportPrintAllPlates(), Slic3r::DevConfig::SupportPrintWithoutSD(), sync_ams_mapping_result(), Slic3r::MachineObject::upgrade_consistency_request, and Slic3r::MachineObject::upgrade_force_upgrade.

Referenced by on_timer(), and reinit_dialog().

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

◆ update_swipe_button_state()

void Slic3r::GUI::SyncAmsInfoDialog::update_swipe_button_state ( )
private
650{
652 m_swipe_left_button->Enable();
655 m_swipe_right_button->Enable();
657 if (m_combobox_plate->GetSelection() == 0) { // auto plate_index = m_plate_choices[m_combobox_plate->GetSelection()];
660 }
661 if (m_combobox_plate->GetSelection() == m_combobox_plate->GetCount() - 1) {
664 }
665}

References m_combobox_plate, m_swipe_left_bmp_disable, m_swipe_left_bmp_normal, m_swipe_left_button, m_swipe_left_button_enable, m_swipe_right_bmp_disable, m_swipe_right_bmp_normal, m_swipe_right_button, and m_swipe_right_button_enable.

Referenced by add_two_image_control(), is_need_show(), and update_when_change_plate().

Here is the caller graph for this function:

◆ update_thumbnail_data_accord_plate_index()

void Slic3r::GUI::SyncAmsInfoDialog::update_thumbnail_data_accord_plate_index ( bool allow_clone_ams_color)
3156{
3158 show_advanced_settings(false,false);
3159 m_filament_panel->Show(false);
3160 m_fix_filament_panel->Show();
3162 } else if (m_map_mode == MapModeEnum::ColorMap) {
3163 show_advanced_settings(true, false);
3164 m_filament_panel->Show();
3165 m_fix_filament_panel->Show(false);
3166 }
3167 // change thumbnail_data
3168 ThumbnailData &input_data = m_specify_plate_idx == -1 ? m_plater->get_partplate_list().get_curr_plate()->thumbnail_data :
3169 m_plater->get_partplate_list().get_plate(m_specify_plate_idx)->thumbnail_data;
3170 ThumbnailData &no_light_data = m_specify_plate_idx == -1 ? m_plater->get_partplate_list().get_curr_plate()->no_light_thumbnail_data :
3171 m_plater->get_partplate_list().get_plate(m_specify_plate_idx)->no_light_thumbnail_data;
3172 if (input_data.width == 0 || input_data.height == 0 || no_light_data.width == 0 || no_light_data.height == 0) { wxGetApp().plater()->update_all_plate_thumbnails(false); }
3173 unify_deal_thumbnail_data(input_data, no_light_data, allow_clone_ams_color);
3174}
void generate_override_fix_ams_list()
Definition SyncAmsInfoDialog.cpp:2813

References ColorMap, generate_override_fix_ams_list(), Slic3r::ThumbnailData::height, m_filament_panel, m_fix_filament_panel, m_map_mode, m_plater, m_specify_plate_idx, Override, show_advanced_settings(), unify_deal_thumbnail_data(), and Slic3r::ThumbnailData::width.

Referenced by updata_thumbnail_data_after_connected_printer(), update_map_when_change_map_mode(), and update_when_change_plate().

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

◆ update_timelapse_enable_status()

void Slic3r::GUI::SyncAmsInfoDialog::update_timelapse_enable_status ( )
2439{
2440 AppConfig *config = wxGetApp().app_config;
2441 if (!has_timelapse_warning()) {
2442 if (!config || config->get("print", "timelapse") == "0")
2443 m_checkbox_list["timelapse"]->setValue("off");
2444 else
2445 m_checkbox_list["timelapse"]->setValue("on");
2446 m_checkbox_list["timelapse"]->Enable(true);
2447 } else {
2448 m_checkbox_list["timelapse"]->setValue("off");
2449 m_checkbox_list["timelapse"]->Enable(false);
2450 if (config) { config->set_str("print", "timelapse", "0"); }
2451 }
2452}
bool has_timelapse_warning()
Definition SyncAmsInfoDialog.cpp:2428

References Slic3r::AppConfig::get(), has_timelapse_warning(), m_checkbox_list, and Slic3r::AppConfig::set_str().

Here is the call graph for this function:

◆ update_user_machine_list()

void Slic3r::GUI::SyncAmsInfoDialog::update_user_machine_list ( )
2022{
2023 NetworkAgent *m_agent = wxGetApp().getAgent();
2024 const std::string provider = wxGetApp().get_printer_cloud_provider();
2025 if (m_agent && m_agent->is_user_login(provider)) {
2026 boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr(m_token), provider] {
2027 NetworkAgent *agent = wxGetApp().getAgent();
2028 unsigned int http_code;
2029 std::string body;
2030 int result = agent->get_user_print_info(&http_code, &body, provider);
2031 CallAfter([token, this, result, body] {
2032 if (token.expired()) { return; }
2033 if (result == 0) {
2034 m_print_info = body;
2035 } else {
2036 m_print_info = "";
2037 }
2038 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
2039 event.SetEventObject(this);
2040 wxPostEvent(this, event);
2041 });
2042 });
2043 } else {
2044 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
2045 event.SetEventObject(this);
2046 wxPostEvent(this, event);
2047 }
2048}
std::shared_ptr< int > m_token
Definition SyncAmsInfoDialog.hpp:65
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::SyncAmsInfoDialog::update_user_printer ( )
2168{
2169 Slic3r::DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
2170 if (!dev) return;
2171
2172 // update user print info
2173 if (!m_print_info.empty()) {
2175 m_print_info = "";
2176 }
2177
2178 // clear machine list
2179 m_list.clear();
2180 std::vector<std::string> machine_list;
2181 wxArrayString machine_list_name;
2182 std::map<std::string, MachineObject *> option_list;
2183
2184 // user machine list
2185 option_list = dev->get_my_machine_list(dev->get_current_printer_agent_id());
2186
2187 // same machine only appear once
2188 for (auto it = option_list.begin(); it != option_list.end(); it++) {
2189 if (it->second && (it->second->is_online() || it->second->is_connected())) { machine_list.push_back(it->second->get_dev_name()); }
2190 }
2191
2192 // lan machine list
2193 auto lan_option_list = dev->get_local_machinelist();
2194
2195 for (auto elem : lan_option_list) {
2196 MachineObject *mobj = elem.second;
2197
2198 /* do not show printer bind state is empty */
2199 if (!mobj->is_avaliable()) continue;
2200 if (!mobj->is_online()) continue;
2201 if (!mobj->is_lan_mode_printer()) continue;
2202 if (!mobj->has_access_right()) {
2203 option_list[mobj->get_dev_name()] = mobj;
2204 machine_list.push_back(mobj->get_dev_name());
2205 }
2206 }
2207
2208 machine_list = sort_string(machine_list);
2209 for (auto tt = machine_list.begin(); tt != machine_list.end(); tt++) {
2210 for (auto it = option_list.begin(); it != option_list.end(); it++) {
2211 if (it->second->get_dev_name() == *tt)
2212 {
2213 m_list.push_back(it->second);
2214 wxString dev_name_text = from_u8(it->second->get_dev_name());
2215 if (it->second->is_lan_mode_printer()) { dev_name_text += _L("(LAN)"); }
2216 machine_list_name.Add(dev_name_text);
2217 break;
2218 }
2219 }
2220 }
2221}
std::map< std::string, MachineObject * > get_my_machine_list(const std::string &agent_id="")
Definition DevManager.cpp:824
void parse_user_print_info(std::string body)
Definition DevManager.cpp:894
std::string get_current_printer_agent_id() const
Definition DevManager.cpp:192
std::map< std::string, MachineObject * > get_local_machinelist() const
Definition DevManager.h:71
std::vector< std::string > sort_string(std::vector< std::string > strArray)
Definition SyncAmsInfoDialog.cpp:2133

References _L, Slic3r::GUI::from_u8(), Slic3r::DeviceManager::get_current_printer_agent_id(), Slic3r::MachineObject::get_dev_name(), Slic3r::DeviceManager::get_local_machinelist(), Slic3r::DeviceManager::get_my_machine_list(), Slic3r::MachineObject::has_access_right(), Slic3r::MachineObject::is_avaliable(), Slic3r::MachineObject::is_lan_mode_printer(), Slic3r::MachineObject::is_online(), m_list, m_print_info, Slic3r::DeviceManager::parse_user_print_info(), and sort_string().

Referenced by update_printer_combobox().

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

◆ update_when_change_map_mode() [1/2]

void Slic3r::GUI::SyncAmsInfoDialog::update_when_change_map_mode ( int idx)
private
369{
370 m_map_mode = (MapModeEnum) idx;
371 show_ams_controls(true);
373 show_color_panel(true,false);
374 m_confirm_title->SetLabel(m_undone_str);
375 m_after_map_text->SetLabel(_L("After mapping"));
377 m_scrolledWindow->SetMinSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
378 m_scrolledWindow->SetMaxSize(wxSize(-1, SyncAmsInfoDialogHeightMAX));
379
380 } else if (m_map_mode == MapModeEnum::Override) {
381 show_color_panel(false,false);
382 m_confirm_title->Show();
384 m_are_you_sure_title->Show();
385 m_after_map_text->SetLabel(_L("After overwriting"));
387 m_scrolledWindow->SetMinSize(wxSize(-1, SyncAmsInfoDialogHeightMIN));
388 m_scrolledWindow->SetMaxSize(wxSize(-1, SyncAmsInfoDialogHeightMIN));
389 }
391 m_scrolledWindow->FitInside();
392 Layout();
393 Fit();
394}
#define SyncAmsInfoDialogHeightMIN
Definition SyncAmsInfoDialog.cpp:93
MapModeEnum
Definition SyncAmsInfoDialog.hpp:355
void update_map_when_change_map_mode()
Definition SyncAmsInfoDialog.cpp:422

References _L, ColorMap, m_after_map_text, m_are_you_sure_title, m_confirm_title, m_map_mode, m_override_undone_str, m_scrolledWindow, m_tip_attention_color_map, m_tip_attention_override, m_tip_text, m_undone_str, Override, show_ams_controls(), show_color_panel(), SyncAmsInfoDialogHeightMAX, SyncAmsInfoDialogHeightMIN, and update_map_when_change_map_mode().

Referenced by SyncAmsInfoDialog(), is_need_show(), and update_when_change_map_mode().

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

◆ update_when_change_map_mode() [2/2]

void Slic3r::GUI::SyncAmsInfoDialog::update_when_change_map_mode ( wxCommandEvent & e)
private
446{
447 int win_id = e.GetId();
448 auto mode = PageType(win_id);
451}
PageType
Definition SyncAmsInfoDialog.hpp:46

References update_panel_status(), and update_when_change_map_mode().

Here is the call graph for this function:

◆ update_when_change_plate()

void Slic3r::GUI::SyncAmsInfoDialog::update_when_change_plate ( int idx)
private
355 {
356 if (idx < 0) {
357 return;
358 }
360
361 update_thumbnail_data_accord_plate_index(false); // share current map
362
364 Layout();
365 Fit();
366}

References m_specify_plate_idx, update_swipe_button_state(), and update_thumbnail_data_accord_plate_index().

Referenced by add_two_image_control(), to_next_plate(), and to_previous_plate().

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::SyncAmsInfoDialog::ams_mapping_help_icon {nullptr}
protected
119{nullptr};

Referenced by on_dpi_changed().

◆ img_ams_backup

wxStaticBitmap* Slic3r::GUI::SyncAmsInfoDialog::img_ams_backup {nullptr}
protected
120{nullptr};

Referenced by on_timer().

◆ img_amsmapping_tip

wxStaticBitmap* Slic3r::GUI::SyncAmsInfoDialog::img_amsmapping_tip {nullptr}
protected
104{nullptr};

Referenced by on_dpi_changed().

◆ LEFT_THUMBNAIL_SIZE_WIDTH

const int Slic3r::GUI::SyncAmsInfoDialog::LEFT_THUMBNAIL_SIZE_WIDTH = 100
private

◆ m_advace_setting_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_advace_setting_sizer = nullptr
private

◆ m_advanced_options_icon

wxStaticBitmap* Slic3r::GUI::SyncAmsInfoDialog::m_advanced_options_icon {nullptr}
private
338{nullptr};

Referenced by SyncAmsInfoDialog(), and update_more_setting().

◆ m_after_map_text

Label* Slic3r::GUI::SyncAmsInfoDialog::m_after_map_text {nullptr}
private
310{nullptr};

Referenced by create_sizer_thumbnail(), and update_when_change_map_mode().

◆ m_ams_backup_tip

Label* Slic3r::GUI::SyncAmsInfoDialog::m_ams_backup_tip {nullptr}
protected
109{nullptr};

Referenced by Enable_Auto_Refill(), and on_timer().

◆ m_ams_combo_info

AMSComboInfo Slic3r::GUI::SyncAmsInfoDialog::m_ams_combo_info
private

◆ m_ams_mapping_res

bool Slic3r::GUI::SyncAmsInfoDialog::m_ams_mapping_res {false}
private
53{false};

Referenced by reinit_dialog().

◆ m_ams_mapping_result

◆ m_ams_mapping_valid

bool Slic3r::GUI::SyncAmsInfoDialog::m_ams_mapping_valid {false}
private
54{false};

Referenced by reinit_dialog().

◆ m_ams_or_ext_text_in_colormap

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_ams_or_ext_text_in_colormap {nullptr}
protected
115{nullptr};

Referenced by deal_only_exist_ext_spool(), and reset_and_sync_ams_list().

◆ m_ams_or_ext_text_in_override

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_ams_or_ext_text_in_override {nullptr}
protected

◆ m_append_color_checkbox

::CheckBox* Slic3r::GUI::SyncAmsInfoDialog::m_append_color_checkbox = nullptr
private

◆ m_append_color_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_append_color_sizer = nullptr
private

◆ m_append_color_text

Label* Slic3r::GUI::SyncAmsInfoDialog::m_append_color_text = nullptr
private

◆ m_are_you_sure_title

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_are_you_sure_title = nullptr
private

◆ m_attention_text

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_attention_text {nullptr}
private
311{nullptr};

Referenced by SyncAmsInfoDialog(), and show_ams_controls().

◆ m_back_ams_mapping_result

std::vector<FilamentInfo> Slic3r::GUI::SyncAmsInfoDialog::m_back_ams_mapping_result
private

◆ m_back_cur_colors_in_thumbnail

std::vector<wxColour> Slic3r::GUI::SyncAmsInfoDialog::m_back_cur_colors_in_thumbnail
protected

◆ m_basic_panel

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_basic_panel
protected

Referenced by SyncAmsInfoDialog(), init_bind(), and Show().

◆ m_basicl_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_basicl_sizer {nullptr}
protected
100{nullptr};

Referenced by SyncAmsInfoDialog(), and hide_no_use_controls().

◆ m_bedtype_list

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

Referenced by SyncAmsInfoDialog().

◆ m_bmp_pix_cont

int Slic3r::GUI::SyncAmsInfoDialog::m_bmp_pix_cont = 32
protected

◆ m_button_cancel

Button* Slic3r::GUI::SyncAmsInfoDialog::m_button_cancel = nullptr
private

◆ m_button_ok

Button* Slic3r::GUI::SyncAmsInfoDialog::m_button_ok = nullptr
private

◆ m_can_rescale

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

◆ m_check_dirty_fialment

bool Slic3r::GUI::SyncAmsInfoDialog::m_check_dirty_fialment = true
private

◆ m_check_flag

bool Slic3r::GUI::SyncAmsInfoDialog::m_check_flag {false}
private
55{false};

Referenced by on_timer().

◆ m_checkbox_list

std::map<std::string, PrintOption *> Slic3r::GUI::SyncAmsInfoDialog::m_checkbox_list
private

◆ m_choose_plate_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_choose_plate_sizer {nullptr}
protected
133{nullptr};

Referenced by add_two_image_control().

◆ m_colormap_btn

CapsuleButton* Slic3r::GUI::SyncAmsInfoDialog::m_colormap_btn = nullptr
private

◆ m_colour_bold_color

wxColour Slic3r::GUI::SyncAmsInfoDialog::m_colour_bold_color {wxColour(38, 46, 48)}
private
63{wxColour(38, 46, 48)};

◆ m_colour_def_color

wxColour Slic3r::GUI::SyncAmsInfoDialog::m_colour_def_color {wxColour(255, 255, 255)}
private
62{wxColour(255, 255, 255)};

Referenced by SyncAmsInfoDialog().

◆ m_combobox_plate

ComboBox* Slic3r::GUI::SyncAmsInfoDialog::m_combobox_plate {nullptr}
protected

◆ m_confirm_title

Label* Slic3r::GUI::SyncAmsInfoDialog::m_confirm_title = nullptr
private

◆ m_cur_colors_in_thumbnail

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

◆ m_cur_input_thumbnail_data

◆ m_cur_no_light_thumbnail_data

ThumbnailData Slic3r::GUI::SyncAmsInfoDialog::m_cur_no_light_thumbnail_data
protected

◆ m_current_filament_id

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

◆ m_current_project_name

wxString Slic3r::GUI::SyncAmsInfoDialog::m_current_project_name
private

Referenced by set_default().

◆ m_edge_pixels

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

◆ m_em_unit

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

◆ m_expand_more_settings

bool Slic3r::GUI::SyncAmsInfoDialog::m_expand_more_settings = true
private

◆ m_filament_left_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_filament_left_panel {nullptr}
protected
151{nullptr};

Referenced by SyncAmsInfoDialog(), reset_and_sync_ams_list(), and Show().

◆ m_filament_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_filament_panel {nullptr}
protected

◆ m_filament_panel_left_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_filament_panel_left_sizer
protected

◆ m_filament_panel_right_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_filament_panel_right_sizer
protected

◆ m_filament_panel_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_filament_panel_sizer
protected

◆ m_filament_right_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_filament_right_panel {nullptr}
protected
152{nullptr};

Referenced by SyncAmsInfoDialog(), reset_and_sync_ams_list(), and Show().

◆ m_filaments

std::vector<FilamentInfo> Slic3r::GUI::SyncAmsInfoDialog::m_filaments
private

◆ m_filaments_map

std::vector<int> Slic3r::GUI::SyncAmsInfoDialog::m_filaments_map
private

◆ m_fix_filament_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_fix_filament_panel {nullptr}
protected

◆ m_fix_filament_panel_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_fix_filament_panel_sizer {nullptr}
protected
157{nullptr};

Referenced by SyncAmsInfoDialog(), and generate_override_fix_ams_list().

◆ m_fix_filaments

std::vector<FilamentInfo> Slic3r::GUI::SyncAmsInfoDialog::m_fix_filaments
protected

◆ m_fix_materialList

MaterialHash Slic3r::GUI::SyncAmsInfoDialog::m_fix_materialList
protected

◆ m_fix_sizer_ams_mapping

wxFlexGridSizer* Slic3r::GUI::SyncAmsInfoDialog::m_fix_sizer_ams_mapping {nullptr}
protected
155{nullptr};

Referenced by SyncAmsInfoDialog(), and generate_override_fix_ams_list().

◆ m_force_rescale

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

◆ m_generate_fix_sizer_ams_mapping

bool Slic3r::GUI::SyncAmsInfoDialog::m_generate_fix_sizer_ams_mapping = false
protected

◆ m_gif_ctrl

wxAnimationCtrl* Slic3r::GUI::SyncAmsInfoDialog::m_gif_ctrl {nullptr}
protected
174{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_input_info

SyncInfo Slic3r::GUI::SyncAmsInfoDialog::m_input_info
private

Referenced by SyncAmsInfoDialog(), and set_info().

◆ m_is_empty_project

bool Slic3r::GUI::SyncAmsInfoDialog::m_is_empty_project = true
private

◆ m_is_in_sending_mode

bool Slic3r::GUI::SyncAmsInfoDialog::m_is_in_sending_mode {false}
private
52{false};

Referenced by finish_mode(), and prepare_mode().

◆ m_left_image_button

wxButton* Slic3r::GUI::SyncAmsInfoDialog::m_left_image_button = nullptr
private

◆ m_left_sizer_thumbnail

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_left_sizer_thumbnail {nullptr}
private
318{nullptr};

Referenced by add_two_image_control().

◆ m_line_top

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_line_top {nullptr}
protected
108{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_list

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

Referenced by set_default(), and update_user_printer().

◆ m_loading_page

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_loading_page {nullptr}
protected
171{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_map_mode

◆ m_mapping_popup

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

◆ m_mapping_tip_popup

AmsMapingTipPopup Slic3r::GUI::SyncAmsInfoDialog::m_mapping_tip_popup {nullptr}
protected
87{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_mapping_tutorial_popup

AmsTutorialPopup Slic3r::GUI::SyncAmsInfoDialog::m_mapping_tutorial_popup {nullptr}
protected
88{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_materialList

◆ m_merge_color_checkbox

::CheckBox* Slic3r::GUI::SyncAmsInfoDialog::m_merge_color_checkbox = nullptr
private

◆ m_merge_color_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_merge_color_sizer = nullptr
private

◆ m_merge_color_text

Label* Slic3r::GUI::SyncAmsInfoDialog::m_merge_color_text = nullptr
private

Referenced by SyncAmsInfoDialog().

◆ m_mode_combox_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_mode_combox_sizer = nullptr
private

◆ m_more_setting_tips

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_more_setting_tips = nullptr
private

Referenced by SyncAmsInfoDialog().

◆ 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_only_exist_ext_spool_flag

bool Slic3r::GUI::SyncAmsInfoDialog::m_only_exist_ext_spool_flag {false}
private

◆ m_options_other

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_options_other {nullptr}
protected
91{nullptr};

Referenced by SyncAmsInfoDialog(), and Show().

◆ m_original_in_colormap

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_original_in_colormap {nullptr}
protected
113{nullptr};

Referenced by reset_and_sync_ams_list().

◆ m_original_in_override

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_original_in_override {nullptr}
protected
114{nullptr};

Referenced by generate_override_fix_ams_list().

◆ m_override_btn

CapsuleButton* Slic3r::GUI::SyncAmsInfoDialog::m_override_btn = nullptr
private

◆ m_override_undone_str

wxString Slic3r::GUI::SyncAmsInfoDialog::m_override_undone_str
private

◆ m_pages

wxSimplebook* Slic3r::GUI::SyncAmsInfoDialog::m_pages {nullptr}
protected
170{nullptr};

Referenced by SyncAmsInfoDialog(), is_need_show(), and show_thumbnail_page().

◆ m_panel_status

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_panel_status {nullptr}
protected
106{nullptr};

◆ m_plate_choices

std::vector<int> Slic3r::GUI::SyncAmsInfoDialog::m_plate_choices
protected

◆ m_plate_number_choices_str

wxArrayString Slic3r::GUI::SyncAmsInfoDialog::m_plate_number_choices_str
protected

◆ m_plater

Plater* Slic3r::GUI::SyncAmsInfoDialog::m_plater {nullptr}
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::SyncAmsInfoDialog::m_preview_colors_in_thumbnail
protected

◆ m_preview_thumbnail_data

ThumbnailData Slic3r::GUI::SyncAmsInfoDialog::m_preview_thumbnail_data
protected

◆ m_print_error_code

int Slic3r::GUI::SyncAmsInfoDialog::m_print_error_code {0}
private
51{0};

Referenced by update_print_error_info().

◆ m_print_error_extra

std::string Slic3r::GUI::SyncAmsInfoDialog::m_print_error_extra
private

Referenced by update_print_error_info().

◆ m_print_error_msg

std::string Slic3r::GUI::SyncAmsInfoDialog::m_print_error_msg
private

Referenced by update_print_error_info().

◆ m_print_info

std::string Slic3r::GUI::SyncAmsInfoDialog::m_print_info
private

◆ m_print_page_mode

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

◆ m_print_plate_idx

int Slic3r::GUI::SyncAmsInfoDialog::m_print_plate_idx {0}
private

◆ m_print_status

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

Referenced by get_status(), and show_status().

◆ m_print_type

◆ m_printer_name

wxString Slic3r::GUI::SyncAmsInfoDialog::m_printer_name
private

◆ m_refresh_timer

wxTimer* Slic3r::GUI::SyncAmsInfoDialog::m_refresh_timer {nullptr}
protected
117{nullptr};

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

◆ m_required_data_config

Slic3r::DynamicPrintConfig Slic3r::GUI::SyncAmsInfoDialog::m_required_data_config
private

◆ m_required_data_file_name

std::string Slic3r::GUI::SyncAmsInfoDialog::m_required_data_file_name
private

◆ m_required_data_file_path

std::string Slic3r::GUI::SyncAmsInfoDialog::m_required_data_file_path
private

◆ m_required_data_model

Slic3r::Model Slic3r::GUI::SyncAmsInfoDialog::m_required_data_model
private

◆ m_required_data_plate_data_list

Slic3r::PlateDataPtrs Slic3r::GUI::SyncAmsInfoDialog::m_required_data_plate_data_list
private

◆ m_reset_all_btn

ScalableButton* Slic3r::GUI::SyncAmsInfoDialog::m_reset_all_btn {nullptr}
private

◆ m_result

SyncResult Slic3r::GUI::SyncAmsInfoDialog::m_result
private

◆ m_right_image_button

wxButton* Slic3r::GUI::SyncAmsInfoDialog::m_right_image_button = nullptr
private

◆ m_right_sizer_thumbnail

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_right_sizer_thumbnail {nullptr}
private
319{nullptr};

Referenced by add_two_image_control().

◆ m_scale_factor

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

◆ m_scrolledWindow

wxScrolledWindow* Slic3r::GUI::SyncAmsInfoDialog::m_scrolledWindow {nullptr}
protected

◆ m_show_page

wxPanel* Slic3r::GUI::SyncAmsInfoDialog::m_show_page {nullptr}
protected
172{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_sizer_ams_mapping

wxFlexGridSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_ams_mapping {nullptr}
protected
166{nullptr};

Referenced by SyncAmsInfoDialog(), and reset_and_sync_ams_list().

◆ m_sizer_ams_mapping_left

wxGridSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_ams_mapping_left {nullptr}
protected
167{nullptr};

Referenced by SyncAmsInfoDialog(), and reset_and_sync_ams_list().

◆ m_sizer_ams_mapping_right

wxGridSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_ams_mapping_right {nullptr}
protected
168{nullptr};

Referenced by SyncAmsInfoDialog(), and reset_and_sync_ams_list().

◆ m_sizer_autorefill

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_autorefill {nullptr}
protected
101{nullptr};

◆ m_sizer_filament_2extruder

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_filament_2extruder
protected

Referenced by SyncAmsInfoDialog().

◆ m_sizer_main

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_main {nullptr}
protected
97{nullptr};

Referenced by SyncAmsInfoDialog(), and add_two_image_control().

◆ m_sizer_options_other

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_options_other {nullptr}
protected
93{nullptr};

Referenced by SyncAmsInfoDialog(), and hide_no_use_controls().

◆ m_sizer_options_timelapse

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_options_timelapse {nullptr}
protected
92{nullptr};

Referenced by SyncAmsInfoDialog(), and hide_no_use_controls().

◆ m_sizer_show_page

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_show_page {nullptr}
protected
173{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_sizer_this

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_this {nullptr}
protected
98{nullptr};

Referenced by SyncAmsInfoDialog().

◆ m_sizer_thumbnail

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_sizer_thumbnail {nullptr}
protected
94{nullptr};

◆ m_specify_plate_idx

◆ m_staticbitmap

wxStaticBitmap* Slic3r::GUI::SyncAmsInfoDialog::m_staticbitmap {nullptr}
protected
103{nullptr};

◆ m_statictext_ams_msg

Label* Slic3r::GUI::SyncAmsInfoDialog::m_statictext_ams_msg {nullptr}
protected
110{nullptr};

Referenced by format_text(), and update_ams_status_msg().

◆ m_staticText_bed_title

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_staticText_bed_title {nullptr}
protected
112{nullptr};

◆ m_swipe_left_bmp_disable

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_left_bmp_disable
protected

◆ m_swipe_left_bmp_hover

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_left_bmp_hover
protected

◆ m_swipe_left_bmp_normal

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_left_bmp_normal
protected

◆ m_swipe_left_button

ScalableButton* Slic3r::GUI::SyncAmsInfoDialog::m_swipe_left_button {nullptr}
protected

◆ m_swipe_left_button_enable

bool Slic3r::GUI::SyncAmsInfoDialog::m_swipe_left_button_enable
protected

◆ m_swipe_right_bmp_disable

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_right_bmp_disable
protected

◆ m_swipe_right_bmp_hover

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_right_bmp_hover
protected

◆ m_swipe_right_bmp_normal

ScalableBitmap Slic3r::GUI::SyncAmsInfoDialog::m_swipe_right_bmp_normal
protected

◆ m_swipe_right_button

ScalableButton* Slic3r::GUI::SyncAmsInfoDialog::m_swipe_right_button {nullptr}
protected

◆ m_swipe_right_button_enable

bool Slic3r::GUI::SyncAmsInfoDialog::m_swipe_right_button_enable
protected

◆ m_text_printer_msg

Label* Slic3r::GUI::SyncAmsInfoDialog::m_text_printer_msg {nullptr}
protected
111{nullptr};

Referenced by SyncAmsInfoDialog(), and update_priner_status_msg().

◆ m_thumbnailPanel

ThumbnailPanel* Slic3r::GUI::SyncAmsInfoDialog::m_thumbnailPanel {nullptr}
protected
105{nullptr};

◆ m_timeout_count

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

◆ m_tip_attention_color_map

wxString Slic3r::GUI::SyncAmsInfoDialog::m_tip_attention_color_map
private

◆ m_tip_attention_override

wxString Slic3r::GUI::SyncAmsInfoDialog::m_tip_attention_override
private

◆ m_tip_text

Label* Slic3r::GUI::SyncAmsInfoDialog::m_tip_text {nullptr}
private

◆ m_token

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

◆ m_two_image_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_two_image_panel {nullptr}
protected
129{nullptr};

Referenced by add_two_image_control(), and Show().

◆ m_two_image_panel_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_two_image_panel_sizer {nullptr}
protected
130{nullptr};

Referenced by add_two_image_control().

◆ m_two_thumbnail_panel

StaticBox* Slic3r::GUI::SyncAmsInfoDialog::m_two_thumbnail_panel {nullptr}
protected

◆ m_two_thumbnail_panel_sizer

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::m_two_thumbnail_panel_sizer {nullptr}
protected
132{nullptr};

Referenced by add_two_image_control().

◆ m_undone_str

wxString Slic3r::GUI::SyncAmsInfoDialog::m_undone_str
private

◆ m_warning_text

wxStaticText* Slic3r::GUI::SyncAmsInfoDialog::m_warning_text {nullptr}
private
317{nullptr};

Referenced by SyncAmsInfoDialog().

◆ ops_auto

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

Referenced by SyncAmsInfoDialog().

◆ ops_no_auto

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

Referenced by SyncAmsInfoDialog().

◆ RIGHT_THUMBNAIL_SIZE_WIDTH

const int Slic3r::GUI::SyncAmsInfoDialog::RIGHT_THUMBNAIL_SIZE_WIDTH = 300
private

◆ sizer_advanced_options_title

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::sizer_advanced_options_title = nullptr
private

◆ sizer_basic_right_info

wxBoxSizer* Slic3r::GUI::SyncAmsInfoDialog::sizer_basic_right_info = nullptr
private

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