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

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

Inheritance diagram for Slic3r::GUI::TabPrinter:
Collaboration diagram for Slic3r::GUI::TabPrinter:

Public Member Functions

 TabPrinter (ParamsPanel *parent)
 ~TabPrinter ()
void build () override
void build_fff ()
void build_sla ()
void reload_config () override
void activate_selected_page (std::function< void()> throw_if_canceled) override
void clear_pages () override
void toggle_options () override
void update () override
void update_fff ()
void update_sla ()
void update_pages ()
void on_gcode_flavor_changed ()
void extruders_count_changed (size_t extruders_count)
PageShp build_kinematics_page ()
void build_unregular_pages (bool from_initial_build=false)
void on_preset_loaded () override
void init_options_list () override
void msw_rescale () override
bool supports_printer_technology (const PrinterTechnology) const override
void set_extruder_volume_type (int extruder_id, NozzleVolumeType type)
void on_value_change (const std::string &opt_key, const boost::any &value) override
wxSizer * create_bed_shape_widget (wxWindow *parent)
void cache_extruder_cnt (const DynamicPrintConfig *config=nullptr)
bool apply_extruder_cnt_from_cache ()
void refresh_printer_agent_dropdown () const
Page * extruder_page () const
int extruder_page_data_index (const std::string &field_id) const
int extruder_variant_index (int extruder)
void sync_extruders_count ()
void activate_option (const std::string &opt_key, const wxString &category) override
wxWindow * parent () const
wxString title () const
std::string name () const
Preset::Type type () const
bool completed () const
void create_preset_tab ()
void add_scaled_button (wxWindow *parent, ScalableButton **btn, const std::string &icon_name, const wxString &label=wxEmptyString, long style=wxBU_EXACTFIT|wxNO_BORDER)
void add_scaled_bitmap (wxWindow *parent, ScalableBitmap &btn, const std::string &icon_name)
void update_ui_items_related_on_parent_preset (const Preset *selected_preset_parent)
void load_current_preset ()
void reactive_preset_combo_box ()
void rebuild_page_tree ()
void update_btns_enabling ()
void update_preset_choice ()
bool select_preset (std::string preset_name="", bool delete_current=false, const std::string &last_selected_ph_printer_name="", bool force_select=false, bool force_no_transfer=false)
bool may_discard_current_dirty_preset (PresetCollection *presets=nullptr, const std::string &new_printer_name="", bool no_transfer=false, bool no_transfer_variant=false)
virtual void update_description_lines ()
void OnTreeSelChange (wxCommandEvent &event)
void OnKeyDown (wxKeyEvent &event)
void compare_preset ()
void transfer_options (const std::string &name_from, const std::string &name_to, std::vector< std::string > options)
void save_preset (std::string name=std::string(), bool detach=false, bool save_to_project=false, bool from_input=false, std::string input_name="")
void delete_preset ()
void toggle_show_hide_incompatible ()
void update_show_hide_incompatible_button ()
void update_ui_from_settings ()
void update_label_colours ()
void decorate ()
void update_changed_ui ()
void get_sys_and_mod_flags (const std::string &opt_key, bool &sys_page, bool &modified_page)
void update_changed_tree_ui ()
void update_undo_buttons ()
void update_extruder_switch_colors ()
bool variant_switch_active () const
bool is_printer_extruder_page (const Page *page) const
void update_variant_sizer_visibility ()
void update_all_extruder_options_status ()
void check_extruder_options_status (int index, bool &sys_extruder, bool &modified_extruder, const std::vector< PageShp > &pages_to_check)
void on_roll_back_value (const bool to_sys=false)
PageShp add_options_page (const wxString &title, const std::string &icon, bool is_extruder_pages=false)
virtual void OnActivate ()
std::string options_list_storage_key (const std::string &opt_key) const
void load_initial_data ()
void update_dirty ()
void update_tab_ui (bool update_plater_presets=false)
void load_config (const DynamicPrintConfig &config)
void apply_preset_config_value (const std::string &opt_key, const std::string &value)
void apply_preset_config_values (const std::vector< std::pair< std::string, std::string > > &values)
void update_mode ()
void update_visibility ()
virtual void sys_color_changed ()
Field * get_field (const t_config_option_key &opt_key, int opt_index=-1) const
Field * get_field (const t_config_option_key &opt_key, Page **selected_page, int opt_index=-1)
Line * get_line (const t_config_option_key &opt_key)
std::pair< OG_CustomCtrl *, bool * > get_custom_ctrl_with_blinking_ptr (const t_config_option_key &opt_key, int opt_index=-1)
void toggle_option (const std::string &opt_key, bool toggle, int opt_index=-1)
void toggle_line (const std::string &opt_key, bool toggle, int opt_index=-1)
void set_option_label (const std::string &opt_key, const wxString &label, int opt_index=-1)
SettingRowState setting_row_state (const std::string &opt_id) const
wxSizer * description_line_widget (wxWindow *parent, ogStaticText **StaticText, wxString text=wxEmptyString)
bool current_preset_is_dirty () const
bool saved_preset_is_dirty () const
void update_saved_preset_from_current_preset ()
void update_pages_with_multi_variant ()
DynamicPrintConfig * get_config ()
PresetCollection * get_presets ()
TabPresetComboBox * get_combo_box ()
void update_wiping_button_visibility ()
void apply_searcher ()
void cache_config_diff (const std::vector< std::string > &selected_options, const DynamicPrintConfig *config=nullptr)
void apply_config_from_cache ()
void show_timelapse_warning_dialog ()
const std::map< wxString, std::string > & get_category_icon_map ()
bool update_current_page_in_background (int &item)
void unselect_tree_item ()
void set_expanded (bool value)
void restore_last_select_item ()
bool page_build_pending () const
bool page_build_step ()
bool validate_custom_gcodes ()
bool validate_filament_temperature_pairs ()
void set_just_edit (bool just_edit)
void edit_custom_gcode (const t_config_option_key &opt_key)
virtual const std::string & get_custom_gcode (const t_config_option_key &opt_key)
virtual void set_custom_gcode (const t_config_option_key &opt_key, const std::string &value)
void update_extruder_variants (int extruder_id=-1, bool reload=true)
 Call from: 1: on_value_change "nozzle_volume_type" 2: on_preset_loaded (extruder_id = -1).
void switch_excluder (int extruder_id=-1, bool reload=true)
void sync_excluder ()
void parse_extruder_selection (int selection, int &extruder_id, NozzleVolumeType &nozzle_type)
int calculate_selection_index_for_extruder (int extruder_id, NozzleVolumeType nozzle_type)
bool get_extruder_sync_enable_state (int extruder_id)
int get_current_active_extruder ()
std::vector< wxString > generate_extruder_options ()
NozzleVolumeType get_actual_nozzle_volume_type (int extruder_id)

Static Public Member Functions

static wxString translate_category (const wxString &title, Preset::Type preset_type, bool translate=true)
static bool validate_custom_gcode (const wxString &title, const std::string &gcode)

Public Attributes

ScalableButton * m_reset_to_filament_color = nullptr
size_t m_extruders_count
size_t m_extruders_count_old = 0
size_t m_initial_extruders_count
size_t m_sys_extruders_count
size_t m_cache_extruder_count = 0
std::vector< std::string > m_extruder_variant_list
std::string m_base_preset_name
PrinterTechnology m_printer_technology = ptFFF
PresetBundle * m_preset_bundle
bool m_show_btn_incompatible_presets = false
PresetCollection * m_presets = nullptr
DynamicPrintConfig * m_config
ogStaticText * m_parent_preset_description_line = nullptr
ScalableButton * m_detach_preset_btn = nullptr
std::map< std::string, wxColour > m_colored_Label_colors
int m_update_cnt = 0
ModeSwitchButton * m_mode_view = nullptr
ScalableButton * m_mode_icon = nullptr
wxSizer * m_variant_sizer = nullptr
MultiSwitchButton * m_extruder_switch = nullptr
MultiSwitchButton * m_variant_combo = nullptr
ScalableButton * m_extruder_sync = nullptr
wxPanel * m_extruder_sync_box = nullptr
bool m_extruder_switch_variants = false
std::vector< NozzleVolumeType > m_actual_nozzle_volumes
bool validate_custom_gcodes_was_shown { false }

Protected Types

enum  OptStatus { osSystemValue = 1 , osInitValue = 2 }

Protected Member Functions

void update_custom_dirty (std::vector< std::string > &dirty_options, std::vector< std::string > &nonsys_options) override
void set_type ()
void create_line_with_widget (ConfigOptionsGroup *optgroup, const std::string &opt_key, const std::string &path, widget_t widget)
wxSizer * compatible_widget_create (wxWindow *parent, PresetDependencies &deps)
void compatible_widget_reload (PresetDependencies &deps)
void load_key_value (const std::string &opt_key, const boost::any &value, bool saved_value=false)
bool commit_preset_config_value (const std::string &opt_key)
bool tree_sel_change_delayed (wxCommandEvent &event)
void on_presets_changed ()
void update_printer_agent_if_needed ()
void build_preset_description_line (ConfigOptionsGroup *optgroup)
void update_preset_description_line ()
void update_frequently_changed_parameters ()
void set_tooltips_text ()
void filter_diff_option (std::vector< std::string > &options)
ConfigManipulation get_config_manipulation ()

Protected Attributes

ParamsPanel * m_parent
Preset::Type m_type
std::string m_name
const wxString m_title
TabPresetComboBox * m_presets_choice { nullptr }
wxPanel * m_top_panel
wxBoxSizer * m_main_sizer
wxBoxSizer * m_top_sizer
wxBoxSizer * m_top_left_sizer
wxGridSizer * m_top_right_sizer
wxBoxSizer * m_select_sizer
wxBoxSizer * m_tree_sizer
ScalableButton * m_btn_compare_preset
ScalableButton * m_btn_save_preset
ScalableButton * m_btn_delete_preset
TabCtrl * m_tabctrl
wxImageList * m_icons
wxScrolledWindow * m_page_view {nullptr}
PresetDependencies m_compatible_printers
PresetDependencies m_compatible_prints
bool m_is_default_preset {false}
bool m_just_edit {false}
ScalableButton * m_undo_btn
ScalableButton * m_undo_to_sys_btn
ScalableButton * m_btn_search
StaticBox * m_search_item
TextInput * m_search_input
ScalableBitmap m_bmp_show_incompatible_presets
ScalableBitmap m_bmp_hide_incompatible_presets
ScalableBitmap m_bmp_value_lock
ScalableBitmap m_bmp_value_unlock
ScalableBitmap m_bmp_white_bullet
ScalableBitmap * m_bmp_non_system
ScalableBitmap m_bmp_value_revert
ScalableBitmap m_bmp_edit_value
std::vector< ScalableButton * > m_scaled_buttons = {}
std::vector< ScalableBitmap * > m_scaled_bitmaps = {}
std::vector< ScalableBitmap > m_scaled_icons_list = {}
wxColour m_sys_label_clr
wxColour m_modified_label_clr
wxColour m_default_text_clr
wxString m_ttg_value_lock
wxString m_ttg_value_unlock
wxString m_ttg_white_bullet_ns
wxString * m_ttg_non_system
wxString m_ttg_white_bullet
wxString m_ttg_value_revert
wxString m_tt_value_lock
wxString m_tt_value_unlock
wxString * m_tt_non_system
wxString m_tt_white_bullet
wxString m_tt_value_revert
int m_icon_count
std::map< std::string, size_t > m_icon_index
std::map< wxString, std::string > m_category_icon
std::vector< PageShp > m_pages
Page * m_active_page {nullptr}
bool m_disable_tree_sel_changed_event {false}
bool m_show_incompatible_presets
int m_last_select_item = -1
std::vector< Preset::Type > m_dependent_tabs
std::map< std::string, int > m_options_list
std::map< std::string, int > m_all_extruder_options_status
int m_opt_status_value = 0
bool m_is_modified_values { false }
bool m_is_nonsys_values { true }
bool m_postpone_update_ui {false}
int m_em_unit
bool m_completed { false }
ConfigOptionMode m_mode = comAdvanced
struct Slic3r::GUI::Tab::Highlighter m_highlighter
DynamicPrintConfig m_cache_config
std::vector< std::string > m_cache_options
bool m_page_switch_running = false
bool m_page_switch_planned = false
bool m_is_timelapse_wipe_tower_already_prompted = false
ConfigManipulation m_config_manipulation
std::string m_last_sparse_infill_rotate_template_value

Private Member Functions

void append_option_line (ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string &label_path="")
void update_input_shaper_menu (GCodeFlavor flavor)

Private Attributes

bool m_was_belt_printer = false
double m_belt_synced_tilt_x = 0.
double m_belt_synced_tilt_y = 0.
std::vector< PageShp > m_pages_fff
std::vector< PageShp > m_pages_sla
IMEXModesCtrl * m_imex_modes_ctrl {nullptr}

Detailed Description

Member Enumeration Documentation

◆ OptStatus

enum Slic3r::GUI::Tab::OptStatus
protectedinherited
Enumerator
osSystemValue 
osInitValue 
270{ osSystemValue = 1, osInitValue = 2 };
@ osInitValue
Definition Tab.hpp:270
@ osSystemValue
Definition Tab.hpp:270

Constructor & Destructor Documentation

◆ TabPrinter()

Slic3r::GUI::TabPrinter::TabPrinter ( ParamsPanel * parent)
inline
748 :
#define _L(s)
Definition OBJ.cpp:34
wxWindow * parent() const
Definition Tab.hpp:347
Tab(ParamsPanel *parent, const wxString &title, Preset::Type type)
Definition Tab.cpp:207
@ TYPE_PRINTER
Definition Preset.hpp:250

References Slic3r::GUI::Tab::Tab(), _L, and Slic3r::GUI::Tab::parent().

Here is the call graph for this function:

◆ ~TabPrinter()

Slic3r::GUI::TabPrinter::~TabPrinter ( )
inline
750{}

Member Function Documentation

◆ activate_option()

void Slic3r::GUI::TabPrinter::activate_option ( const std::string & opt_key,
const wxString & category )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

9060{
9061 wxString number;
9062 long n = 0;
9063 const bool numbered = category.StartsWith("Extruder ", &number) && number.ToLong(&n);
9064 if (extruder_page() == nullptr || (!numbered && category != "Extruder")) {
9065 Tab::activate_option(opt_key, category);
9066 return;
9067 }
9068
9069 // Selecting fires the switch's event, which re-targets the page (switch_excluder()).
9070 const int extruder_idx = (n >= 1 && n <= long(m_extruders_count)) ? int(n - 1) : 0;
9071 if (m_extruder_switch && m_extruder_switch->IsThisEnabled() && extruder_idx != get_current_active_extruder())
9073
9074 // The page's controls are created for index 0.
9075 const auto pos = opt_key.find('#');
9076 Tab::activate_option(pos == std::string::npos ? opt_key : opt_key.substr(0, pos) + "#0", "Extruder");
9077}
Page * extruder_page() const
Definition Tab.cpp:9014
size_t m_extruders_count
Definition Tab.hpp:737
MultiSwitchButton * m_extruder_switch
Definition Tab.hpp:331
virtual void activate_option(const std::string &opt_key, const wxString &category)
Definition Tab.cpp:2660
NozzleVolumeType get_actual_nozzle_volume_type(int extruder_id)
Definition Tab.cpp:9079
int get_current_active_extruder()
Definition Tab.cpp:741
int calculate_selection_index_for_extruder(int extruder_id, NozzleVolumeType nozzle_type)
Definition Tab.cpp:717
Vec3d pos(const Pt &p)
Definition ReprojectPointsOnMesh.hpp:16

References Slic3r::GUI::Tab::activate_option(), activate_option(), Slic3r::GUI::Tab::calculate_selection_index_for_extruder(), extruder_page(), Slic3r::GUI::Tab::get_actual_nozzle_volume_type(), Slic3r::GUI::Tab::get_current_active_extruder(), Slic3r::GUI::Tab::m_extruder_switch, and m_extruders_count.

Referenced by activate_option().

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

◆ activate_selected_page()

void Slic3r::GUI::TabPrinter::activate_selected_page ( std::function< void()> throw_if_canceled)
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

6523{
6524 Tab::activate_selected_page(throw_if_canceled);
6525
6526 // "extruders_count" doesn't update from the update_config(),
6527 // so update it implicitly
6528 if (m_active_page && m_active_page->title() == "Multimaterial")
6529 m_active_page->set_value("extruders_count", int(m_extruders_count));
6530
6531}
virtual void activate_selected_page(std::function< void()> throw_if_canceled)
Definition Tab.cpp:7878
Page * m_active_page
Definition Tab.hpp:264

References Slic3r::GUI::Tab::activate_selected_page(), activate_selected_page(), Slic3r::GUI::Tab::m_active_page, and m_extruders_count.

Referenced by activate_selected_page().

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

◆ add_options_page()

Slic3r::GUI::PageShp Slic3r::GUI::Tab::add_options_page ( const wxString & title,
const std::string & icon,
bool is_extruder_pages = false )
inherited
782{
783 // Index of icon in an icon list $self->{icons}.
784 auto icon_idx = 0;
785 if (!icon.empty()) {
786 icon_idx = (m_icon_index.find(icon) == m_icon_index.end()) ? -1 : m_icon_index.at(icon);
787 if (icon_idx == -1) {
788 // Add a new icon to the icon list.
789 m_scaled_icons_list.push_back(ScalableBitmap(this, icon, 32, false, true));
790 //m_icons->Add(m_scaled_icons_list.back().bmp());
791 icon_idx = ++m_icon_count;
792 m_icon_index[icon] = icon_idx;
793 }
794
795 if (m_category_icon.find(title) == m_category_icon.end()) {
796 // Add new category to the category_to_icon list.
797 m_category_icon[title] = icon;
798 }
799 }
800 // Initialize the page.
801 //BBS: GUI refactor
802 PageShp page = std::make_shared<Page>(m_page_view, title, icon_idx, this);
803// page->SetBackgroundStyle(wxBG_STYLE_SYSTEM);
804#ifdef __WINDOWS__
805// page->SetDoubleBuffered(true);
806#endif //__WINDOWS__
807
808 if (dynamic_cast<TabPrint*>(this)) {
809 page->m_split_multi_line = true;
810 page->m_option_label_at_right = true;
811 }
812
813 if (!is_extruder_pages)
814 m_pages.push_back(page);
815
816 page->set_config(m_config);
817 return page;
818}
DynamicPrintConfig * m_config
Definition Tab.hpp:314
int m_icon_count
Definition Tab.hpp:260
wxScrolledWindow * m_page_view
Definition Tab.hpp:185
std::map< wxString, std::string > m_category_icon
Definition Tab.hpp:262
wxString title() const
Definition Tab.hpp:348
std::vector< ScalableBitmap > m_scaled_icons_list
Definition Tab.hpp:234
std::vector< PageShp > m_pages
Definition Tab.hpp:263
std::map< std::string, size_t > m_icon_index
Definition Tab.hpp:261
std::shared_ptr< Page > PageShp
Definition Tab.hpp:150

References m_category_icon, m_config, m_icon_count, m_icon_index, m_page_view, m_pages, m_scaled_icons_list, and title().

Referenced by Slic3r::GUI::TabFilament::add_filament_overrides_page(), Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrint::build(), Slic3r::GUI::TabPrintModel::build(), Slic3r::GUI::TabPrintPlate::build(), Slic3r::GUI::TabPrinter::build_fff(), Slic3r::GUI::TabPrinter::build_kinematics_page(), and Slic3r::GUI::TabPrinter::build_unregular_pages().

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

◆ add_scaled_bitmap()

void Slic3r::GUI::Tab::add_scaled_bitmap ( wxWindow * parent,
ScalableBitmap & btn,
const std::string & icon_name )
inherited
767{
768 bmp = ScalableBitmap(parent, icon_name);
769 m_scaled_bitmaps.push_back(&bmp);
770}
std::vector< ScalableBitmap * > m_scaled_bitmaps
Definition Tab.hpp:233

References m_scaled_bitmaps, and parent().

Referenced by create_preset_tab().

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

◆ add_scaled_button()

void Slic3r::GUI::Tab::add_scaled_button ( wxWindow * parent,
ScalableButton ** btn,
const std::string & icon_name,
const wxString & label = wxEmptyString,
long style = wxBU_EXACTFIT | wxNO_BORDER )
inherited
758{
759 *btn = new ScalableButton(parent, wxID_ANY, icon_name, label, wxDefaultSize, wxDefaultPosition, style, true);
760 (*btn)->SetBackgroundColour(parent->GetBackgroundColour());
761 m_scaled_buttons.push_back(*btn);
762}
#define style
Definition WipeTowerDialog.cpp:101
std::vector< ScalableButton * > m_scaled_buttons
Definition Tab.hpp:232

References m_scaled_buttons, parent(), and style.

Referenced by create_preset_tab().

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

◆ append_option_line()

void Slic3r::GUI::TabPrinter::append_option_line ( ConfigOptionsGroupShp optgroup,
const std::string opt_key,
const std::string & label_path = "" )
private
5830{
5831 auto option = optgroup->get_option(opt_key, 0);
5832 auto line = Line{ option.opt.full_label, "" };
5833 line.label_path = label_path;
5834 line.append_option(option);
5835 if (m_printer_technology == ptSLA) // just for first build, if SLA printer preset is selected
5836 line.append_option(optgroup->get_option(opt_key, 1));
5837 optgroup->append_line(line);
5838}
PrinterTechnology m_printer_technology
Definition Tab.hpp:745
@ ptSLA
Definition Config.hpp:233

References append_option_line(), Slic3r::GUI::Line::label_path, m_printer_technology, and Slic3r::ptSLA.

Referenced by append_option_line(), and build_kinematics_page().

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

◆ apply_config_from_cache()

void Slic3r::GUI::Tab::apply_config_from_cache ( )
inherited
2746{
2747 bool was_applied = false;
2748 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<<boost::format(": enter");
2749 // check and apply extruders count for printer preset
2751 was_applied = static_cast<TabPrinter*>(this)->apply_extruder_cnt_from_cache();
2752
2753 if (!m_cache_config.empty()) {
2754 m_presets->get_edited_preset().config.apply_only(m_cache_config, m_cache_options);
2755 m_cache_config.clear();
2756 m_cache_options.clear();
2757
2758 was_applied = true;
2759 }
2760
2761 if (was_applied)
2762 update_dirty();
2763 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<<boost::format(": exit, was_applied=%1%")%was_applied;
2764}
PresetCollection * m_presets
Definition Tab.hpp:313
DynamicPrintConfig m_cache_config
Definition Tab.hpp:301
std::vector< std::string > m_cache_options
Definition Tab.hpp:302
Preset::Type m_type
Definition Tab.hpp:161
void update_dirty()
Definition Tab.cpp:1610

References apply_config_from_cache(), m_cache_config, m_cache_options, m_presets, m_type, Slic3r::Preset::TYPE_PRINTER, and update_dirty().

Referenced by apply_config_from_cache(), on_presets_changed(), select_preset(), and transfer_options().

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

◆ apply_extruder_cnt_from_cache()

bool Slic3r::GUI::TabPrinter::apply_extruder_cnt_from_cache ( )
8660{
8661 if (m_presets->get_edited_preset().printer_technology() == ptSLA)
8662 return false;
8663
8664 if (m_cache_extruder_count > 0) {
8665 m_presets->get_edited_preset().set_num_extruders(m_cache_extruder_count);
8667 return true;
8668 }
8669 return false;
8670}
size_t m_cache_extruder_count
Definition Tab.hpp:741

References apply_extruder_cnt_from_cache(), m_cache_extruder_count, Slic3r::GUI::Tab::m_presets, and Slic3r::ptSLA.

Referenced by apply_extruder_cnt_from_cache().

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

◆ apply_preset_config_value()

void Slic3r::GUI::Tab::apply_preset_config_value ( const std::string & opt_key,
const std::string & value )
inherited
1701{
1702 apply_preset_config_values({{opt_key, value}});
1703}
void apply_preset_config_values(const std::vector< std::pair< std::string, std::string > > &values)
Definition Tab.cpp:1709

References apply_preset_config_value(), and apply_preset_config_values().

Referenced by apply_preset_config_value().

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

◆ apply_preset_config_values()

void Slic3r::GUI::Tab::apply_preset_config_values ( const std::vector< std::pair< std::string, std::string > > & values)
inherited
1710{
1711 if (m_config == nullptr)
1712 throw std::runtime_error("The preset configuration is not available");
1713 if (wxGetApp().plater() == nullptr)
1714 throw std::runtime_error("OrcaSlicer main window is not available");
1715
1716 if (values.empty())
1717 return;
1718
1719 const std::vector<std::string>& options = preset_type_options(m_type);
1720
1721 // Preparation: reject every batch that cannot be applied before touching the edited preset, so a
1722 // bad key or value fails without a partial write. The key must belong to this preset type, it must
1723 // not repeat, and each value is strict-parsed into a scratch copy (the strict deserializer can
1724 // already have mutated an option when it rejects a bad value, so the check has to run somewhere
1725 // the edited preset is not affected). Callback failures cannot be prepared this way: a setting's
1726 // on_change callback is a GUI method, not a pure function of the config, so whether it throws is
1727 // only known by running it. That residual case is handled by the rollback below.
1728 std::set<std::string> seen;
1729 DynamicPrintConfig scratch(*m_config);
1730 for (const auto& kv : values) {
1731 const std::string& opt_key = kv.first;
1732 if (std::find(options.begin(), options.end(), opt_key) == options.end())
1733 throw std::invalid_argument(format("Unknown %1% preset setting \"%2%\"", preset_type_name(m_type), opt_key));
1734 if (!seen.insert(opt_key).second)
1735 throw std::invalid_argument(format("%1% preset setting \"%2%\" is set more than once in the same update",
1736 preset_type_name(m_type), opt_key));
1737 try {
1738 scratch.set_deserialize_strict(opt_key, kv.second);
1739 } catch (const ConfigurationError& err) {
1740 throw std::invalid_argument(err.what());
1741 }
1742 }
1743
1744 // Rollback boundary: snapshot the whole edited config, not just the keys the batch names, because a
1745 // key-specific callback can adjust related settings of the edited preset (mutually exclusive
1746 // options, compatibility, and so on). A failure restores this config and then recomputes the state
1747 // derived from it.
1748 DynamicPrintConfig before(*m_config);
1749 try {
1750 for (const auto& kv : values) {
1751 m_config->set_deserialize_strict(kv.first, kv.second);
1752 if (!commit_preset_config_value(kv.first))
1753 // The GUI edits this setting through a custom widget rather than a group (e.g.
1754 // compatible_printers), so take the same shared no-field commit path the widget uses.
1755 // The value was written above, so saved mode skips the write and keeps the path's
1756 // compatibility recompute, dirty flag, preset-combo and plater updates.
1757 load_key_value(kv.first, boost::any(), /*saved_value=*/true);
1758 }
1759 } catch (...) {
1760 *m_config = before;
1761 // A callback can rewrite state derived from the config (compatibility marks, the preset
1762 // selector, dependent tabs, the Plater and, on the printer tab, the printer agent) before it
1763 // throws. Recompute that derived state from the restored config so none of it is left
1764 // reflecting the failed batch. Effects that are not a function of the config (a dialog the
1765 // user already accepted, an undo snapshot, a command already sent to a device, the target
1766 // selection) cannot be reversed here; see the header.
1768 reload_config();
1769 update_dirty();
1770 update();
1771 throw;
1772 }
1773
1774 // Apply the batch's final state once. The commit paths above already maintained the dirty flag,
1775 // preset combo and, on the printer tab, the printer-agent switch; this reloads the visible page
1776 // and pushes the config to the Plater.
1777 reload_config();
1778 update_dirty();
1779 update();
1780}
bool commit_preset_config_value(const std::string &opt_key)
Definition Tab.cpp:1683
virtual void reload_config()
Definition Tab.cpp:1783
void load_key_value(const std::string &opt_key, const boost::any &value, bool saved_value=false)
Definition Tab.cpp:2018
PresetBundle * m_preset_bundle
Definition Tab.hpp:311
virtual void update()=0
static const std::vector< std::string > & preset_type_options(Preset::Type type)
Definition Tab.cpp:1654
static Plater * plater()
Definition GUI_Factories.cpp:400
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:36
static const char * preset_type_name(Preset::Type type)
Definition Tab.cpp:1665
@ Never
Definition Preset.hpp:523

References apply_preset_config_values(), commit_preset_config_value(), Slic3r::format(), load_key_value(), m_config, m_preset_bundle, m_type, Slic3r::Never, Slic3r::GUI::plater(), Slic3r::GUI::preset_type_name(), Slic3r::GUI::preset_type_options(), reload_config(), Slic3r::ConfigBase::set_deserialize_strict(), update(), and update_dirty().

Referenced by apply_preset_config_value(), apply_preset_config_values(), and Slic3r::anonymous_namespace{PluginHostPresets.cpp}::PresetTransaction::commit().

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

◆ apply_searcher()

void Slic3r::GUI::Tab::apply_searcher ( )
inherited
2735{
2736 wxGetApp().sidebar().get_searcher().apply(m_config, m_type, m_mode);
2737}
ConfigOptionMode m_mode
Definition Tab.hpp:284

References apply_searcher(), m_config, m_mode, and m_type.

Referenced by apply_searcher(), and Slic3r::GUI::TabPrinter::build_unregular_pages().

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

◆ build()

void Slic3r::GUI::TabPrinter::build ( )
overridevirtual

Implements Slic3r::GUI::Tab.

5392{
5393 m_presets = &m_preset_bundle->printers;
5394 m_printer_technology = m_presets->get_selected_preset().printer_technology();
5395
5396 // For DiffPresetDialog we use options list which is saved in Searcher class.
5397 // Options for the Searcher is added in the moment of pages creation.
5398 // So, build first of all printer pages for non-selected printer technology...
5399 //std::string def_preset_name = "- default " + std::string(m_printer_technology == ptSLA ? "FFF" : "SLA") + " -";
5400 std::string def_preset_name = "Default Printer";
5401 m_config = &m_presets->find_preset(def_preset_name)->config;
5404 m_extruders_count_old = 0;// revert this value
5405
5406 // ... and than for selected printer technology
5409}
void build_fff()
Definition Tab.cpp:5411
size_t m_extruders_count_old
Definition Tab.hpp:738
void build_sla()
Definition Tab.cpp:5743
void load_initial_data()
Definition Tab.cpp:772

References build(), build_fff(), build_sla(), Slic3r::GUI::Tab::load_initial_data(), Slic3r::GUI::Tab::m_config, m_extruders_count_old, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::GUI::Tab::m_presets, m_printer_technology, and Slic3r::ptSLA.

Referenced by build().

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

◆ build_fff()

void Slic3r::GUI::TabPrinter::build_fff ( )
5412{
5413 if (!m_pages.empty())
5414 m_pages.resize(0);
5415 // to avoid redundant memory allocation / deallocation during extruders count changing
5416 m_pages.reserve(30);
5417
5418 auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"));
5420 m_extruder_variant_list = m_config->option<ConfigOptionStrings>("printer_extruder_variant")->values;
5421 // BBS
5422 //wxGetApp().obj_list()->update_objects_list_filament_column(m_initial_extruders_count);
5423
5424 const Preset* parent_preset = m_printer_technology == ptSLA ? nullptr // just for first build, if SLA printer preset is selected
5425 : m_presets->get_selected_preset_parent();
5426 m_sys_extruders_count = parent_preset == nullptr ? 0 :
5427 static_cast<const ConfigOptionFloats*>(parent_preset->config.option("nozzle_diameter"))->values.size();
5428
5429 auto page = add_options_page(L("Basic information"), "custom-gcode_object-info"); // ORCA: icon only visible on placeholders
5430 auto optgroup = page->new_optgroup(L("Printable space"), "param_printable_space");
5431
5432 create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
5433 return create_bed_shape_widget(parent);
5434 });
5435 optgroup->append_single_option_line("parallel_printheads_count");
5436 Option option = optgroup->get_option("bed_exclude_area");
5437 option.opt.full_width = true;
5438 optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area");
5439
5440 option = optgroup->get_option("bed_exclude_volumes");
5441 option.opt.full_width = true;
5442 optgroup->append_single_option_line(option, "printer_basic_information_printable_space#toolhead-collision-volumes");
5443 optgroup->append_single_option_line("bed_exclude_volume_mode", "printer_basic_information_printable_space#toolhead-collision-volumes");
5444
5445 optgroup->append_single_option_line("printable_height", "printer_basic_information_printable_space#printable-height");
5446 optgroup->append_single_option_line("support_multi_bed_types", "printer_basic_information_printable_space#support-multi-bed-types");
5447 optgroup->append_single_option_line("best_object_pos", "printer_basic_information_printable_space#best-object-position");
5448 optgroup->append_single_option_line("z_offset", "printer_basic_information_printable_space#z-offset");
5449 optgroup->append_single_option_line("preferred_orientation", "printer_basic_information_printable_space#preferred-orientation");
5450
5451 optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
5452
5453 optgroup->append_single_option_line("printer_structure", "printer_basic_information_advanced#printer-structure");
5454 optgroup->append_single_option_line("gcode_flavor", "printer_basic_information_advanced#g-code-flavor");
5455 optgroup->append_single_option_line("gcode_skip_config_block", "printer_basic_information_advanced#skip-g-code-config-block");
5456 optgroup->append_single_option_line("pellet_modded_printer", "printer_basic_information_advanced#pellet-modded-printer");
5457 optgroup->append_single_option_line("bbl_use_printhost", "printer_basic_information_advanced#use-3rd-party-print-host");
5458
5459 // "Printer Agent" dropdown - printer_agent is a coString; gui_type routes it to
5460 // PrinterAgentChoice instead of a TextCtrl. Rows and values come from the live agent
5461 // registry, and the value is stored as the agent-id string.
5462 if (wxGetApp().getAgent() != nullptr)
5463 {
5464 auto registered_printer_agents = NetworkAgentFactory::get_registered_printer_agents();
5465 if (!registered_printer_agents.empty())
5466 {
5467 option = optgroup->get_option("printer_agent");
5469 option.opt.width = Field::def_width_wider();
5470 option.opt.tooltip = L("Select the network agent implementation for printer communication. "
5471 "Available agents are registered at startup.");
5472 optgroup->append_single_option_line(option, "printer_basic_information_advanced#printer-agent");
5473 }
5474 }
5475
5476 optgroup->append_single_option_line("use_3mf");
5477 optgroup->append_single_option_line("scan_first_layer" , "printer_basic_information_advanced#scan-first-layer");
5478 optgroup->append_single_option_line("enable_power_loss_recovery", "printer_basic_information_advanced#power-loss-recovery");
5479 //option = optgroup->get_option("wrapping_exclude_area");
5480 //option.opt.full_width = true;
5481 //optgroup->append_single_option_line(option);
5482 optgroup->append_single_option_line("disable_m73", "printer_basic_information_advanced#disable-set-remaining-print-time");
5483
5484 // Belt printer: dedicated section. Everything except the "Enable belt printing"
5485 // checkbox is hidden when belt_printer is off (see TabPrinter::toggle_options).
5486 auto belt_og = page->new_optgroup(L("Belt printer"), L"param_advanced");
5487 belt_og->append_single_option_line("belt_printer", "printer_basic_information_belt_printer#enable-belt-printing");
5488 belt_og->append_single_option_line("belt_printer_infinite_y", "printer_basic_information_belt_printer#infinite-y-axis");
5489 // Belt tilt: the sole mesh-side transform and the single source of truth for
5490 // the physical tilt (drives bed rendering and support gravity tilt too).
5491 // Isometric rotation, no distortion; the back-transform inverts it before the
5492 // machine-frame remap. The angle is what a user checks against the machine;
5493 // the axis is a profile-level kinematics choice, so it is Develop-only. They
5494 // are separate rows because a shared line is shown by its first option's mode.
5495 belt_og->append_single_option_line("belt_slice_rotation_angle", "printer_basic_information_belt_printer#tilt-angle");
5496 belt_og->append_single_option_line("belt_slice_rotation", "printer_basic_information_belt_printer#tilt-axis");
5497 belt_og->append_single_option_line("belt_support_floor_offset", "printer_basic_information_belt_printer#support-floor-z-offset");
5498
5499 // Machine-frame transform: the shear (cot) + scale (1/sin) that map
5500 // Cartesian G-code into the printer's physical machine frame are derived
5501 // from the belt tilt angle. Only the post-slice axis remap and the expert
5502 // decouple override are exposed here, one option per row.
5503 {
5504 auto mf = page->new_optgroup(L("Machine frame transforms"), L"param_advanced");
5505 mf->append_single_option_line("gcode_remap_x", "printer_basic_information_machine_frame_transforms#g-code-axis-remap");
5506 mf->append_single_option_line("gcode_remap_y", "printer_basic_information_machine_frame_transforms#g-code-axis-remap");
5507 mf->append_single_option_line("gcode_remap_z", "printer_basic_information_machine_frame_transforms#g-code-axis-remap");
5508 mf->append_single_option_line("belt_frame_tilt_decouple", "printer_basic_information_machine_frame_transforms#machine-frame-tilt");
5509 mf->append_single_option_line("belt_frame_tilt_angle", "printer_basic_information_machine_frame_transforms#machine-frame-tilt");
5510 }
5511
5512 option = optgroup->get_option("thumbnails");
5513 option.opt.full_width = true;
5514 optgroup->append_single_option_line(option, "printer_basic_information_advanced#g-code-thumbnails");
5515 // optgroup->append_single_option_line("thumbnails_format");
5516 optgroup->m_on_change = [this](t_config_option_key opt_key, boost::any value) {
5517 wxTheApp->CallAfter([this, opt_key, value]() {
5518 if (opt_key == "thumbnails" && m_config->has("thumbnails_format")) {
5519 // to backward compatibility we need to update "thumbnails_format" from new "thumbnails"
5520 const std::string val = boost::any_cast<std::string>(value);
5521 if (!value.empty()) {
5522 auto [thumbnails_list, errors] = GCodeThumbnails::make_and_check_thumbnail_list(val);
5523
5524 if (errors != enum_bitmask<ThumbnailError>()) {
5525 // TRN: The first argument is the parameter's name; the second argument is its value.
5526 std::string error_str = format(_u8L("Invalid value provided for parameter %1%: %2%"), "thumbnails", val);
5527 error_str += GCodeThumbnails::get_error_string(errors);
5528 InfoDialog(parent(), _L("G-code flavor is switched"), from_u8(error_str)).ShowModal();
5529 }
5530
5531 if (!thumbnails_list.empty()) {
5532 GCodeThumbnailsFormat old_format = GCodeThumbnailsFormat(m_config->option("thumbnails_format")->getInt());
5533 GCodeThumbnailsFormat new_format = thumbnails_list.begin()->first;
5534 if (old_format != new_format) {
5535 DynamicPrintConfig new_conf = *m_config;
5536
5537 auto* opt = m_config->option("thumbnails_format")->clone();
5538 opt->setInt(int(new_format));
5539 new_conf.set_key_value("thumbnails_format", opt);
5540
5541 load_config(new_conf);
5542 }
5543 }
5544 }
5545 }
5546
5547 update_dirty();
5548 on_value_change(opt_key, value);
5549 });
5550 };
5551
5552 optgroup->append_single_option_line("use_relative_e_distances", "printer_basic_information_advanced#use-relative-e-distances");
5553 optgroup->append_single_option_line("use_firmware_retraction", "printer_basic_information_advanced#use-firmware-retraction");
5554 // optgroup->append_single_option_line("spaghetti_detector");
5555 optgroup->append_single_option_line("time_cost", "printer_basic_information_advanced#time-cost");
5556 optgroup->append_single_option_line("build_plate_tilt_x", "printer_basic_information_advanced#build-plate-tilt");
5557 optgroup->append_single_option_line("build_plate_tilt_y", "printer_basic_information_advanced#build-plate-tilt");
5558
5559 optgroup = page->new_optgroup(L("Plugin Configuration"), L"param_gcode");
5560 optgroup->append_single_option_line("printer_plugin_config_overrides");
5561
5562 optgroup = page->new_optgroup(L("Cooling Fan"), "param_cooling_fan");
5563 Line line = Line{ L("Fan speed-up time"), optgroup->get_option("fan_speedup_time").opt.tooltip };
5564 line.label_path = "printer_basic_information_cooling_fan#fan-speed-up-time";
5565 line.append_option(optgroup->get_option("fan_speedup_time"));
5566 line.append_option(optgroup->get_option("fan_speedup_overhangs"));
5567 optgroup->append_line(line);
5568 optgroup->append_single_option_line("fan_kickstart", "printer_basic_information_cooling_fan#fan-kick-start-time");
5569 // ORCA: PWM floor for fans that won't spool at low duty cycles.
5570 optgroup->append_single_option_line("part_cooling_fan_min_pwm", "printer_basic_information_cooling_fan#minimum-non-zero-part-cooling-fan-speed");
5571
5572 optgroup = page->new_optgroup(L("Extruder Clearance"), "param_extruder_clearance");
5573 optgroup->append_single_option_line("extruder_clearance_radius", "printer_basic_information_extruder_clearance#radius");
5574 optgroup->append_single_option_line("extruder_clearance_dist_to_rod", "printer_basic_information_extruder_clearance#distance-to-rod");
5575 optgroup->append_single_option_line("extruder_clearance_height_to_rod", "printer_basic_information_extruder_clearance#height-to-rod");
5576 optgroup->append_single_option_line("extruder_clearance_height_to_lid", "printer_basic_information_extruder_clearance#height-to-lid");
5577
5578 optgroup = page->new_optgroup(L("Adaptive bed mesh"), "param_adaptive_mesh");
5579 optgroup->append_single_option_line("bed_mesh_min", "printer_basic_information_adaptive_bed_mesh#bed-mesh");
5580 optgroup->append_single_option_line("bed_mesh_max", "printer_basic_information_adaptive_bed_mesh#bed-mesh");
5581 optgroup->append_single_option_line("bed_mesh_probe_distance", "printer_basic_information_adaptive_bed_mesh#probe-point-distance");
5582 optgroup->append_single_option_line("adaptive_bed_mesh_margin", "printer_basic_information_adaptive_bed_mesh#mesh-margin");
5583
5584 optgroup = page->new_optgroup(L("Accessory"), "param_accessory");
5585 optgroup->append_single_option_line("nozzle_hrc", "printer_basic_information_accessory#nozzle-hrc");
5586 optgroup->append_single_option_line("auxiliary_fan", "printer_basic_information_accessory#auxiliary-part-cooling-fan");
5587 optgroup->append_single_option_line("fan_direction");
5588 optgroup->append_single_option_line("support_chamber_temp_control", "printer_basic_information_accessory#support-controlling-chamber-temperature");
5589 optgroup->append_single_option_line("support_air_filtration", "printer_basic_information_accessory#support-air-filtration");
5590 optgroup->append_single_option_line("cooling_filter_enabled");
5591
5592 auto edit_custom_gcode_fn = [this](const t_config_option_key& opt_key) { edit_custom_gcode(opt_key); };
5593
5594 const int gcode_field_height = 15; // 150
5595 const int notes_field_height = 25; // 250
5596 page = add_options_page(L("Machine G-code"), "custom-gcode_gcode"); // ORCA: icon only visible on placeholders
5597 optgroup = page->new_optgroup(L("File header G-code"), L"param_gcode", 0);
5598 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5599 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5600 };
5601 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5602 option = optgroup->get_option("file_start_gcode");
5603 option.opt.full_width = true;
5604 option.opt.is_code = true;
5605 option.opt.height = 8;
5606 optgroup->append_single_option_line(option);
5607
5608 optgroup = page->new_optgroup(L("Machine start G-code"), L"param_gcode", 0);
5609 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5610 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5611 };
5612 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5613 option = optgroup->get_option("machine_start_gcode");
5614 option.opt.full_width = true;
5615 option.opt.is_code = true;
5616 option.opt.height = gcode_field_height;//150;
5617 optgroup->append_single_option_line(option, "printer_machine_gcode#machine-start-g-code");
5618
5619 optgroup = page->new_optgroup(L("Machine end G-code"), L"param_gcode", 0);
5620 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5621 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5622 };
5623 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5624 option = optgroup->get_option("machine_end_gcode");
5625 option.opt.full_width = true;
5626 option.opt.is_code = true;
5627 option.opt.height = gcode_field_height;//150;
5628 optgroup->append_single_option_line(option, "printer_machine_gcode#machine-end-g-code");
5629
5630 optgroup = page->new_optgroup(L("Printing by object G-code"), L"param_gcode", 0);
5631 optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) {
5632 validate_custom_gcode_cb(this, optgroup, opt_key, value);
5633 };
5634 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5635 option = optgroup->get_option("printing_by_object_gcode");
5636 option.opt.full_width = true;
5637 option.opt.is_code = true;
5638 option.opt.height = gcode_field_height; // 150;
5639 optgroup->append_single_option_line(option, "printer_machine_gcode#printing-by-object-g-code");
5640
5641
5642 optgroup = page->new_optgroup(L("Before layer change G-code"),"param_gcode", 0);
5643 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5644 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5645 };
5646 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5647 option = optgroup->get_option("before_layer_change_gcode");
5648 option.opt.full_width = true;
5649 option.opt.is_code = true;
5650 option.opt.height = gcode_field_height;//150;
5651 optgroup->append_single_option_line(option, "printer_machine_gcode#before-layer-change-g-code");
5652
5653 optgroup = page->new_optgroup(L("Layer change G-code"), L"param_gcode", 0);
5654 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5655 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5656 };
5657 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5658 option = optgroup->get_option("layer_change_gcode");
5659 option.opt.full_width = true;
5660 option.opt.is_code = true;
5661 option.opt.height = gcode_field_height;//150;
5662 optgroup->append_single_option_line(option, "printer_machine_gcode#layer-change-g-code");
5663
5664 optgroup = page->new_optgroup(L("Timelapse G-code"), L"param_gcode", 0);
5665 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5666 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5667 };
5668 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5669 option = optgroup->get_option("time_lapse_gcode");
5670 option.opt.full_width = true;
5671 option.opt.is_code = true;
5672 option.opt.height = gcode_field_height;//150;
5673 optgroup->append_single_option_line(option, "printer_machine_gcode#timelapse-g-code");
5674
5675 optgroup = page->new_optgroup(L("Clumping Detection G-code"), L"param_gcode", 0);
5676 optgroup->m_on_change = [this, optgroup](const t_config_option_key &opt_key, const boost::any &value) {
5677 validate_custom_gcode_cb(this, optgroup, opt_key, value);
5678 };
5679 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5680 option = optgroup->get_option("wrapping_detection_gcode");
5681 option.opt.full_width = true;
5682 option.opt.is_code = true;
5683 option.opt.height = gcode_field_height; // 150;
5684 optgroup->append_single_option_line(option, "printer_machine_gcode#clumping-detection-g-code");
5685
5686 optgroup = page->new_optgroup(L("Change filament G-code"), L"param_gcode", 0);
5687 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5688 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5689 };
5690 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5691 option = optgroup->get_option("change_filament_gcode");
5692 option.opt.full_width = true;
5693 option.opt.is_code = true;
5694 option.opt.height = gcode_field_height;//150;
5695 optgroup->append_single_option_line(option, "printer_machine_gcode#change-filament-g-code");
5696
5697 optgroup = page->new_optgroup(L("Change extrusion role G-code"), L"param_gcode", 0);
5698 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key &opt_key, const boost::any &value) {
5699 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5700 };
5701 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5702 option = optgroup->get_option("change_extrusion_role_gcode");
5703 option.opt.full_width = true;
5704 option.opt.is_code = true;
5705 option.opt.height = gcode_field_height;//150;
5706 optgroup->append_single_option_line(option, "printer_machine_gcode#change-extrusion-role-g-code");
5707
5708 optgroup = page->new_optgroup(L("Pause G-code"), L"param_gcode", 0);
5709 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5710 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5711 };
5712 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5713 option = optgroup->get_option("machine_pause_gcode");
5714 option.opt.is_code = true;
5715 option.opt.height = gcode_field_height;//150;
5716 optgroup->append_single_option_line(option, "printer_machine_gcode#pause-g-code");
5717
5718 optgroup = page->new_optgroup(L("Template Custom G-code"), L"param_gcode", 0);
5719 optgroup->m_on_change = [this, &optgroup_title = optgroup->title](const t_config_option_key& opt_key, const boost::any& value) {
5720 validate_custom_gcode_cb(this, optgroup_title, opt_key, value);
5721 };
5722 optgroup->edit_custom_gcode = edit_custom_gcode_fn;
5723 option = optgroup->get_option("template_custom_gcode");
5724 option.opt.is_code = true;
5725 option.opt.height = gcode_field_height;//150;
5726 optgroup->append_single_option_line(option, "printer_machine_gcode#template-custom-g-code");
5727
5728 page = add_options_page(L("Notes"), "custom-gcode_note"); // ORCA: icon only visible on placeholders
5729 optgroup = page->new_optgroup(L("Notes"), "note", 0);
5730 option = optgroup->get_option("printer_notes");
5731 option.opt.full_width = true;
5732 option.opt.height = notes_field_height;//250;
5733 optgroup->append_single_option_line(option);
5734#if 0
5735 //page = add_options_page(L("Dependencies"), "advanced");
5736 // optgroup = page->new_optgroup(L("Profile dependencies"));
5737
5738 // build_preset_description_line(optgroup.get());
5739#endif
5741}
#define L(s)
Definition ExtrusionEntity.cpp:25
@ printer_agent_select
Definition Config.hpp:2338
std::vector< double > values
Definition Config.hpp:418
static int def_width_wider()
Definition Field.cpp:402
void on_value_change(const std::string &opt_key, const boost::any &value) override
Definition Tab.cpp:6983
size_t m_sys_extruders_count
Definition Tab.hpp:740
void build_unregular_pages(bool from_initial_build=false)
Definition Tab.cpp:5927
std::vector< std::string > m_extruder_variant_list
Definition Tab.hpp:742
size_t m_initial_extruders_count
Definition Tab.hpp:739
void load_config(const DynamicPrintConfig &config)
Definition Tab.cpp:1635
void create_line_with_widget(ConfigOptionsGroup *optgroup, const std::string &opt_key, const std::string &path, widget_t widget)
Definition Tab.cpp:8428
PageShp add_options_page(const wxString &title, const std::string &icon, bool is_extruder_pages=false)
Definition Tab.cpp:781
void edit_custom_gcode(const t_config_option_key &opt_key)
Definition Tab.cpp:4378
static std::vector< PrinterAgentInfo > get_registered_printer_agents()
Definition NetworkAgentFactory.cpp:114
std::pair< GCodeThumbnailDefinitionsList, ThumbnailErrors > make_and_check_thumbnail_list(const std::string &thumbnails_string, const std::string_view def_ext)
Definition Thumbnails.cpp:546
std::string get_error_string(const ThumbnailErrors &errors)
Definition Thumbnails.cpp:609
static void validate_custom_gcode_cb(Tab *tab, const wxString &title, const t_config_option_key &opt_key, const boost::any &value)
Definition Tab.cpp:4354
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
zaa_minimize_perimeter_height nozzle_diameter((ConfigOptionBool, reduce_infill_retraction))((ConfigOptionBool
std::string t_config_option_key
Definition Config.hpp:96
@ Preset
Definition calib.hpp:39
GCodeThumbnailsFormat
Definition PrintConfig.hpp:597
ConfigOptionFloatsTempl< false > ConfigOptionFloats
Definition Config.hpp:1015
#define _u8L(s)
Definition I18N.hpp:11

References _L, _u8L, Slic3r::GUI::Tab::add_options_page(), Slic3r::GUI::Line::append_option(), build_fff(), build_unregular_pages(), Slic3r::GUI::Tab::create_line_with_widget(), Slic3r::GUI::Field::def_width_wider(), Slic3r::GUI::Tab::edit_custom_gcode(), Slic3r::format(), Slic3r::from_u8(), Slic3r::ConfigOptionDef::full_width, Slic3r::GCodeThumbnails::get_error_string(), Slic3r::NetworkAgentFactory::get_registered_printer_agents(), Slic3r::ConfigOptionDef::gui_type, Slic3r::ConfigOptionDef::height, Slic3r::ConfigOptionDef::is_code, L, Slic3r::GUI::Line::label_path, Slic3r::load_config(), Slic3r::GUI::Tab::m_config, m_extruder_variant_list, m_extruders_count, m_initial_extruders_count, Slic3r::GUI::Tab::m_pages, Slic3r::GUI::Tab::m_presets, m_printer_technology, m_sys_extruders_count, Slic3r::GCodeThumbnails::make_and_check_thumbnail_list(), Slic3r::nozzle_diameter(), on_value_change(), Slic3r::GUI::Option::opt, Slic3r::GUI::Tab::parent(), Slic3r::ConfigOptionDef::printer_agent_select, Slic3r::ptSLA, Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::ConfigOptionDef::tooltip, Slic3r::GUI::Tab::update_dirty(), Slic3r::GUI::validate_custom_gcode_cb(), and Slic3r::ConfigOptionDef::width.

Referenced by build(), build_fff(), and update_pages().

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

◆ build_kinematics_page()

PageShp Slic3r::GUI::TabPrinter::build_kinematics_page ( )
5841{
5842 auto page = add_options_page(L("Motion ability"), "custom-gcode_motion", true); // ORCA: icon only visible on placeholders
5843
5844 auto optgroup = page->new_optgroup(L("Advanced"), "param_advanced");
5845 optgroup->append_single_option_line("emit_machine_limits_to_gcode", "printer_motion_ability#emit-limits-to-g-code");
5846
5847 // resonance avoidance ported over from qidi slicer
5848 optgroup = page->new_optgroup(L("Resonance Compensation"), "param_resonance_avoidance");
5849 optgroup->append_single_option_line("resonance_avoidance", "printer_motion_ability#resonance-avoidance");
5850 // Resonance‑avoidance speed inputs
5851 {
5852 Line resonance_line = {L("Resonance Avoidance Speed"), L""};
5853 resonance_line.label_path = "printer_motion_ability#resonance-avoidance";
5854 resonance_line.append_option(optgroup->get_option("min_resonance_avoidance_speed"));
5855 resonance_line.append_option(optgroup->get_option("max_resonance_avoidance_speed"));
5856 optgroup->append_line(resonance_line);
5857 }
5858 optgroup->append_single_option_line("input_shaping_emit", "printer_motion_ability#input-shaping");
5859 optgroup->append_single_option_line("input_shaping_type", "printer_motion_ability#input-shaping-type");
5860 {
5861 Line freq_line = {L("Frequency"), L("The frequency of the anti-vibration signal will correspond to the natural frequency of the frame.")};
5862 freq_line.label_path = "printer_motion_ability#input-shaping";
5863 freq_line.append_option(optgroup->get_option("input_shaping_freq_x"));
5864 freq_line.append_option(optgroup->get_option("input_shaping_freq_y"));
5865 optgroup->append_line(freq_line);
5866 }
5867 {
5868 Line damping_line = {L("Damping"), L("Damping ratio for the input shaping filter.")};
5869 damping_line.label_path = "printer_motion_ability#input-shaping";
5870 damping_line.append_option(optgroup->get_option("input_shaping_damp_x"));
5871 damping_line.append_option(optgroup->get_option("input_shaping_damp_y"));
5872 optgroup->append_line(damping_line);
5873 }
5874
5875 const std::vector<std::string> speed_axes{
5876 "machine_max_speed_x",
5877 "machine_max_speed_y",
5878 "machine_max_speed_z",
5879 "machine_max_speed_e"
5880 };
5881 optgroup = page->new_optgroup(L("Speed limitation"), "param_speed");
5882 for (const std::string &speed_axis : speed_axes) {
5883 append_option_line(optgroup, speed_axis, "printer_motion_ability#speed-limitation");
5884 }
5885
5886 const std::vector<std::string> axes{ "x", "y", "z", "e" };
5887 optgroup = page->new_optgroup(L("Acceleration limitation"), "param_acceleration");
5888 for (const std::string &axis : axes) {
5889 append_option_line(optgroup, "machine_max_acceleration_" + axis, "printer_motion_ability#acceleration-limitation");
5890 }
5891 append_option_line(optgroup, "machine_max_acceleration_extruding", "printer_motion_ability#acceleration-limitation");
5892 append_option_line(optgroup, "machine_max_acceleration_retracting", "printer_motion_ability#acceleration-limitation");
5893 append_option_line(optgroup, "machine_max_acceleration_travel", "printer_motion_ability#acceleration-limitation");
5894
5895 optgroup = page->new_optgroup(L("Jerk limitation"), "param_jerk");
5896 // machine max junction deviation
5897 append_option_line(optgroup, "machine_max_junction_deviation", "printer_motion_ability#maximum-junction-deviation");
5898 for (const std::string &axis : axes) {
5899 append_option_line(optgroup, "machine_max_jerk_" + axis, "printer_motion_ability#maximum-jerk");
5900 }
5901
5902 //optgroup = page->new_optgroup(L("Minimum feedrates"));
5903 // append_option_line(optgroup, "machine_min_extruding_rate");
5904 // append_option_line(optgroup, "machine_min_travel_rate");
5905
5906 return page;
5907}
void append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string &label_path="")
Definition Tab.cpp:5829

References Slic3r::GUI::Tab::add_options_page(), Slic3r::GUI::Line::append_option(), append_option_line(), build_kinematics_page(), L, and Slic3r::GUI::Line::label_path.

Referenced by build_kinematics_page(), and build_unregular_pages().

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

◆ build_preset_description_line()

void Slic3r::GUI::Tab::build_preset_description_line ( ConfigOptionsGroup * optgroup)
protectedinherited
2826{
2827 auto description_line = [this](wxWindow* parent) {
2829 };
2830
2831 auto detach_preset_btn = [this](wxWindow* parent) {
2832 m_detach_preset_btn = new ScalableButton(parent, wxID_ANY, "lock_normal", "",
2833 wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
2834 ScalableButton* btn = m_detach_preset_btn;
2835 btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
2836
2837 auto sizer = new wxBoxSizer(wxHORIZONTAL);
2838 sizer->Add(btn);
2839
2840 btn->Bind(wxEVT_BUTTON, [this, parent](wxCommandEvent&)
2841 {
2842 bool system = m_presets->get_edited_preset().is_system;
2843 bool dirty = m_presets->get_edited_preset().is_dirty;
2844 wxString msg_text = system ?
2845 _(L("A copy of the current system preset will be created, which will be detached from the system preset.")) :
2846 _(L("The current custom preset will be detached from the parent system preset."));
2847 if (dirty) {
2848 msg_text += "\n\n";
2849 msg_text += _(L("Modifications to the current profile will be saved."));
2850 }
2851 msg_text += "\n\n";
2852 msg_text += _(L("This action is not revertible.\nDo you want to proceed?"));
2853
2854 //wxMessageDialog dialog(parent, msg_text, _(L("Detach preset")), wxICON_WARNING | wxYES_NO | wxCANCEL);
2855 MessageDialog dialog(parent, msg_text, _(L("Detach preset")), wxICON_WARNING | wxYES_NO | wxCANCEL);
2856 if (dialog.ShowModal() == wxID_YES)
2857 save_preset(m_presets->get_edited_preset().is_system ? std::string() : m_presets->get_edited_preset().name, true);
2858 });
2859
2860 btn->Hide();
2861
2862 return sizer;
2863 };
2864
2865 Line line = Line{ "", "" };
2866 line.full_width = 1;
2867
2868 line.append_widget(description_line);
2869 line.append_widget(detach_preset_btn);
2870 optgroup->append_line(line);
2871}
#define _(s)
Definition 3mf.cpp:306
wxSizer * description_line_widget(wxWindow *parent, ogStaticText **StaticText, wxString text=wxEmptyString)
Definition Tab.cpp:5341
ogStaticText * m_parent_preset_description_line
Definition Tab.hpp:315
void save_preset(std::string name=std::string(), bool detach=false, bool save_to_project=false, bool from_input=false, std::string input_name="")
Definition Tab.cpp:8121
ScalableButton * m_detach_preset_btn
Definition Tab.hpp:316

References _, Slic3r::GUI::OptionsGroup::append_line(), Slic3r::GUI::Line::append_widget(), build_preset_description_line(), description_line_widget(), Slic3r::GUI::Line::full_width, L, m_detach_preset_btn, m_parent_preset_description_line, m_presets, parent(), save_preset(), and Slic3r::GUI::DPIAware< P >::ShowModal().

Referenced by build_preset_description_line().

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

◆ build_sla()

void Slic3r::GUI::TabPrinter::build_sla ( )
5744{
5745 //if (!m_pages.empty())
5746 // m_pages.resize(0);
5747 //auto page = add_options_page(L("General"), "printer");
5748 //auto optgroup = page->new_optgroup(L("Size and coordinates"));
5749
5750 //create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
5751 // return create_bed_shape_widget(parent);
5752 //});
5753 //optgroup->append_single_option_line("printable_height");
5754
5755 //optgroup = page->new_optgroup(L("Display"));
5756 //optgroup->append_single_option_line("display_width");
5757 //optgroup->append_single_option_line("display_height");
5758
5759 //auto option = optgroup->get_option("display_pixels_x");
5760 //Line line = { option.opt.full_label, "" };
5761 //line.append_option(option);
5762 //line.append_option(optgroup->get_option("display_pixels_y"));
5763 //optgroup->append_line(line);
5764 //optgroup->append_single_option_line("display_orientation");
5765
5767 //optgroup->append_single_option_line("display_mirror_x");
5768 //optgroup->append_single_option_line("display_mirror_y");
5769
5770 //optgroup = page->new_optgroup(L("Tilt"));
5771 //line = { L("Tilt time"), "" };
5772 //line.append_option(optgroup->get_option("fast_tilt_time"));
5773 //line.append_option(optgroup->get_option("slow_tilt_time"));
5774 //optgroup->append_line(line);
5775 //optgroup->append_single_option_line("area_fill");
5776
5777 //optgroup = page->new_optgroup(L("Corrections"));
5778 //line = Line{ m_config->def()->get("relative_correction")->full_label, "" };
5779 //for (auto& axis : { "X", "Y", "Z" }) {
5780 // auto opt = optgroup->get_option(std::string("relative_correction_") + char(std::tolower(axis[0])));
5781 // opt.opt.label = axis;
5782 // line.append_option(opt);
5783 //}
5784 //optgroup->append_line(line);
5785 //optgroup->append_single_option_line("absolute_correction");
5786 //optgroup->append_single_option_line("elefant_foot_compensation");
5787 //optgroup->append_single_option_line("elefant_foot_min_width");
5788 //optgroup->append_single_option_line("gamma_correction");
5789 //
5790 //optgroup = page->new_optgroup(L("Exposure"));
5791 //optgroup->append_single_option_line("min_exposure_time");
5792 //optgroup->append_single_option_line("max_exposure_time");
5793 //optgroup->append_single_option_line("min_initial_exposure_time");
5794 //optgroup->append_single_option_line("max_initial_exposure_time");
5795
5796 //page = add_options_page(L("Dependencies"), "wrench.png");
5797 //optgroup = page->new_optgroup(L("Profile dependencies"));
5798
5799 //build_preset_description_line(optgroup.get());
5800}

References build_sla().

Referenced by build(), build_sla(), and update_pages().

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

◆ build_unregular_pages()

void Slic3r::GUI::TabPrinter::build_unregular_pages ( bool from_initial_build = false)
5928{
5929 size_t n_before_extruders = 2; // Count of pages before Extruder pages
5930 auto flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
5931 bool is_marlin_flavor = (flavor == gcfMarlinLegacy || flavor == gcfMarlinFirmware || flavor == gcfKlipper || flavor == gcfRepRapFirmware || flavor == gcfRepetier);
5932
5933 /* ! Freeze/Thaw in this function is needed to avoid call OnPaint() for erased pages
5934 * and be cause of application crash, when try to change Preset in moment,
5935 * when one of unregular pages is selected.
5936 * */
5937 Freeze();
5938
5939 // Add/delete Kinematics page according to is_marlin_flavor
5940 size_t existed_page = 0;
5941 for (size_t i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already
5942 if (m_pages[i]->title().find(L("Motion ability")) != std::string::npos) {
5943 existed_page = i;
5944 break;
5945 }
5946
5947 if (existed_page < n_before_extruders && (is_marlin_flavor || from_initial_build)) {
5948 auto page = build_kinematics_page();
5949 if (from_initial_build && !is_marlin_flavor)
5950 page->clear();
5951 else
5952 m_pages.insert(m_pages.begin() + n_before_extruders, page);
5953 }
5954
5955if (is_marlin_flavor)
5956 n_before_extruders++;
5957 size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page
5958
5959 if (from_initial_build) {
5960 // create a page, but pretend it's an extruder page, so we can add it to m_pages ourselves
5961 auto page = add_options_page(L("Multimaterial"), "custom-gcode_multi_material", true); // ORCA: icon only visible on placeholders
5962 auto optgroup = page->new_optgroup(L("Single extruder multi-material setup"), "param_multi_material");
5963 optgroup->append_single_option_line("single_extruder_multi_material", "printer_multimaterial_setup#single-extruder-multi-material");
5964 ConfigOptionDef def;
5965 def.type = coInt, def.set_default_value(new ConfigOptionInt((int) m_extruders_count));
5966 def.label = L("Extruders");
5967 def.tooltip = L("Number of extruders of the printer.");
5968 def.min = 1;
5969 def.max = MAXIMUM_EXTRUDER_NUMBER;
5970 def.mode = comAdvanced;
5971 Option option(def, "extruders_count");
5972 optgroup->append_single_option_line(option, "printer_multimaterial_setup#extruders");
5973
5974 // Orca: rebuild missed extruder pages
5975 optgroup->m_on_change = [this, optgroup_wk = ConfigOptionsGroupWkp(optgroup)](t_config_option_key opt_key, boost::any value) {
5976 auto optgroup_sh = optgroup_wk.lock();
5977 if (!optgroup_sh)
5978 return;
5979
5980 // optgroup->get_value() return int for def.type == coInt,
5981 // Thus, there should be boost::any_cast<int> !
5982 // Otherwise, boost::any_cast<size_t> causes an "unhandled unknown exception"
5983 const auto v = optgroup_sh->get_value("extruders_count");
5984 if (v.empty()) return;
5985 size_t extruders_count = size_t(boost::any_cast<int>(v));
5986 wxTheApp->CallAfter([this, opt_key, value, extruders_count]() {
5987 if (opt_key == "extruders_count" || opt_key == "single_extruder_multi_material") {
5988 const size_t old_extruders_count = m_extruders_count;
5989 extruders_count_changed(extruders_count);
5990 init_options_list(); // m_options_list should be updated before UI updating
5991 update_dirty();
5992 // Orca: the variant switches (here, Process in the sidebar, ...) list one option per extruder.
5993 if (m_extruders_count != old_extruders_count)
5995 if (opt_key == "single_extruder_multi_material") { // the single_extruder_multimaterial was added to force pages
5996 on_value_change(opt_key, value); // rebuild - let's make sure the on_value_change is not skipped
5997
5998 if (boost::any_cast<bool>(value) && m_extruders_count > 1) {
5999 SuppressBackgroundProcessingUpdate sbpu;
6000
6001// Orca: we use a different logic here. If SEMM is enabled, we set extruder count to 1.
6002#if 1
6005#else
6006
6007 std::vector<double> nozzle_diameters =
6008 static_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"))->values;
6009 const double frst_diam = nozzle_diameters[0];
6010
6011 for (auto cur_diam : nozzle_diameters) {
6012 // if value is differs from first nozzle diameter value
6013 if (fabs(cur_diam - frst_diam) > EPSILON) {
6014 const wxString msg_text = _(
6015 L("Single Extruder Multi Material is selected,\n"
6016 "and all extruders must have the same diameter.\n"
6017 "Do you want to change the diameter for all extruders to first extruder nozzle diameter value?"));
6018 MessageDialog dialog(parent(), msg_text, _(L("Nozzle diameter")), wxICON_WARNING | wxYES_NO);
6019
6020 DynamicPrintConfig new_conf = *m_config;
6021 if (dialog.ShowModal() == wxID_YES) {
6022 for (size_t i = 1; i < nozzle_diameters.size(); i++)
6023 nozzle_diameters[i] = frst_diam;
6024
6025 new_conf.set_key_value("nozzle_diameter", new ConfigOptionFloats(nozzle_diameters));
6026 } else
6027 new_conf.set_key_value("single_extruder_multi_material", new ConfigOptionBool(false));
6028
6029 load_config(new_conf);
6030 break;
6031 }
6032 }
6033#endif
6034 }
6035
6037 // Upadte related comboboxes on Sidebar and Tabs
6038 Sidebar& sidebar = wxGetApp().plater()->sidebar();
6040 sidebar.update_presets(type);
6041 wxGetApp().get_tab(type)->update_tab_ui();
6042 }
6043 }
6044 }
6045 else {
6046 update_dirty();
6047 on_value_change(opt_key, value);
6048 }
6049 });
6050 };
6051 optgroup->append_single_option_line("manual_filament_change", "printer_multimaterial_setup#manual-filament-change");
6052 optgroup->append_single_option_line("bed_temperature_formula", "printer_basic_information_advanced#bed-temperature-type");
6053
6054 optgroup = page->new_optgroup(L("Wipe tower"), "param_tower");
6055 optgroup->append_single_option_line("wipe_tower_type", "printer_multimaterial_wipe_tower");
6056 optgroup->append_single_option_line("purge_in_prime_tower", "printer_multimaterial_wipe_tower#purge-in-prime-tower");
6057 optgroup->append_single_option_line("enable_filament_ramming", "printer_multimaterial_wipe_tower#enable-filament-ramming");
6058 optgroup->append_single_option_line("tool_change_on_wipe_tower", "printer_multimaterial_wipe_tower#tool-change-on-wipe-tower");
6059 optgroup->append_single_option_line("wait_for_temp_on_wipe_tower", "printer_multimaterial_wipe_tower#wait-for-temperature-on-wipe-tower");
6060
6061 // Orca-Belt: belt printers replace the classic wipe tower with an
6062 // auto-generated purge prism; this is its enable (gated to belt printers
6063 // in toggle_options()).
6064 optgroup = page->new_optgroup(L("Belt purge tower"), "param_tower");
6065 optgroup->append_single_option_line("enable_belt_purge_tower", "printer_multimaterial_wipe_tower#belt-purge-tower");
6066
6067
6068 optgroup = page->new_optgroup(L("Single extruder multi-material parameters"), "param_settings");
6069 optgroup->append_single_option_line("cooling_tube_retraction", "printer_multimaterial_semm_parameters#cooling-tube-position");
6070 optgroup->append_single_option_line("cooling_tube_length", "printer_multimaterial_semm_parameters#cooling-tube-length");
6071 optgroup->append_single_option_line("parking_pos_retraction", "printer_multimaterial_semm_parameters#filament-parking-position");
6072 optgroup->append_single_option_line("extra_loading_move", "printer_multimaterial_semm_parameters#extra-loading-distance");
6073 optgroup->append_single_option_line("high_current_on_filament_swap", "printer_multimaterial_semm_parameters#high-extruder-current-on-filament-swap");
6074
6075 optgroup = page->new_optgroup(L("Advanced"), L"param_advanced");
6076 optgroup->append_single_option_line("machine_load_filament_time", "printer_multimaterial_advanced#filament-load-time");
6077 optgroup->append_single_option_line("machine_unload_filament_time", "printer_multimaterial_advanced#filament-unload-time");
6078 optgroup->append_single_option_line("machine_tool_change_time", "printer_multimaterial_advanced#tool-change-time");
6079
6080 // IDEX/IQEX (IMEX) parallel printing configuration
6081 optgroup = page->new_optgroup(L("IDEX/IQEX Configuration"), L"param_advanced");
6082 optgroup->append_single_option_line("is_imex", "printer_multimaterial_idex_iqex#idexiqex-printer");
6083 optgroup->append_single_option_line("imex_firmware_managed_zones", "printer_multimaterial_idex_iqex#firmware-managed-zones");
6084 optgroup->append_single_option_line("imex_gantry_count", "printer_multimaterial_idex_iqex#gantry-count");
6085 optgroup->append_single_option_line("imex_tools_per_gantry", "printer_multimaterial_idex_iqex#tools-per-gantry");
6086 optgroup->append_single_option_line("imex_tool_layout", "printer_multimaterial_idex_iqex#tool-0-position");
6087 optgroup->append_single_option_line("imex_nozzle_clearance_x", "printer_multimaterial_idex_iqex#nozzle-clearance-x");
6088 optgroup->append_single_option_line("imex_nozzle_clearance_y", "printer_multimaterial_idex_iqex#nozzle-clearance-y");
6089 optgroup->append_single_option_line("imex_carriage_margin", "printer_multimaterial_idex_iqex#safety-margin");
6090 {
6091 // Toggle for pre-slice IMEX safety warnings (stored in app_config, not printer profile).
6092 // We avoid full_width=1 here because that path uses different sizer math from the
6093 // rest of the optgroup — it left-pads with 15px instead of aligning to the label
6094 // column, which made this row look out-of-place vs. the option lines above. Instead
6095 // we register a placeholder Option so option_set.front() (the empty-vector access
6096 // that crashes Windows release builds) is satisfied, and let the standard line path
6097 // render the label + custom widget with the same column geometry as everything else.
6098 // No Field is built for the placeholder because line.widget != nullptr causes
6099 // activate_line to return early before build_field.
6100 ConfigOptionDef placeholder_def;
6101 placeholder_def.label = L("Pre-slice warnings");
6102 placeholder_def.mode = comAdvanced;
6103 placeholder_def.tooltip = L("Show a warning dialog before slicing if IDEX/IQEX parallel mode "
6104 "concerns are detected (bed temperature conflicts, filament type "
6105 "mismatches, multi-material conflicts). Can be suppressed from the "
6106 "dialog itself. Re-enable here if suppressed accidentally.");
6107 auto line = Line{ placeholder_def.label, placeholder_def.tooltip };
6108 line.label_path = "printer_multimaterial_idex_iqex#pre-slice-warnings";
6109 line.append_option(Option{ placeholder_def, "imex_pre_slice_warnings" });
6110 line.widget = [](wxWindow* parent) -> wxSizer* {
6111 auto* cb = new ::CheckBox(parent);
6112 const bool enabled = wxGetApp().app_config->get("imex_pre_slice_warnings") != "false";
6113 cb->SetValue(enabled);
6114 cb->Bind(wxEVT_TOGGLEBUTTON, [cb](wxCommandEvent& e) {
6115 wxGetApp().app_config->set("imex_pre_slice_warnings", cb->GetValue() ? "true" : "false");
6116 e.Skip(); // CheckBox's own handler redraws the tick
6117 });
6118 auto* s = new wxBoxSizer(wxHORIZONTAL);
6119 s->Add(cb, 0, wxALIGN_CENTER_VERTICAL);
6120 return s;
6121 };
6122 optgroup->append_line(line);
6123 }
6124 optgroup->append_single_option_line("imex_viz_theme", "printer_multimaterial_idex_iqex#visualization-theme");
6125 {
6126 // In the configuration group rather than a group of its own: a full-width widget line
6127 // records no mode, so a group holding only this line would show in every mode.
6128 auto line = Line{ L("Modes"), "" };
6129 line.full_width = 1;
6130 line.widget = [this](wxWindow* parent) -> wxSizer* {
6131 int n_cols = 0, n_rows = 0, layout = 0;
6132 imex_grid_shape(m_config, n_cols, n_rows, layout);
6133 m_imex_modes_ctrl = new IMEXModesCtrl(parent, n_cols, n_rows, layout);
6134 // Lazy lookup pointing at the *saved* state of the currently-selected
6135 // preset (not the parent). Per-row reset means "discard in-session
6136 // edits to this row" — matches the page-level reset semantic and works
6137 // on any preset, including ones whose parent has no IMEX modes at all.
6138 m_imex_modes_ctrl->set_parent_config_lookup([this]() -> const DynamicPrintConfig* {
6139 return m_presets ? &m_presets->get_selected_preset().config : nullptr;
6140 });
6141 m_imex_modes_ctrl->load_from_config(*m_config);
6142 m_imex_modes_ctrl->on_change = [this]() {
6143 auto [names, tools, gcodes] = m_imex_modes_ctrl->get_mode_data();
6144 m_config->set_key_value("imex_mode_names", new ConfigOptionStrings(names));
6145 m_config->set_key_value("imex_mode_active_tools", new ConfigOptionStrings(tools));
6146 m_config->set_key_value("imex_mode_gcodes", new ConfigOptionStrings(gcodes));
6147 update_dirty();
6148 on_value_change("imex_mode_names", std::string(""));
6149 };
6150 // A plate stores its IMEX mode as the mode's *name*, resolved against this
6151 // table at slice time, so deleting a row strands every plate that was using
6152 // it. Those plates print as Primary either way -- GCode.cpp falls back when
6153 // the name resolves to no row -- but until they are reset they keep claiming
6154 // a mode that no longer exists: the plate button still shows the old label,
6155 // the mode is written back out to the 3MF, and re-adding a different mode at
6156 // the same position would not revive it. Resetting them here is what makes
6157 // "deleting a mode resets the plates using it to Primary" true.
6158 //
6159 // Deletion only. Renaming is deliberately not funnelled through here: the
6160 // name field notifies on every keystroke, so an in-progress rename would
6161 // orphan and reset the plate on the first character typed.
6162 //
6163 // Because of that, a row can be renamed and only then deleted, and the plate
6164 // is still holding the name it was set from. The control therefore reports
6165 // every name the deleted row was known by -- its build-time name and its name
6166 // at delete time -- already filtered of anything a surviving row still
6167 // carries, so matching any of them is safe.
6168 m_imex_modes_ctrl->on_mode_removed = [](const std::vector<std::string>& removed_modes) {
6169 Plater* plater = wxGetApp().plater();
6170 if (!plater || removed_modes.empty())
6171 return;
6172 PartPlateList& plates = plater->get_partplate_list();
6173 std::vector<PartPlate*> affected;
6174 for (int i = 0; i < plates.get_plate_count(); ++i) {
6175 PartPlate* plate = plates.get_plate(i);
6176 if (!plate)
6177 continue;
6178 const std::string mode = plate->get_imex_mode();
6179 if (mode.empty() || mode == kImexPrimaryMode)
6180 continue;
6181 if (std::find(removed_modes.begin(), removed_modes.end(), mode) != removed_modes.end())
6182 affected.push_back(plate);
6183 }
6184 if (affected.empty())
6185 return;
6186 // One snapshot for the whole batch, so a single undo restores every plate.
6187 // Same sequence the plate's own mode button runs (Plater::select_plate_by_hover_id,
6188 // PLATE_IMEX_MODE_ID) -- reset_imex_mode() already invalidates each plate's
6189 // slice result and its zone / ghost caches.
6190 plater->take_snapshot("reset imex mode");
6191 for (PartPlate* plate : affected)
6192 plate->reset_imex_mode();
6194 plater->set_plater_dirty(true);
6195 plater->update();
6196 };
6197 auto* sizer = new wxBoxSizer(wxHORIZONTAL);
6198 // Align the left edge with the option-line labels above. A full-width line's
6199 // widget is inset by 15 (OptionsGroup::activate_line), while an ordinary line's
6200 // custom control is inset by 10 and then paints its label further in again, so
6201 // the two do not line up without this. One number, tuned against the settings
6202 // page. Unscaled on purpose: the 15 and 10 it compensates for are raw pixels too,
6203 // so a DIP-scaled correction here would drift apart from them on a HiDPI display.
6204 sizer->Add(m_imex_modes_ctrl, 1, wxEXPAND | wxLEFT, 8);
6205 return sizer;
6206 };
6207 optgroup->append_line(line);
6208 }
6209
6210 m_pages.insert(m_pages.end() - n_after_single_extruder_MM, page);
6211 }
6212
6213 // Orca: a single "Extruder" page serves all extruders. Its controls are created once for extruder 0;
6214 // switch_excluder() re-targets them to the extruder selected on the variant switch (m_extruder_switch),
6215 // which the printer tab shows on this page too.
6216 if (extruder_page() == nullptr && m_extruders_count > 0) {
6217 const size_t extruder_idx = 0;
6218 auto page = add_options_page(L("Extruder"), "custom-gcode_extruder", true); // ORCA: icon only visible on placeholders
6219 m_pages.insert(m_pages.begin() + n_before_extruders, page);
6220
6221 auto optgroup = page->new_optgroup(L("Basic information"), L"param_information", -1, true);
6222 optgroup->append_single_option_line("nozzle_diameter", "printer_extruder_basic_information#nozzle-diameter", extruder_idx);
6223 optgroup->append_single_option_line("nozzle_type", "printer_basic_information_accessory#nozzle-type", extruder_idx);
6224 //optgroup->append_single_option_line("nozzle_volume_type", "", extruder_idx);
6225
6226 optgroup->append_single_option_line("nozzle_volume", "printer_extruder_basic_information#nozzle-volume", extruder_idx);
6227 optgroup->append_single_option_line("extruder_printable_height", "printer_extruder_basic_information#extruder-layer-height-limits", extruder_idx);
6228 Option option = optgroup->get_option("extruder_printable_area", extruder_idx);
6229 option.opt.full_width = true;
6230 optgroup->append_single_option_line(option, "printer_extruder_basic_information#extruder-printable-area");
6231
6232 Option exclusion_option = optgroup->get_option("extruder_bed_exclude_volumes", extruder_idx);
6233 exclusion_option.opt.full_width = true;
6234 optgroup->append_single_option_line(exclusion_option, "printer_basic_information_printable_space#toolhead-collision-volumes");
6235
6236 optgroup->m_on_change = [this](const t_config_option_key& opt_key, boost::any value)
6237 {
6238 // The page edits the extruder selected on the variant switch.
6239 const size_t extruder_idx = size_t(get_current_active_extruder());
6240 bool is_SEMM = m_config->opt_bool("single_extruder_multi_material");
6241 bool independent_nozzles = m_preset_bundle && m_preset_bundle->is_bbl_vendor() && m_extruders_count > 1;
6242 if (is_SEMM && m_extruders_count > 1 && !independent_nozzles && boost::starts_with(opt_key, "nozzle_diameter"))
6243 {
6244 SuppressBackgroundProcessingUpdate sbpu;
6245 const double new_nd = boost::any_cast<double>(value);
6246 std::vector<double> nozzle_diameters = static_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"))->values;
6247
6248 // if value was changed
6249 if (fabs(nozzle_diameters[extruder_idx == 0 ? 1 : 0] - new_nd) > EPSILON)
6250 {
6251 const wxString msg_text = _(L("This is a single extruder multi-material printer, diameters of all extruders "
6252 "will be set to the new value. Do you want to proceed?"));
6253 //wxMessageDialog dialog(parent(), msg_text, _(L("Nozzle diameter")), wxICON_WARNING | wxYES_NO);
6254 MessageDialog dialog(parent(), msg_text, _(L("Nozzle diameter")), wxICON_WARNING | wxYES_NO);
6255
6256 DynamicPrintConfig new_conf = *m_config;
6257 if (dialog.ShowModal() == wxID_YES) {
6258 for (size_t i = 0; i < nozzle_diameters.size(); i++) {
6259 if (i == extruder_idx)
6260 continue;
6261 nozzle_diameters[i] = new_nd;
6262 }
6263 }
6264 else
6265 nozzle_diameters[extruder_idx] = nozzle_diameters[extruder_idx == 0 ? 1 : 0];
6266
6267 new_conf.set_key_value("nozzle_diameter", new ConfigOptionFloats(nozzle_diameters));
6268 load_config(new_conf);
6269 }
6270 }
6271
6272 update_dirty();
6273 on_value_change(opt_key, value);
6274 update();
6275 };
6276
6277 optgroup = page->new_optgroup(L("Layer height limits"), L"param_layer_height");
6278 optgroup->append_single_option_line("min_layer_height", "printer_extruder_basic_information#extruder-layer-height-limits", extruder_idx);
6279 optgroup->append_single_option_line("max_layer_height", "printer_extruder_basic_information#extruder-layer-height-limits", extruder_idx);
6280
6281 optgroup = page->new_optgroup(L("Position"), L"param_position");
6282 optgroup->append_single_option_line("extruder_offset", "printer_extruder_basic_information#extruder-offset-position", extruder_idx);
6283
6284 //BBS: don't show retract related config menu in machine page
6285 // These optgroups are built from publishable_printer_retraction/z_hop_options() so the
6286 // published-3MF printer allowlist (their union in libslic3r/PublishSettings.hpp) can
6287 // never drift from what the machine page actually shows.
6288 optgroup = page->new_optgroup(L("Retraction"), L"param_retraction");
6289 for (const PublishablePrinterOption& opt : publishable_printer_retraction_options())
6290 optgroup->append_single_option_line(opt.key, opt.icon, extruder_idx);
6291
6292 optgroup = page->new_optgroup(L("Z-Hop"), L"param_extruder_lift_enforcement");
6293 for (const PublishablePrinterOption& opt : publishable_printer_z_hop_options())
6294 optgroup->append_single_option_line(opt.key, opt.icon, extruder_idx);
6295
6296 optgroup = page->new_optgroup(L("Retraction when switching material"), L"param_retraction_material_change");
6297 optgroup->append_single_option_line("retract_length_toolchange", "printer_extruder_retraction#retraction-when-switching-materials", extruder_idx);
6298 optgroup->append_single_option_line("retract_restart_extra_toolchange", "printer_extruder_retraction#retraction-when-switching-materials", extruder_idx);
6299 // do not display this params now
6300 optgroup->append_single_option_line("long_retractions_when_cut", "printer_extruder_retraction#long-retraction-when-cut-beta", extruder_idx);
6301 optgroup->append_single_option_line("retraction_distances_when_cut", "printer_extruder_retraction#long-retraction-when-cut-beta", extruder_idx);
6302#if 0
6303 //optgroup = page->new_optgroup(L("Preview"), -1, true);
6304
6305 //auto reset_to_filament_color = [this, extruder_idx](wxWindow* parent) {
6306 // m_reset_to_filament_color = new ScalableButton(parent, wxID_ANY, "undo", _L("Reset to Filament Color"),
6307 // wxDefaultSize, wxDefaultPosition, wxBU_LEFT | wxBU_EXACTFIT, true);
6308 // ScalableButton* btn = m_reset_to_filament_color;
6309 // btn->SetFont(Slic3r::GUI::wxGetApp().normal_font());
6310 // btn->SetSize(btn->GetBestSize());
6311 // auto sizer = new wxBoxSizer(wxHORIZONTAL);
6312 // sizer->Add(btn);
6313
6314 // btn->Bind(wxEVT_BUTTON, [this, extruder_idx](wxCommandEvent& e)
6315 // {
6316 // std::vector<std::string> colors = static_cast<const ConfigOptionStrings*>(m_config->option("extruder_colour"))->values;
6317 // colors[extruder_idx] = "";
6318
6319 // DynamicPrintConfig new_conf = *m_config;
6320 // new_conf.set_key_value("extruder_colour", new ConfigOptionStrings(colors));
6321 // load_config(new_conf);
6322
6323 // update_dirty();
6324 // update();
6325 // });
6326
6327 // return sizer;
6328 //};
6330 //Line line = optgroup->create_single_option_line("extruder_colour", "", extruder_idx);
6331 //line.append_widget(reset_to_filament_color);
6332 //optgroup->append_line(line);
6333#endif
6334 }
6335
6336 // The page holds only the "#0" controls, so register every extruder's options with the search
6337 // index under "Extruder N"; a search hit selects that extruder (TabPrinter::activate_option()).
6338 if (Page *page = extruder_page()) {
6339 auto &index = wxGetApp().sidebar().settings_index();
6340 for (auto &group : page->m_optgroups) {
6341 group->set_config_category_and_type(page->title(), m_type);
6342 for (auto &opt : group->opt_map()) {
6343 if (opt.second.second < 0)
6344 continue;
6345 for (size_t i = 0; i < m_extruders_count; ++i) {
6346 const wxString category = m_extruders_count > 1 ? wxString::Format("Extruder %d", int(i + 1)) : wxString("Extruder");
6347 index.add_key(opt.second.first + "#" + std::to_string(i), m_type, group->title, category, group->icon);
6348 }
6349 }
6350 }
6351 }
6352
6353 Thaw();
6354
6356
6357 if (from_initial_build && m_printer_technology == ptSLA)
6358 return; // next part of code is no needed to execute at this moment
6359
6361
6362 // Reload preset pages with current configuration values
6363 reload_config();
6364
6365 // apply searcher with current configuration
6367}
#define EPSILON
Definition ColorUtils.cpp:64
PartPlateList & get_partplate_list()
Definition Plater.cpp:22578
void update_project_dirty_from_presets()
Definition Plater.cpp:15664
void take_snapshot(const std::string &snapshot_name)
Definition Plater.cpp:21281
void update(bool conside_update_flag=false, bool force_background_processing_update=false)
Definition Plater.cpp:19092
void set_plater_dirty(bool is_dirty)
Definition Plater.cpp:15663
void extruders_count_changed(size_t extruders_count)
Definition Tab.cpp:5802
void update() override
Definition Tab.cpp:7041
void init_options_list() override
Definition Tab.cpp:1385
void reload_config() override
Definition Tab.cpp:6500
IMEXModesCtrl * m_imex_modes_ctrl
Definition Tab.hpp:733
PageShp build_kinematics_page()
Definition Tab.cpp:5840
void rebuild_page_tree()
Definition Tab.cpp:7301
void apply_searcher()
Definition Tab.cpp:2734
Preset::Type type() const
Definition Tab.hpp:350
Type
Definition Preset.hpp:244
@ TYPE_PRINT
Definition Preset.hpp:246
@ TYPE_FILAMENT
Definition Preset.hpp:248
static constexpr size_t MAXIMUM_EXTRUDER_NUMBER
Definition libslic3r.h:70
static void imex_grid_shape(const DynamicPrintConfig *cfg, int &n_cols, int &n_rows, int &layout)
Definition Tab.cpp:5920
std::weak_ptr< ConfigOptionsGroup > ConfigOptionsGroupWkp
Definition BedShapeDialog.hpp:32
@ Plater
Definition Shortcuts.hpp:21
static void update_all_extruder_variants(int extruder_idx=-1)
Definition Tab.cpp:2061
@ gcfMarlinFirmware
Definition PrintConfig.hpp:56
@ gcfKlipper
Definition PrintConfig.hpp:53
@ gcfRepetier
Definition PrintConfig.hpp:55
@ gcfRepRapFirmware
Definition PrintConfig.hpp:54
@ gcfMarlinLegacy
Definition PrintConfig.hpp:52
@ comAdvanced
Definition Config.hpp:223
constexpr const char * kImexPrimaryMode
Definition IMEXHelpers.hpp:27
@ coInt
Definition Config.hpp:188
const std::vector< PublishablePrinterOption > & publishable_printer_retraction_options()
Definition PublishSettings.cpp:131
const std::vector< PublishablePrinterOption > & publishable_printer_z_hop_options()
Definition PublishSettings.cpp:150
RaycastManager::TrItems::iterator find(RaycastManager::TrItems &items, const RaycastManager::TrKey &key)
Definition RaycastManager.cpp:298

References _, Slic3r::GUI::Tab::add_options_page(), Slic3r::GUI::Tab::apply_searcher(), build_kinematics_page(), build_unregular_pages(), Slic3r::coInt, Slic3r::comAdvanced, EPSILON, extruder_page(), extruders_count_changed(), Slic3r::ConfigOptionDef::full_width, Slic3r::GUI::Line::full_width, Slic3r::gcfKlipper, Slic3r::gcfMarlinFirmware, Slic3r::gcfMarlinLegacy, Slic3r::gcfRepetier, Slic3r::gcfRepRapFirmware, Slic3r::GUI::Tab::get_current_active_extruder(), Slic3r::GUI::PartPlate::get_imex_mode(), Slic3r::GUI::PartPlateList::get_plate(), Slic3r::GUI::PartPlateList::get_plate_count(), Slic3r::GUI::imex_grid_shape(), init_options_list(), Slic3r::kImexPrimaryMode, L, Slic3r::ConfigOptionDef::label, Slic3r::GUI::Line::label_path, Slic3r::load_config(), Slic3r::GUI::Tab::m_config, m_extruders_count, m_extruders_count_old, m_imex_modes_ctrl, Slic3r::GUI::Tab::m_pages, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::GUI::Tab::m_presets, m_printer_technology, Slic3r::GUI::Tab::m_type, Slic3r::ConfigOptionDef::max, MAXIMUM_EXTRUDER_NUMBER, Slic3r::ConfigOptionDef::min, Slic3r::ConfigOptionDef::mode, Slic3r::Never, on_value_change(), Slic3r::GUI::Option::opt, Slic3r::GUI::Tab::parent(), Slic3r::GUI::plater(), Slic3r::ptSLA, Slic3r::publishable_printer_retraction_options(), Slic3r::publishable_printer_z_hop_options(), Slic3r::GUI::Tab::rebuild_page_tree(), reload_config(), Slic3r::ConfigOptionDef::set_default_value(), Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::Tab::title(), Slic3r::ConfigOptionDef::tooltip, Slic3r::ConfigOptionDef::type, Slic3r::GUI::Tab::type(), Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, update(), Slic3r::GUI::update_all_extruder_variants(), Slic3r::GUI::Tab::update_dirty(), and Slic3r::GUI::Sidebar::update_presets().

Referenced by build_fff(), build_unregular_pages(), and extruders_count_changed().

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

◆ cache_config_diff()

void Slic3r::GUI::Tab::cache_config_diff ( const std::vector< std::string > & selected_options,
const DynamicPrintConfig * config = nullptr )
inherited
2740{
2741 m_cache_options = selected_options;
2742 m_cache_config.apply_only(config ? *config : m_presets->get_edited_preset().config, selected_options);
2743}

References cache_config_diff(), m_cache_config, m_cache_options, and m_presets.

Referenced by cache_config_diff(), Slic3r::GUI::GUI_App::check_and_keep_current_preset_changes(), may_discard_current_dirty_preset(), and transfer_options().

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

◆ cache_extruder_cnt()

void Slic3r::GUI::TabPrinter::cache_extruder_cnt ( const DynamicPrintConfig * config = nullptr)
8649{
8650 const DynamicPrintConfig& cached_config = config ? *config : m_presets->get_edited_preset().config;
8651 if (Preset::printer_technology(cached_config) == ptSLA)
8652 return;
8653
8654 // get extruders count
8655 auto* nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(cached_config.option("nozzle_diameter"));
8656 m_cache_extruder_count = nozzle_diameter->values.size(); //m_extruders_count;
8657}
PrinterTechnology printer_technology() const
Definition Preset.hpp:399

References cache_extruder_cnt(), m_cache_extruder_count, Slic3r::GUI::Tab::m_presets, Slic3r::nozzle_diameter(), Slic3r::ConfigBase::option(), Slic3r::Preset::printer_technology(), and Slic3r::ptSLA.

Referenced by cache_extruder_cnt().

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

◆ calculate_selection_index_for_extruder()

int Slic3r::GUI::Tab::calculate_selection_index_for_extruder ( int extruder_id,
NozzleVolumeType nozzle_type )
inherited
718{
719 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
720 int extruder_nums = m_preset_bundle->get_printer_extruder_count();
721
722 int index = 0;
723
724 for (int i = 0; i < extruder_nums; ++i) {
725 if (i == extruder_id) {
726 NozzleVolumeType volume_type = NozzleVolumeType(nozzle_volumes->values[i]);
727 if (volume_type == NozzleVolumeType::nvtHybrid) {
728 return nozzle_type == NozzleVolumeType::nvtHighFlow ? index + 1 : index;
729 } else {
730 return index;
731 }
732 }
733
734 NozzleVolumeType volume_type = NozzleVolumeType(nozzle_volumes->values[i]);
735 index += (volume_type == NozzleVolumeType::nvtHybrid) ? 2 : 1;
736 }
737
738 return 0;
739}
NozzleVolumeType
Definition PrintConfig.hpp:618
@ nvtHybrid
Definition PrintConfig.hpp:621
@ nvtHighFlow
Definition PrintConfig.hpp:620
ConfigOptionEnumsGenericTempl< false > ConfigOptionEnumsGeneric
Definition Config.hpp:2311
zaa_minimize_perimeter_height nozzle_type((ConfigOptionInt, nozzle_hrc))((ConfigOptionBool

References m_preset_bundle, Slic3r::nozzle_type(), Slic3r::nvtHighFlow, and Slic3r::nvtHybrid.

Referenced by Slic3r::GUI::TabPrinter::activate_option(), and update_extruder_variants().

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

◆ check_extruder_options_status()

void Slic3r::GUI::Tab::check_extruder_options_status ( int index,
bool & sys_extruder,
bool & modified_extruder,
const std::vector< PageShp > & pages_to_check )
inherited
1310{
1311 int config_index = index;
1312 int extruder_id = index;
1315 parse_extruder_selection(index, extruder_id, nozzle_type);
1316
1317 auto extruders = m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnumsGeneric>("extruder_type");
1319 config_index = m_config->get_index_for_extruder(
1320 extruder_id + 1,
1321 variant_keys.first,
1322 ExtruderType(extruders->values[extruder_id]),
1324 variant_keys.second
1325 );
1326 }
1327
1328 for (auto page : pages_to_check) {
1329 /*if (page->title() != "Speed" && page->title() != "Motion ability" && page->title() != "Filament" && page->title() != "Setting Overrides" && page->title() != "Multimaterial") {
1330 continue;
1331 }*/
1332 for (auto group : page->m_optgroups) {
1333 for (const auto &kvp : group->opt_map()) {
1334 std::string base_opt_key = kvp.second.first;
1335 // For filament tab, common options will not change color when edited
1336 if (m_type == Preset::TYPE_FILAMENT && kvp.second.second == -1) {
1337 continue;
1338 }
1339
1340 unsigned int stride = 1;
1341 if (printer_options_with_variant_2.count(base_opt_key) > 0) {
1342 stride = 2;
1343 }
1344
1345 std::string target_opt_key = base_opt_key + "#" + std::to_string(config_index * stride);
1346 // Orca: on the printer's Extruder page only per-variant options use the variant column,
1347 // the others (nozzle_diameter, extruder_offset, ...) are indexed by the extruder.
1348 if (is_printer_extruder_page(page.get()) && printer_options_with_variant_1.count(base_opt_key) == 0)
1349 target_opt_key = base_opt_key + "#" + std::to_string(extruder_id);
1350
1351 auto status_iter = m_all_extruder_options_status.find(target_opt_key);
1352 if (status_iter != m_all_extruder_options_status.end()) {
1353 bool found_modified_for_this_config = false;
1356 auto original_dirty_options = m_presets->current_dirty_options(deep_compare);
1357 for (const std::string &orig_opt : original_dirty_options) {
1358 if (orig_opt == target_opt_key) {
1359 found_modified_for_this_config = true;
1360 break;
1361 }
1362 }
1363
1364 if (found_modified_for_this_config) {
1365 sys_extruder = (status_iter->second & osSystemValue) != 0;
1366 modified_extruder |= (status_iter->second & osInitValue) == 0;
1367
1368 if (!sys_extruder && modified_extruder) { return; }
1369 }
1370 }
1371 }
1372 }
1373 }
1374}
bool is_printer_extruder_page(const Page *page) const
Definition Tab.hpp:399
void parse_extruder_selection(int selection, int &extruder_id, NozzleVolumeType &nozzle_type)
Definition Tab.cpp:682
std::map< std::string, int > m_all_extruder_options_status
Definition Tab.hpp:272
@ TYPE_MODEL
Definition Preset.hpp:258
@ TYPE_SLA_MATERIAL
Definition Preset.hpp:249
@ TYPE_COUNT
Definition Preset.hpp:251
static std::pair< std::string, std::string > extruder_variant_keys[]
Definition Tab.cpp:149
static std::vector< std::string > variant_keys(DynamicPrintConfig const &config)
Definition Tab.cpp:3765
std::set< std::string > printer_options_with_variant_1
Definition PrintConfig.cpp:10236
ExtruderType
Definition PrintConfig.hpp:612
std::set< std::string > printer_options_with_variant_2
Definition PrintConfig.cpp:10270

References check_extruder_options_status(), Slic3r::GUI::extruder_variant_keys, is_printer_extruder_page(), m_all_extruder_options_status, m_config, m_preset_bundle, m_presets, m_type, Slic3r::nozzle_type(), osInitValue, osSystemValue, parse_extruder_selection(), Slic3r::printer_options_with_variant_1, Slic3r::printer_options_with_variant_2, Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_MODEL, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and Slic3r::GUI::variant_keys().

Referenced by check_extruder_options_status(), update_changed_tree_ui(), and update_extruder_switch_colors().

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

◆ clear_pages()

void Slic3r::GUI::TabPrinter::clear_pages ( )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

6534{
6536 m_reset_to_filament_color = nullptr;
6537 m_imex_modes_ctrl = nullptr;
6538}
ScalableButton * m_reset_to_filament_color
Definition Tab.hpp:735
virtual void clear_pages()
Definition Tab.cpp:7798

References Slic3r::GUI::Tab::clear_pages(), clear_pages(), m_imex_modes_ctrl, and m_reset_to_filament_color.

Referenced by clear_pages(), and update_pages().

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

◆ commit_preset_config_value()

bool Slic3r::GUI::Tab::commit_preset_config_value ( const std::string & opt_key)
protectedinherited
1684{
1685 if (Page* field_page = nullptr; Field* field = get_field(opt_key, &field_page)) {
1686 field_page->reload_config();
1687 field->field_changed();
1688 return true;
1689 }
1690 for (const PageShp& page : m_pages)
1691 for (const ConfigOptionsGroupShp& group : page->m_optgroups)
1692 if (group->commit_config_value(opt_key))
1693 return true;
1694 return false;
1695}
Field * get_field(const t_config_option_key &opt_key, int opt_index=-1) const
Definition Tab.cpp:1923
std::shared_ptr< ConfigOptionsGroup > ConfigOptionsGroupShp
Definition BedShapeDialog.hpp:31

References commit_preset_config_value(), Slic3r::GUI::Field::field_changed(), get_field(), and m_pages.

Referenced by apply_preset_config_values(), and commit_preset_config_value().

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

◆ compare_preset()

void Slic3r::GUI::Tab::compare_preset ( )
inherited
8085{
8087}
void show(Preset::Type type=Preset::TYPE_INVALID)
Definition UnsavedChangesDialog.cpp:2054
static DiffPresetDialog * ensure()
Definition Lazy.hpp:186

References compare_preset(), Slic3r::GUI::LazyInstance< DiffPresetDialog >::ensure(), and m_type.

Referenced by compare_preset().

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

◆ compatible_widget_create()

wxSizer * Slic3r::GUI::Tab::compatible_widget_create ( wxWindow * parent,
PresetDependencies & deps )
protectedinherited
8446{
8447 deps.checkbox = new ::CheckBox(parent, wxID_ANY);
8448 wxGetApp().UpdateDarkUI(deps.checkbox, false, true);
8449
8450 deps.checkbox_title = new wxStaticText(parent, wxID_ANY, _L("All"));
8451 deps.checkbox_title->SetFont(Label::Body_14);
8452 deps.checkbox_title->SetForegroundColour(wxColour("#363636"));
8453 wxGetApp().UpdateDarkUI(deps.checkbox_title, false, true);
8454
8455 // ORCA modernize button style
8456 Button* btn = new Button(parent, _(L("Set")) + " " + dots);
8458 deps.btn = btn;
8459
8460 auto sizer = new wxBoxSizer(wxHORIZONTAL);
8461 sizer->Add((deps.checkbox), 0, wxALIGN_CENTER_VERTICAL);
8462 sizer->Add((deps.checkbox_title), 0, wxALIGN_CENTER_VERTICAL);
8463 sizer->Add(new wxStaticText(parent, wxID_ANY, " ")); // weirdly didnt apply AddSpacer or wxRIGHT border
8464 sizer->Add((deps.btn), 0, wxALIGN_CENTER_VERTICAL);
8465
8466 auto on_toggle = [this, &deps](const bool &state){
8467 deps.checkbox->SetValue(state);
8468 deps.btn->Enable(!state);
8469 // All printers have been made compatible with this preset.
8470 if (state)
8471 this->load_key_value(deps.key_list, std::vector<std::string> {});
8472 this->get_field(deps.key_condition)->toggle(state);
8473 this->update_changed_ui();
8474 };
8475
8476 deps.checkbox_title->Bind(wxEVT_LEFT_DOWN,([&deps, on_toggle](wxMouseEvent& e) {
8477 if (e.GetEventType() == wxEVT_LEFT_DCLICK) return;
8478 on_toggle(!deps.checkbox->GetValue());
8479 e.Skip();
8480 }));
8481
8482 deps.checkbox_title->Bind(wxEVT_LEFT_DCLICK,([&deps, on_toggle](wxMouseEvent& e) {
8483 on_toggle(!deps.checkbox->GetValue());
8484 e.Skip();
8485 }));
8486
8487 deps.checkbox->Bind(wxEVT_TOGGLEBUTTON, ([on_toggle](wxCommandEvent& e) {
8488 on_toggle(e.IsChecked());
8489 e.Skip();
8490 }), deps.checkbox->GetId());
8491
8492 if (deps.checkbox){
8493 bool is_empty = m_config->option<ConfigOptionStrings>(deps.key_list)->values.empty();
8494 deps.checkbox->SetValue(is_empty);
8495 deps.btn->Enable(!is_empty);
8496 }
8497
8498 /*
8499 if (m_compatible_printers.checkbox) {
8500 bool is_empty = m_config->option<ConfigOptionStrings>("compatible_printers")->values.empty();
8501 m_compatible_printers.checkbox->SetValue(is_empty);
8502 is_empty ? m_compatible_printers.btn->Disable() : m_compatible_printers.btn->Enable();
8503 }
8504
8505 if (m_compatible_prints.checkbox) {
8506 bool is_empty = m_config->option<ConfigOptionStrings>("compatible_prints")->values.empty();
8507 m_compatible_prints.checkbox->SetValue(is_empty);
8508 is_empty ? m_compatible_prints.btn->Disable() : m_compatible_prints.btn->Enable();
8509 }
8510 */
8511
8512 deps.btn->Bind(wxEVT_BUTTON, ([this, parent, &deps](wxCommandEvent& e)
8513 {
8514 // Collect names of non-default non-external profiles.
8515 PrinterTechnology printer_technology = m_preset_bundle->printers.get_edited_preset().printer_technology();
8516 PresetCollection &depending_presets = (deps.type == Preset::TYPE_PRINTER) ? m_preset_bundle->printers :
8517 (printer_technology == ptFFF) ? m_preset_bundle->prints : m_preset_bundle->sla_prints;
8518 wxArrayString presets;
8519 for (size_t idx = 0; idx < depending_presets.size(); ++ idx)
8520 {
8521 Preset& preset = depending_presets.preset(idx);
8522 //BBS: add project embedded preset logic and refine is_external
8523 bool add = ! preset.is_default;
8524 //bool add = ! preset.is_default && ! preset.is_external;
8525 if (add && deps.type == Preset::TYPE_PRINTER)
8526 // Only add printers with the same technology as the active printer.
8527 add &= preset.printer_technology() == printer_technology;
8528 if (add)
8529 presets.Add(from_u8(preset.name));
8530 }
8531
8532 if(deps.type == Preset::TYPE_PRINTER){
8533 deps.dialog_title = _L("Compatible printers");
8534 deps.dialog_label = _L("Select printers");
8535 }else{
8536 deps.dialog_title = _L("Compatible process profiles");
8537 deps.dialog_label = _L("Select profiles");
8538 }
8539
8540 MultiChoiceDialog dlg(parent, deps.dialog_label, deps.dialog_title, presets);
8541 wxGetApp().UpdateDlgDarkUI(&dlg);
8542 // Collect and set indices of depending_presets marked as compatible.
8543 wxArrayInt selections;
8544 auto *compatible_printers = dynamic_cast<const ConfigOptionStrings*>(m_config->option(deps.key_list));
8545 if (compatible_printers != nullptr && !compatible_printers->values.empty())
8546 for (auto preset_name : compatible_printers->values)
8547 for (size_t idx = 0; idx < presets.GetCount(); ++idx)
8548 if (presets[idx] == from_u8(preset_name)) {
8549 selections.Add(idx);
8550 break;
8551 }
8552 dlg.SetSelections(selections);
8553 dlg.SetSize(FromDIP(wxSize(360, 480)));
8554 std::vector<std::string> value;
8555 // Show the dialog.
8556 if (dlg.ShowModal() == wxID_OK) {
8557 selections.Clear();
8558 selections = dlg.GetSelections();
8559 // leave list empty if all items checked. this will check "All" checkbox automatically. also fixes unnecessary config change
8560 if(selections.GetCount() != presets.GetCount())
8561 for (auto idx : selections)
8562 value.push_back(presets[idx].ToUTF8().data());
8563 if (value.empty()) {
8564 deps.checkbox->SetValue(1);
8565 deps.btn->Disable();
8566 }
8567 // All depending_presets have been made compatible with this preset.
8568 this->load_key_value(deps.key_list, value);
8569 this->update_changed_ui();
8570 }
8571 }));
8572
8573 return sizer;
8574}
@ Regular
Definition Button.hpp:24
@ Parameter
Definition Button.hpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
void SetStyle(const ButtonStyle style, const ButtonType type)
Definition Button.cpp:200
static wxFont Body_14
Definition Label.hpp:53
void toggle(bool en)
Fires the enable or disable function, based on the input.
Definition Field.cpp:439
void update_changed_ui()
Definition Tab.cpp:1106
wxMouseEvent
Definition CameraPopup.cpp:47
static PrinterTechnology printer_technology()
Definition GUI_Factories.cpp:60
static wxString dots("...", wxConvUTF8)
SpiralVase::SpiralPoint add(SpiralVase::SpiralPoint a, SpiralVase::SpiralPoint b)
Definition SpiralVase.cpp:26
PrinterTechnology
Definition Config.hpp:229
@ ptFFF
Definition Config.hpp:231

References _, _L, Label::Body_14, Slic3r::GUI::Tab::PresetDependencies::btn, Slic3r::GUI::Tab::PresetDependencies::checkbox, Slic3r::GUI::Tab::PresetDependencies::checkbox_title, compatible_widget_create(), Slic3r::GUI::Tab::PresetDependencies::dialog_label, Slic3r::GUI::Tab::PresetDependencies::dialog_title, Slic3r::GUI::dots(), Slic3r::ConfigOptionVector< T >::empty(), Button::Enable(), Slic3r::from_u8(), get_field(), Slic3r::GUI::MultiChoiceDialog::GetSelections(), Slic3r::Preset::is_default, Slic3r::GUI::Tab::PresetDependencies::key_condition, Slic3r::GUI::Tab::PresetDependencies::key_list, L, load_key_value(), m_config, m_preset_bundle, Slic3r::Preset::name, Parameter, parent(), Slic3r::PresetCollection::preset(), Slic3r::GUI::printer_technology(), Slic3r::Preset::printer_technology(), Slic3r::ptFFF, Regular, Slic3r::GUI::MultiChoiceDialog::SetSelections(), Button::SetStyle(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::PresetCollection::size(), Slic3r::GUI::Tab::PresetDependencies::type, Slic3r::Preset::TYPE_PRINTER, update_changed_ui(), Slic3r::GUI::wxMouseEvent, and wxStaticText.

Referenced by compatible_widget_create().

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

◆ compatible_widget_reload()

void Slic3r::GUI::Tab::compatible_widget_reload ( PresetDependencies & deps)
protectedinherited
9351{
9352 Field* field = this->get_field(deps.key_condition);
9353 if (!field)
9354 return;
9355
9356 bool has_any = ! m_config->option<ConfigOptionStrings>(deps.key_list)->values.empty();
9357 has_any ? deps.btn->Enable() : deps.btn->Disable();
9358 deps.checkbox->SetValue(! has_any);
9359
9360 field->toggle(! has_any);
9361}

References Slic3r::GUI::Tab::PresetDependencies::btn, Slic3r::GUI::Tab::PresetDependencies::checkbox, compatible_widget_reload(), Slic3r::ConfigOptionVector< T >::empty(), Button::Enable(), get_field(), Slic3r::GUI::Tab::PresetDependencies::key_condition, Slic3r::GUI::Tab::PresetDependencies::key_list, m_config, and Slic3r::GUI::Field::toggle().

Referenced by compatible_widget_reload(), on_value_change(), Slic3r::GUI::TabFilament::reload_config(), Slic3r::GUI::TabPrint::reload_config(), Slic3r::GUI::TabSLAMaterial::reload_config(), and Slic3r::GUI::TabSLAPrint::reload_config().

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

◆ completed()

bool Slic3r::GUI::Tab::completed ( ) const
inlineinherited
352{ return m_completed; }
bool m_completed
Definition Tab.hpp:283

References m_completed.

◆ create_bed_shape_widget()

wxSizer * Slic3r::GUI::TabPrinter::create_bed_shape_widget ( wxWindow * parent)
8608{
8609 // ORCA modernize button style
8610 Button* btn = new Button(parent, _(L("Set")) + " " + dots);
8612
8613 auto sizer = new wxBoxSizer(wxHORIZONTAL);
8614 sizer->Add(btn, 0, wxALIGN_CENTER_VERTICAL);
8615
8616 btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) {
8617 bool is_configed_by_BBL = PresetUtils::system_printer_bed_model(m_preset_bundle->printers.get_edited_preset()).size() > 0;
8618 BedShapeDialog dlg(this);
8619 dlg.build_dialog(m_config->option<ConfigOptionPoints>("printable_area")->values,
8620 *m_config->option<ConfigOptionString>("bed_custom_texture"),
8621 *m_config->option<ConfigOptionString>("bed_custom_model"));
8622 if (dlg.ShowModal() == wxID_OK) {
8623 const std::vector<Vec2d>& shape = dlg.get_shape();
8624 const std::string& custom_texture = dlg.get_custom_texture();
8625 const std::string& custom_model = dlg.get_custom_model();
8626 if (!shape.empty())
8627 {
8628 load_key_value("printable_area", shape);
8629 load_key_value("bed_custom_texture", custom_texture);
8630 load_key_value("bed_custom_model", custom_model);
8632 }
8634
8635 }
8636 }));
8637
8638 {
8639 Search::SettingsIndex& index = wxGetApp().sidebar().settings_index();
8640 const Search::GroupAndCategory& gc = index.get_group_and_category("printable_area");
8641 index.add_key("bed_custom_texture", m_type, gc.group, gc.category, gc.icon);
8642 index.add_key("bed_custom_model", m_type, gc.group, gc.category, gc.icon);
8643 }
8644
8645 return sizer;
8646}
void on_presets_changed()
Definition Tab.cpp:2771
std::string system_printer_bed_model(const Preset &preset)
Definition Preset.cpp:5095
zaa_minimize_perimeter_height ConfigOptionString
Definition PrintConfig.hpp:1702

References _, Slic3r::Search::SettingsIndex::add_key(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::Search::GroupAndCategory::category, create_bed_shape_widget(), Slic3r::GUI::dots(), Slic3r::GUI::BedShapeDialog::get_custom_model(), Slic3r::GUI::BedShapeDialog::get_custom_texture(), Slic3r::Search::SettingsIndex::get_group_and_category(), Slic3r::GUI::BedShapeDialog::get_shape(), Slic3r::Search::GroupAndCategory::group, Slic3r::Search::GroupAndCategory::icon, L, Slic3r::GUI::Tab::load_key_value(), Slic3r::GUI::Tab::m_config, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::GUI::Tab::m_type, Slic3r::GUI::Tab::on_presets_changed(), Parameter, Slic3r::GUI::Tab::parent(), Regular, Button::SetStyle(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::PresetUtils::system_printer_bed_model(), Slic3r::GUI::Tab::update_changed_ui(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by create_bed_shape_widget().

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

◆ create_line_with_widget()

void Slic3r::GUI::Tab::create_line_with_widget ( ConfigOptionsGroup * optgroup,
const std::string & opt_key,
const std::string & path,
widget_t widget )
protectedinherited
8429{
8430 Line line = optgroup->create_single_option_line(opt_key);
8431 line.widget = widget;
8432 line.label_path = path;
8433
8434 // set default undo ui
8435 line.set_undo_bitmap(&m_bmp_white_bullet);
8436 line.set_undo_to_sys_bitmap(&m_bmp_white_bullet);
8437 line.set_undo_tooltip(&m_tt_white_bullet);
8438 line.set_undo_to_sys_tooltip(&m_tt_white_bullet);
8439 line.set_label_colour(&m_default_text_clr);
8440
8441 optgroup->append_line(line);
8442}
wxString m_tt_white_bullet
Definition Tab.hpp:257
wxColour m_default_text_clr
Definition Tab.hpp:239
ScalableBitmap m_bmp_white_bullet
Definition Tab.hpp:224

References Slic3r::GUI::OptionsGroup::append_line(), create_line_with_widget(), Slic3r::GUI::ConfigOptionsGroup::create_single_option_line(), Slic3r::GUI::Line::label_path, m_bmp_white_bullet, m_default_text_clr, m_tt_white_bullet, Slic3r::GUI::UndoValueUIManager::set_label_colour(), Slic3r::GUI::UndoValueUIManager::set_undo_bitmap(), Slic3r::GUI::UndoValueUIManager::set_undo_to_sys_bitmap(), Slic3r::GUI::UndoValueUIManager::set_undo_to_sys_tooltip(), Slic3r::GUI::UndoValueUIManager::set_undo_tooltip(), and Slic3r::GUI::Line::widget.

Referenced by Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrinter::build_fff(), and create_line_with_widget().

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

◆ create_preset_tab()

void Slic3r::GUI::Tab::create_preset_tab ( )
inherited
261{
262//move to ParamsPanel
263/*#ifdef __WINDOWS__
264 SetDoubleBuffered(true);
265#endif //__WINDOWS__*/
266 auto panel = this;
267
268 m_preset_bundle = wxGetApp().preset_bundle;
269
270 // Vertical sizer to hold the choice menu and the rest of the page.
271/*#ifdef __WXOSX__
272 auto *main_sizer = new wxBoxSizer(wxVERTICAL);
273 main_sizer->SetSizeHints(this);
274 this->SetSizer(main_sizer);
275
276 // Create additional panel to Fit() it from OnActivate()
277 // It's needed for tooltip showing on OSX
278 m_tmp_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxBK_LEFT | wxTAB_TRAVERSAL);
279 auto panel = m_tmp_panel;
280 auto sizer = new wxBoxSizer(wxVERTICAL);
281 m_tmp_panel->SetSizer(sizer);
282 m_tmp_panel->Layout();
283
284 main_sizer->Add(m_tmp_panel, 1, wxEXPAND | wxALL, 0);
285#else
286 Tab *panel = this;
287 auto *sizer = new wxBoxSizer(wxVERTICAL);
288 sizer->SetSizeHints(panel);
289 panel->SetSizer(sizer);
290#endif //__WXOSX__*/
291
292 // BBS: model config
294 // preset chooser
295 m_presets_choice = new TabPresetComboBox(panel, m_type);
296 // m_presets_choice->SetFont(Label::Body_10); // BBS
297 m_presets_choice->set_selection_changed_function([this](int selection) {
298 if (!m_presets_choice->selection_is_changed_according_to_physical_printers())
299 {
300 if (m_type == Preset::TYPE_PRINTER && !m_presets_choice->is_selected_physical_printer())
301 m_preset_bundle->physical_printers.unselect_printer();
302
303 // select preset — prefer stored internal name to avoid alias collisions
304 wxString stored_name = m_presets_choice->GetItemAlias(selection);
305 std::string preset_name;
306 if (!stored_name.empty()) {
307 preset_name = Preset::remove_suffix_modified(stored_name.ToUTF8().data());
308 } else {
309 std::string selected_label = Preset::remove_suffix_modified(
310 m_presets_choice->GetString(selection).ToUTF8().data());
311 preset_name = m_preset_bundle->get_preset_name_by_alias(m_type, selected_label);
312 }
313 select_preset(preset_name);
314 }
315 });
316 }
317
318 auto color = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW);
319
320 //buttons
321 m_scaled_buttons.reserve(6);
322 m_scaled_bitmaps.reserve(4);
323
324 m_top_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
325 // BBS: open this tab by select first
326 m_top_panel->SetBackgroundColour(*wxWHITE);
327 m_top_panel->Bind(wxEVT_LEFT_UP, [this](auto & e) {
329 });
330
331 //add_scaled_button(panel, &m_btn_compare_preset, "compare");
334 //if (m_type == Preset::Type::TYPE_PRINTER)
335 // add_scaled_button(panel, &m_btn_edit_ph_printer, "cog");
336
340
341 //add_scaled_button(panel, &m_btn_hide_incompatible_presets, m_bmp_hide_incompatible_presets.name());
342
343 //m_btn_compare_preset->SetToolTip(_L("Compare presets"));
344 // TRN "Save current Settings"
345 m_btn_save_preset->SetToolTip(wxString::Format(_L("Save current %s"), m_title));
346 m_btn_delete_preset->SetToolTip(_(L("Delete this preset")));
347 m_btn_delete_preset->Hide();
348
349 /*add_scaled_button(panel, &m_question_btn, "question");
350 m_question_btn->SetToolTip(_(L("Hover the cursor over buttons to find more information\n"
351 "or click this button.")));
352
353 add_scaled_button(panel, &m_search_btn, "search");
354 m_search_btn->SetToolTip(format_wxstr(_L("Search in settings [%1%]"), _L("Ctrl+") + "F"));*/
355
356 // Bitmaps to be shown on the "Revert to system" aka "Lock to system" button next to each input field.
357 add_scaled_bitmap(this, m_bmp_value_lock , "unlock_normal");
358 add_scaled_bitmap(this, m_bmp_value_unlock, "lock_normal");
360 // Bitmaps to be shown on the "Undo user changes" button next to each input field.
363 // Bitmap to be shown on the "edit" button before to each editable input field.
364 add_scaled_bitmap(this, m_bmp_edit_value, "edit");
365
367
369 //add_scaled_button(m_top_panel, &m_undo_to_sys_btn, m_bmp_white_bullet.name());
371 m_btn_search->SetToolTip(_L("Search in preset"));
372
373 //search input
374 m_search_item = new StaticBox(m_top_panel);
375 StateColor box_colour(std::pair<wxColour, int>(*wxWHITE, StateColor::Normal));
376 StateColor box_border_colour(std::pair<wxColour, int>(wxColour("#009688"), StateColor::Normal)); // ORCA match border color with other input/combo boxes
377
378 m_search_item->SetBackgroundColor(box_colour);
379 m_search_item->SetBorderColor(box_border_colour);
380 m_search_item->SetCornerRadius(5);
381
382
383 //StateColor::darkModeColorFor(wxColour(238, 238, 238)), wxDefaultPosition, wxSize(m_top_panel->GetSize().GetWidth(), 3 * wxGetApp().em_unit()), 8);
384 auto search_sizer = new wxBoxSizer(wxHORIZONTAL);
385 m_search_input = new TextInput(m_search_item, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 | wxBORDER_NONE);
386 m_search_input->SetBackgroundColour(wxColour(238, 238, 238));
387 m_search_input->SetForegroundColour(wxColour(43, 52, 54));
388 m_search_input->SetFont(wxGetApp().bold_font());
389 m_search_input->SetIcon(*BitmapCache().load_svg("search", FromDIP(16), FromDIP(16)));
390 m_search_input->GetTextCtrl()->SetHint(_L("Search in preset") + dots);
391 search_sizer->Add(new wxWindow(m_search_item, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND|wxLEFT|wxRIGHT, FromDIP(2));
392 search_sizer->Add(m_search_input, 1, wxEXPAND | wxALL, FromDIP(2));
393 //bbl for linux
394 //search_sizer->Add(new wxWindow(m_search_input, wxID_ANY, wxDefaultPosition, wxSize(0, 0)), 0, wxEXPAND | wxLEFT, 16);
395
396
397 m_search_item->Bind(wxEVT_LEFT_DOWN, [this](wxMouseEvent &e) {
398 m_search_input->SetFocus();
399 });
400
401 m_search_input->Bind(wxCUSTOMEVT_EXIT_SEARCH, [this](wxCommandEvent &) {
402 Freeze();
404
405 m_btn_save_preset->Show();
406 m_btn_delete_preset->Show(); // ORCA: fixes delete preset button visible while search box focused
407 m_undo_btn->Show(); // ORCA: fixes revert preset button visible while search box focused
408 m_btn_search->Show();
409 m_search_item->Hide();
410
411 m_search_item->Refresh();
412 m_search_item->Update();
413 m_search_item->Layout();
414
415 this->GetParent()->Refresh();
416 this->GetParent()->Update();
417 this->GetParent()->Layout();
418 Thaw();
419 });
420
421 m_search_item->SetSizer(search_sizer);
422 m_search_item->Layout();
423 search_sizer->Fit(m_search_item);
424
425 m_search_item->Hide();
426 //m_btn_search->SetId(wxID_FIND_PROCESS);
427
428 m_btn_search->Bind(
429 wxEVT_BUTTON,
430 [this](wxCommandEvent &) {
431 Freeze();
433 m_presets_choice->Hide();
434
435 m_btn_save_preset->Hide();
436 m_btn_delete_preset->Hide(); // ORCA: fixes delete preset button visible while search box focused
437 m_undo_btn->Hide(); // ORCA: fixes revert preset button visible while search box focused
438 m_btn_search->Hide();
439 m_search_item->Show();
440
441 this->GetParent()->Refresh();
442 this->GetParent()->Update();
443 this->GetParent()->Layout();
444
445 wxGetApp().plater()->search(false, m_type, m_top_panel->GetParent(), m_search_input, m_btn_search);
446 Thaw();
447
448 });
449
450 m_undo_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent&) { on_roll_back_value(); }));
451 //m_undo_to_sys_btn->Bind(wxEVT_BUTTON, ([this](wxCommandEvent&) { on_roll_back_value(true); }));
452 /* m_search_btn->Bind(wxEVT_BUTTON, [](wxCommandEvent&) { wxGetApp().plater()->search(false); });*/
453
454 // Colors for ui "decoration"
455 m_sys_label_clr = wxGetApp().get_label_clr_sys();
456 m_modified_label_clr = wxGetApp().get_label_clr_modified();
457 m_default_text_clr = wxGetApp().get_label_clr_default();
458
459 m_main_sizer = new wxBoxSizer( wxVERTICAL );
460 m_top_sizer = new wxBoxSizer( wxHORIZONTAL );
461
462 m_top_sizer->Add(m_undo_btn, 0, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::ContentMargin()));
463 // BBS: model config
464 if (m_presets_choice) {
465 m_presets_choice->Reparent(m_top_panel);
466 m_top_sizer->Add(m_presets_choice, 1, wxLEFT | wxALIGN_CENTER_VERTICAL, FromDIP(SidebarProps::ElementSpacing()));
467 } else {
468 m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
469 m_top_sizer->AddStretchSpacer(1);
470 }
471
472 const float scale_factor = /*wxGetApp().*/em_unit(this)*0.1;// GetContentScaleFactor();
473#ifndef DISABLE_UNDO_SYS
474 m_top_sizer->Add(m_undo_to_sys_btn, 0, wxALIGN_CENTER_VERTICAL);
475 m_top_sizer->AddSpacer(FromDIP(SidebarProps::IconSpacing()));
476#endif
477 m_top_sizer->Add(m_btn_save_preset , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
478 m_top_sizer->Add(m_btn_delete_preset, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::IconSpacing()));
479 m_top_sizer->Add(m_btn_search , 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
480 m_top_sizer->Add(m_search_item , 1, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::ContentMargin()));
481
482 if (dynamic_cast<TabPrint*>(this) == nullptr) {
483 m_mode_icon = new ScalableButton(m_top_panel, wxID_ANY, "advanced"); // ORCA
484 m_mode_icon->SetToolTip(_L("Cycle settings visibility"));
485 m_mode_icon->Bind(wxEVT_BUTTON, [this](wxCommandEvent e) {
486 if (wxGetApp().get_mode() == comDevelop || m_mode_view == nullptr)
487 return; // prevent change on dev mode
488
489 const int selection = m_mode_view->GetSelection();
490 m_mode_view->SelectAndNotify((selection + 1) % 3);
491 });
492 m_top_sizer->Add(m_mode_icon, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(SidebarProps::WideSpacing()));
493 m_mode_view = new ModeSwitchButton(m_top_panel);
494 if (wxGetApp().get_mode() == comDevelop) {
496 m_mode_view->Enable(false);
497 } else {
498 m_mode_view->SetSelection(mode_to_selection(wxGetApp().get_saved_mode()));
499 }
500 m_top_sizer->AddSpacer(FromDIP(SidebarProps::ElementSpacing()));
501 m_top_sizer->Add( m_mode_view, 0, wxALIGN_CENTER_VERTICAL);
502 }
503
504 m_top_sizer->AddSpacer(FromDIP(SidebarProps::ContentMargin()));
505
506 m_top_sizer->SetMinSize(-1, 3 * m_em_unit);
507 m_top_panel->SetSizer(m_top_sizer);
509 m_main_sizer->Add(m_top_panel, 0, wxEXPAND | wxUP | wxDOWN, FromDIP(SidebarProps::ContentMarginV()));
510 else
511 m_top_panel->Hide();
512
513 // tree
514 m_tabctrl = new TabCtrl(panel, wxID_ANY, wxDefaultPosition, wxSize(20 * m_em_unit, -1),
515 wxTR_NO_BUTTONS | wxTR_HIDE_ROOT | wxTR_SINGLE | wxTR_NO_LINES | wxBORDER_NONE | wxWANTS_CHARS | wxTR_FULL_ROW_HIGHLIGHT);
516 m_tabctrl->Bind(wxEVT_RIGHT_DOWN, [](auto &e) {}); // disable right select
517 m_tabctrl->SetFont(Label::Body_14);
518 //m_left_sizer->Add(m_tabctrl, 1, wxEXPAND);
519 const int img_sz = int(32 * scale_factor + 0.5f);
520 m_icons = new wxImageList(img_sz, img_sz, false, 1);
521 // Index of the last icon inserted into $self->{icons}.
522 m_icon_count = -1;
523 m_tabctrl->AssignImageList(m_icons);
524 wxGetApp().UpdateDarkUI(m_tabctrl);
525
526 // Delay processing of the following handler until the message queue is flushed.
527 // This helps to process all the cursor key events on Windows in the tree control,
528 // so that the cursor jumps to the last item.
529 // BBS: bold selection
530 m_tabctrl->Bind(wxEVT_TAB_SEL_CHANGING, [this](wxCommandEvent& event) {
531 const auto sel_item = m_tabctrl->GetSelection();
532 m_tabctrl->SetItemBold(sel_item, false);
533 });
534 m_tabctrl->Bind(wxEVT_TAB_SEL_CHANGED, [this](wxCommandEvent& event) {
535#ifdef __linux__
536 // Events queue is opposite On Linux. wxEVT_SET_FOCUS invokes after wxEVT_TAB_SEL_CHANGED,
537 // and a result wxEVT_KILL_FOCUS doesn't invoke for the TextCtrls.
538 // So, call SetFocus explicitly for this control before changing of the selection
539 m_tabctrl->SetFocus();
540#endif
541 if (!m_disable_tree_sel_changed_event && !m_pages.empty()) {
544 else {
546 do {
547 m_page_switch_planned = false;
548 m_tabctrl->Update();
549 } while (this->tree_sel_change_delayed(event));
550 m_page_switch_running = false;
551 }
552 }
553 });
554
555 m_tabctrl->Bind(wxEVT_KEY_DOWN, &Tab::OnKeyDown, this);
556
557 m_main_sizer->Add(m_tabctrl, 0, wxEXPAND | wxALL, 0 );
558
559 if (dynamic_cast<TabPrinter *>(this) || dynamic_cast<TabPrint *>(this)) {
560 m_extruder_switch = new MultiSwitchButton(panel);
562 m_extruder_switch->SetFitToOptions();
563 m_extruder_switch->Bind(wxCUSTOMEVT_MULTISWITCH_SELECTION, [this](auto &evt) {
564 evt.Skip();
565 int selection = evt.GetInt();
566
567 int extruder_id;
569 parse_extruder_selection(selection, extruder_id, nozzle_type);
570 int extruder_count = m_preset_bundle->get_printer_extruder_count();
572 if (extruder_id >= 0 && extruder_id < m_preset_bundle->get_printer_extruder_count())
574
575 switch_excluder(extruder_id);
576 });
577 m_extruder_sync_box = new wxPanel(panel, wxID_ANY);
578 m_extruder_sync_box->SetBackgroundColour(panel->GetBackgroundColour());
579 m_extruder_sync_box->SetToolTip(_L("Synchronization of different extruder drives or nozzle volume types is not supported."));
580 m_extruder_sync = nullptr;
582 m_extruder_sync->SetToolTip(_L("Synchronize the modification of parameters to the corresponding parameters of another extruder."));
583 m_extruder_sync->Bind(wxEVT_BUTTON, [this](auto &evt) {
584 evt.Skip();
586 });
587
588 ScalableButton* icon = nullptr;
589 add_scaled_button(panel, &icon, "multi_extruder");
590 icon->SetToolTip(_L("Parameters with this icon can be configured per nozzle."));
591
592 auto sync_box_sizer = new wxBoxSizer(wxHORIZONTAL);
593 sync_box_sizer->Add(m_extruder_sync, 1, wxEXPAND);
594 m_extruder_sync_box->SetSizer(sync_box_sizer);
595
596 m_variant_sizer = new wxBoxSizer(wxHORIZONTAL);
597 auto right_sizer = new wxBoxSizer(wxHORIZONTAL);
598 auto left_sizer = new wxBoxSizer(wxHORIZONTAL);
599
600 m_variant_sizer->Add(left_sizer, 0, wxALIGN_CENTER);
601 m_variant_sizer->AddStretchSpacer(1);
602 // Orca: proportion 1 lets a narrow row squeeze the switch, which then scrolls its buttons.
603 m_variant_sizer->Add(m_extruder_switch, 1, wxALIGN_CENTER, 0);
604 m_variant_sizer->AddStretchSpacer(1);
605 m_variant_sizer->Add(right_sizer, 0, wxALIGN_CENTER);
606 left_sizer->Add(icon , 0, wxALIGN_CENTER | wxLEFT , m_em_unit);
607 right_sizer->Add(m_extruder_sync_box, 0, wxALIGN_CENTER | wxRIGHT, m_em_unit);
608
609 m_main_sizer->Add(m_variant_sizer, 0, wxEXPAND | wxTOP, m_em_unit);
610 } else if (dynamic_cast<TabFilament *>(this)) {
611 m_variant_combo = new MultiSwitchButton(panel);
613 m_variant_combo->Bind(wxCUSTOMEVT_MULTISWITCH_SELECTION, [this](auto &evt) {
614 evt.Skip();
615 switch_excluder(evt.GetInt());
619 if (m_active_page)
620 m_active_page->update_visibility(m_mode, true);
621 m_page_view->GetParent()->Layout();
622 });
623
624 ScalableButton* icon = nullptr;
625 add_scaled_button(panel, &icon, "multi_extruder");
626 icon->SetToolTip(_L("Parameters with this icon can be configured per nozzle."));
627
628 wxBoxSizer *top_sizer = new wxBoxSizer(wxHORIZONTAL);
629 top_sizer->Add(icon, 0, wxALIGN_CENTER_VERTICAL);
630 top_sizer->Add(m_variant_combo, 0, wxALIGN_CENTER_VERTICAL | wxLEFT, FromDIP(2));
631
632 m_variant_sizer = new wxBoxSizer(wxVERTICAL);
633 m_variant_sizer->Add(top_sizer, 0, wxEXPAND | wxLEFT, m_em_unit);
634
635 m_main_sizer->Add(m_variant_sizer, 0, wxEXPAND | wxTOP, m_em_unit);
636 }
637
638 this->SetSizer(m_main_sizer);
639 //this->Layout();
640 m_page_view = m_parent->get_paged_view();
641
642 // Initialize the page.
643/*#ifdef __WXOSX__
644 auto page_parent = m_tmp_panel;
645#else
646 auto page_parent = this;
647#endif
648
649 m_page_view = new wxScrolledWindow(page_parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
650 m_page_sizer = new wxBoxSizer(wxVERTICAL);
651 m_page_view->SetSizer(m_page_sizer);
652 m_page_view->SetScrollbars(1, 20, 1, 2);
653 m_hsizer->Add(m_page_view, 1, wxEXPAND | wxLEFT, 5);*/
654
655 //m_btn_compare_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) { compare_preset(); }));
656 m_btn_save_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) { save_preset(); }));
657 m_btn_delete_preset->Bind(wxEVT_BUTTON, ([this](wxCommandEvent& e) { delete_preset(); }));
658 /*m_btn_hide_incompatible_presets->Bind(wxEVT_BUTTON, ([this](wxCommandEvent e) {
659 toggle_show_hide_incompatible();
660 }));
661
662 if (m_btn_edit_ph_printer)
663 m_btn_edit_ph_printer->Bind(wxEVT_BUTTON, [this](wxCommandEvent& e) {
664 if (m_preset_bundle->physical_printers.has_selection())
665 m_presets_choice->edit_physical_printer();
666 else
667 m_presets_choice->add_physical_printer();
668 });*/
669
670 // Initialize the DynamicPrintConfig by default keys/values.
671 build();
672
673 // ys_FIXME: Following should not be needed, the function will be called later
674 // (update_mode->update_visibility->rebuild_page_tree). This does not work, during the
675 // second call of rebuild_page_tree m_tabctrl->GetFirstVisibleItem(); returns zero
676 // for some unknown reason (and the page is not refreshed until user does a selection).
678
679 m_completed = true;
680}
static wxFont Body_11
Definition Label.hpp:57
static int ElementSpacing()
Definition Plater.hpp:153
static int WideSpacing()
Definition Plater.hpp:152
static int IconSpacing()
Definition Plater.hpp:151
static int ContentMargin()
Definition Plater.hpp:149
static int ContentMarginV()
Definition Plater.hpp:150
wxPanel * m_top_panel
Definition Tab.hpp:167
TabPresetComboBox * m_presets_choice
Definition Tab.hpp:164
ScalableButton * m_undo_to_sys_btn
Definition Tab.hpp:211
ScalableBitmap m_bmp_show_incompatible_presets
Definition Tab.hpp:219
ScalableButton * m_btn_delete_preset
Definition Tab.hpp:177
ScalableButton * m_extruder_sync
Definition Tab.hpp:333
ScalableButton * m_undo_btn
Definition Tab.hpp:210
wxPanel * m_extruder_sync_box
Definition Tab.hpp:334
wxColour m_modified_label_clr
Definition Tab.hpp:238
wxSizer * m_variant_sizer
Definition Tab.hpp:330
ParamsPanel * m_parent
Definition Tab.hpp:155
const wxString m_title
Definition Tab.hpp:163
ScalableBitmap m_bmp_hide_incompatible_presets
Definition Tab.hpp:220
bool m_show_incompatible_presets
Definition Tab.hpp:266
void add_scaled_bitmap(wxWindow *parent, ScalableBitmap &btn, const std::string &icon_name)
Definition Tab.cpp:764
void switch_excluder(int extruder_id=-1, bool reload=true)
Definition Tab.cpp:9177
ScalableButton * m_mode_icon
Definition Tab.hpp:329
void restore_last_select_item()
Definition Tab.cpp:7848
ScalableButton * m_btn_save_preset
Definition Tab.hpp:176
ScalableButton * m_btn_search
Definition Tab.hpp:213
virtual void toggle_options()=0
void OnKeyDown(wxKeyEvent &event)
Definition Tab.cpp:8076
wxImageList * m_icons
Definition Tab.hpp:183
ScalableBitmap m_bmp_value_lock
Definition Tab.hpp:222
wxBoxSizer * m_top_sizer
Definition Tab.hpp:169
bool select_preset(std::string preset_name="", bool delete_current=false, const std::string &last_selected_ph_printer_name="", bool force_select=false, bool force_no_transfer=false)
Definition Tab.cpp:7387
ScalableBitmap * m_bmp_non_system
Definition Tab.hpp:226
std::vector< NozzleVolumeType > m_actual_nozzle_volumes
Definition Tab.hpp:339
int m_em_unit
Definition Tab.hpp:281
bool m_page_switch_running
Definition Tab.hpp:305
void add_scaled_button(wxWindow *parent, ScalableButton **btn, const std::string &icon_name, const wxString &label=wxEmptyString, long style=wxBU_EXACTFIT|wxNO_BORDER)
Definition Tab.cpp:753
TextInput * m_search_input
Definition Tab.hpp:215
ModeSwitchButton * m_mode_view
Definition Tab.hpp:328
wxBoxSizer * m_main_sizer
Definition Tab.hpp:168
void sync_excluder()
Definition Tab.cpp:9263
TabCtrl * m_tabctrl
Definition Tab.hpp:182
wxColour m_sys_label_clr
Definition Tab.hpp:237
ScalableBitmap m_bmp_value_unlock
Definition Tab.hpp:223
StaticBox * m_search_item
Definition Tab.hpp:214
bool m_page_switch_planned
Definition Tab.hpp:306
ScalableBitmap m_bmp_edit_value
Definition Tab.hpp:230
ScalableBitmap m_bmp_value_revert
Definition Tab.hpp:228
bool m_disable_tree_sel_changed_event
Definition Tab.hpp:265
virtual void build()=0
void delete_preset()
Definition Tab.cpp:8261
bool tree_sel_change_delayed(wxCommandEvent &event)
Definition Tab.cpp:7950
void set_tooltips_text()
Definition Tab.cpp:9363
void on_roll_back_value(const bool to_sys=false)
Definition Tab.cpp:1528
MultiSwitchButton * m_variant_combo
Definition Tab.hpp:332
static std::string remove_suffix_modified(const std::string &name)
Definition Preset.cpp:516
@ Normal
Definition StateColor.hpp:16
int mode_to_selection(ConfigOptionMode mode)
Definition ParamsPanel.cpp:47
@ comDevelop
Definition Config.hpp:225
@ comExpert
Definition Config.hpp:224
@ nvtStandard
Definition PrintConfig.hpp:619
bool load_svg(const char *path, Model *model, std::string &message)
Definition svg.cpp:309
int em_unit(wxWindow *win)
Definition wxExtensions.cpp:424

References _, _L, add_scaled_bitmap(), add_scaled_button(), Label::Body_11, Label::Body_14, build(), Slic3r::comDevelop, Slic3r::comExpert, Slic3r::GUI::SidebarProps::ContentMargin(), Slic3r::GUI::SidebarProps::ContentMarginV(), delete_preset(), Slic3r::GUI::dots(), Slic3r::GUI::SidebarProps::ElementSpacing(), em_unit(), Slic3r::GUI::SidebarProps::IconSpacing(), L, Slic3r::load_svg(), m_active_page, m_actual_nozzle_volumes, m_bmp_edit_value, m_bmp_hide_incompatible_presets, m_bmp_non_system, m_bmp_show_incompatible_presets, m_bmp_value_lock, m_bmp_value_revert, m_bmp_value_unlock, m_bmp_white_bullet, m_btn_delete_preset, m_btn_save_preset, m_btn_search, m_completed, m_default_text_clr, m_disable_tree_sel_changed_event, m_em_unit, m_extruder_switch, m_extruder_sync, m_extruder_sync_box, m_icon_count, m_icons, m_main_sizer, m_mode, m_mode_icon, m_mode_view, m_modified_label_clr, m_page_switch_planned, m_page_switch_running, m_page_view, m_pages, m_parent, m_preset_bundle, m_presets_choice, m_scaled_bitmaps, m_scaled_buttons, m_search_input, m_search_item, m_show_incompatible_presets, m_sys_label_clr, m_tabctrl, m_title, m_top_panel, m_top_sizer, m_type, m_undo_btn, m_undo_to_sys_btn, m_variant_combo, m_variant_sizer, StateColor::Normal, Slic3r::nozzle_type(), Slic3r::nvtStandard, on_roll_back_value(), OnKeyDown(), parse_extruder_selection(), rebuild_page_tree(), reload_config(), Slic3r::Preset::remove_suffix_modified(), restore_last_select_item(), save_preset(), select_preset(), set_tooltips_text(), switch_excluder(), sync_excluder(), toggle_options(), tree_sel_change_delayed(), Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_PRINTER, update_changed_ui(), Slic3r::GUI::SidebarProps::WideSpacing(), and Slic3r::GUI::wxMouseEvent.

Referenced by Slic3r::GUI::MainFrame::add_created_tab().

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

◆ current_preset_is_dirty()

bool Slic3r::GUI::Tab::current_preset_is_dirty ( ) const
inherited
5389{ return m_presets->current_is_dirty(); }

References current_preset_is_dirty(), and m_presets.

Referenced by current_preset_is_dirty(), and Slic3r::GUI::PresetComboBox::get_tooltip().

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

◆ decorate()

void Slic3r::GUI::Tab::decorate ( )
inherited
977{
978 for (const auto& opt : m_options_list)
979 {
980 Field* field = nullptr;
981 bool option_without_field = false;
982
983 if (opt.first == "printable_area" ||
984 opt.first == "compatible_prints" || opt.first == "compatible_printers")
985 option_without_field = true;
986
987 if (!option_without_field) {
988 field = get_field(opt.first);
989 if (!field)
990 continue;
991 }
992
993 bool is_nonsys_value = false;
994 bool is_modified_value = true;
995 const ScalableBitmap* sys_icon = &m_bmp_value_lock;
996 const ScalableBitmap* icon = &m_bmp_value_revert;
997
998 const wxColour* color = m_is_default_preset ? &m_default_text_clr : &m_sys_label_clr;
999
1000 const wxString* sys_tt = &m_tt_value_lock;
1001 const wxString* tt = &m_tt_value_revert;
1002
1003 // value isn't equal to system value
1004 if ((opt.second & osSystemValue) == 0) {
1005 is_nonsys_value = true;
1006 sys_icon = m_bmp_non_system;
1007 sys_tt = m_tt_non_system;
1008 // value is equal to last saved
1009 if ((opt.second & osInitValue) != 0)
1010 color = &m_default_text_clr;
1011 // value is modified
1012 else
1013 color = &m_modified_label_clr;
1014 }
1015 if ((opt.second & osInitValue) != 0)
1016 {
1017 is_modified_value = false;
1018 icon = &m_bmp_white_bullet;
1019 tt = &m_tt_white_bullet;
1020 }
1021
1022 if (opt.first == "compatible_prints" || opt.first == "compatible_printers") {
1023 bool sys_page = true;
1024 bool modified_page = false;
1026 sys_page = m_presets->get_selected_preset_parent() != nullptr;
1027 modified_page = false;
1028 } else {
1029 if (opt.first == "compatible_prints") {
1030 get_sys_and_mod_flags("compatible_prints", sys_page, modified_page);
1031 // Don't call for "compatible_printers"
1032 } else if (opt.first == "compatible_printers") {
1033 get_sys_and_mod_flags("compatible_printers", sys_page, modified_page);
1035 get_sys_and_mod_flags("compatible_prints", sys_page, modified_page);
1036 }
1037 }
1038 }
1039 if (!sys_page) {
1040 is_nonsys_value = true;
1041 sys_icon = m_bmp_non_system;
1042 sys_tt = m_tt_non_system;
1043
1044 if (!modified_page)
1045 color = &m_default_text_clr;
1046 else
1047 color = &m_modified_label_clr;
1048 }
1049
1050 if (!modified_page) {
1051 is_modified_value = false;
1052 icon = &m_bmp_white_bullet;
1053 tt = &m_tt_white_bullet;
1054 }
1055
1056 }
1057
1058 if (option_without_field) {
1059 if (Line* line = get_line(opt.first)) {
1060 line->set_undo_bitmap(icon);
1061 line->set_undo_to_sys_bitmap(sys_icon);
1062 line->set_undo_tooltip(tt);
1063 line->set_undo_to_sys_tooltip(sys_tt);
1064 line->set_label_colour(color);
1065 }
1066 continue;
1067 }
1068
1069 field->m_is_nonsys_value = is_nonsys_value;
1070 field->m_is_modified_value = is_modified_value;
1071 field->set_undo_bitmap(icon);
1072 //BBS: GUI refactor
1073 field->set_undo_to_sys_bitmap(sys_icon);
1074 field->set_undo_tooltip(tt);
1075 field->set_undo_to_sys_tooltip(sys_tt);
1076 field->set_label_colour(color);
1077
1078 if (field->has_edit_ui())
1079 field->set_edit_bitmap(&m_bmp_edit_value);
1080
1081 }
1082
1083 if (m_active_page)
1084 m_active_page->refresh();
1085}
void get_sys_and_mod_flags(const std::string &opt_key, bool &sys_page, bool &modified_page)
Definition Tab.cpp:1417
std::map< std::string, int > m_options_list
Definition Tab.hpp:271
wxString * m_tt_non_system
Definition Tab.hpp:255
bool m_is_default_preset
Definition Tab.hpp:205
Line * get_line(const t_config_option_key &opt_key)
Definition Tab.cpp:1928
wxString m_tt_value_revert
Definition Tab.hpp:258
wxString m_tt_value_lock
Definition Tab.hpp:252

References get_field(), get_line(), get_sys_and_mod_flags(), Slic3r::GUI::UndoValueUIManager::has_edit_ui(), m_active_page, m_bmp_edit_value, m_bmp_non_system, m_bmp_value_lock, m_bmp_value_revert, m_bmp_white_bullet, m_default_text_clr, m_is_default_preset, Slic3r::GUI::Field::m_is_modified_value, Slic3r::GUI::Field::m_is_nonsys_value, m_modified_label_clr, m_options_list, m_presets, m_sys_label_clr, m_tt_non_system, m_tt_value_lock, m_tt_value_revert, m_tt_white_bullet, m_type, osInitValue, osSystemValue, Slic3r::GUI::UndoValueUIManager::set_edit_bitmap(), Slic3r::GUI::UndoValueUIManager::set_label_colour(), Slic3r::GUI::UndoValueUIManager::set_undo_bitmap(), Slic3r::GUI::UndoValueUIManager::set_undo_to_sys_bitmap(), Slic3r::GUI::UndoValueUIManager::set_undo_to_sys_tooltip(), Slic3r::GUI::UndoValueUIManager::set_undo_tooltip(), Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINTER, and Slic3r::Preset::TYPE_SLA_MATERIAL.

Referenced by update_changed_ui(), and update_label_colours().

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

◆ delete_preset()

void Slic3r::GUI::Tab::delete_preset ( )
inherited
8262{
8263 auto current_preset = m_presets->get_selected_preset();
8264 // Don't let the user delete the ' - default - ' configuration.
8265 //BBS: add project embedded preset logic and refine is_external
8266 wxString msg;
8267 bool confirm_delete_third_party_printer = false;
8268 bool is_base_preset = false;
8269 if (m_presets->get_preset_base(current_preset) == &current_preset) { //root preset
8270 is_base_preset = true;
8271 if (current_preset.type == Preset::Type::TYPE_PRINTER && !current_preset.is_system) { //Customize third-party printers
8272 Preset &current_preset = m_presets->get_selected_preset();
8273 int filament_preset_num = 0;
8274 int process_preset_num = 0;
8275 for (const Preset &preset : m_preset_bundle->filaments.get_presets()) {
8276 if (preset.is_compatible && !preset.is_default) { filament_preset_num++; }
8277 }
8278 for (const Preset &preset : m_preset_bundle->prints.get_presets()) {
8279 if (preset.is_compatible && !preset.is_default) { process_preset_num++; }
8280 }
8281
8282 DeleteConfirmDialog
8283 dlg(parent(), wxString(SLIC3R_APP_FULL_NAME) + " - " + _L("Delete"),
8284 // TRN %1% is "N filament preset(s)", %2% is "N process preset(s)".
8285 format_wxstr(_L("%1% and %2% are attached to this printer. Those presets would be deleted if the printer is deleted."),
8286 wxString::Format(_L_PLURAL("%d filament preset", "%d filament presets", filament_preset_num), filament_preset_num),
8287 wxString::Format(_L_PLURAL("%d process preset", "%d process presets", process_preset_num), process_preset_num)));
8288 int res = dlg.ShowModal();
8289 if (res != wxID_OK) return;
8290 confirm_delete_third_party_printer = true;
8291 }
8292 int count = 0;
8293 wxString presets;
8294 for (auto &preset2 : *m_presets)
8295 if (preset2.inherits() == current_preset.name) {
8296 ++count;
8297 presets += "\n - " + from_u8(preset2.name);
8298 }
8299 if (count > 0) {
8300 msg = _L("Presets inherited by other presets cannot be deleted!");
8301 msg += "\n";
8302 msg += _L_PLURAL("The following preset inherits this preset.",
8303 "The following presets inherit this preset.", count);
8304 wxString title = _L("Delete Preset");
8305 MessageDialog(parent(), msg + presets, title, wxOK | wxICON_ERROR).ShowModal();
8306 return;
8307 }
8308 }
8309
8310 BOOST_LOG_TRIVIAL(info) << boost::format("delete preset %1%, setting_id %2%, user_id %3%, base_id %4%, sync_info %5%, type %6%")
8311 %current_preset.name%current_preset.setting_id%current_preset.user_id%current_preset.base_id%current_preset.sync_info
8313 PhysicalPrinterCollection& physical_printers = m_preset_bundle->physical_printers;
8314
8315 if (m_type == Preset::TYPE_PRINTER && !physical_printers.empty())
8316 {
8317 // Check preset for delete in physical printers
8318 // Ask a customer about next action, if there is a printer with just one preset and this preset is equal to delete
8319 std::vector<std::string> ph_printers = physical_printers.get_printers_with_preset(current_preset.name);
8320 std::vector<std::string> ph_printers_only = physical_printers.get_printers_with_only_preset(current_preset.name);
8321
8322 //if (!ph_printers.empty()) {
8323 // msg += _L_PLURAL("The physical printer below is based on the preset, you are going to delete.",
8324 // "The physical printers below are based on the preset, you are going to delete.", ph_printers.size());
8325 // for (const std::string& printer : ph_printers)
8326 // msg += "\n \"" + from_u8(printer) + "\",";
8327 // msg.RemoveLast();
8328 // msg += "\n" + _L_PLURAL("Note, that the selected preset will be deleted from this printer too.",
8329 // "Note, that the selected preset will be deleted from these printers too.", ph_printers.size()) + "\n\n";
8330 //}
8331
8332 //if (!ph_printers_only.empty()) {
8333 // msg += _L_PLURAL("The physical printer below is based only on the preset, you are going to delete.",
8334 // "The physical printers below are based only on the preset, you are going to delete.", ph_printers_only.size());
8335 // for (const std::string& printer : ph_printers_only)
8336 // msg += "\n \"" + from_u8(printer) + "\",";
8337 // msg.RemoveLast();
8338 // msg += "\n" + _L_PLURAL("Note, that this printer will be deleted after deleting the selected preset.",
8339 // "Note, that these printers will be deleted after deleting the selected preset.", ph_printers_only.size()) + "\n\n";
8340 //}
8341 if (!ph_printers.empty() || !ph_printers_only.empty()) {
8342 msg += _L_PLURAL("The following preset will be deleted too:", "The following presets will be deleted too:", ph_printers.size() + ph_printers_only.size());
8343 for (const std::string &printer : ph_printers) msg += "\n \"" + from_u8(printer) + "\",";
8344 for (const std::string &printer : ph_printers_only) msg += "\n \"" + from_u8(printer) + "\",";
8345 msg.RemoveLast();
8346 // msg += "\n" + _L_PLURAL("Note, that the selected preset will be deleted from this printer too.",
8347 // "Note, that the selected preset will be deleted from these printers too.", ph_printers.size()) + "\n\n";
8348 }
8349 }
8350
8351 if (is_base_preset && (current_preset.type == Preset::Type::TYPE_FILAMENT)) {
8352 msg += from_u8(_u8L("Are you sure to delete the selected preset?\nIf the preset corresponds to a filament currently in use on your printer, please reset the filament information for that slot."));
8353 } else {
8354 msg += _L("Are you sure you want to delete the selected preset?");
8355 }
8356
8357 wxString title = _L("Delete Preset");
8358 if (current_preset.is_default || !(confirm_delete_third_party_printer ||
8359 //wxID_YES != wxMessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal())
8360 wxID_YES == MessageDialog(parent(), msg, title, wxYES_NO | wxNO_DEFAULT | wxICON_QUESTION).ShowModal()))
8361 return;
8362
8363 // if we just delete preset from the physical printer
8364 if (m_presets_choice->is_selected_physical_printer()) {
8365 PhysicalPrinter& printer = physical_printers.get_selected_printer();
8366
8367 // just delete this preset from the current physical printer
8368 printer.delete_preset(m_presets->get_edited_preset().name);
8369 // select first from the possible presets for this printer
8370 physical_printers.select_printer(printer);
8371
8372 this->select_preset(physical_printers.get_selected_printer_preset_name());
8373 return;
8374 }
8375
8376 // delete selected preset from printers and printer, if it's needed
8377 if (m_type == Preset::TYPE_PRINTER && !physical_printers.empty())
8378 physical_printers.delete_preset_from_printers(current_preset.name);
8379
8380 // Select will handle of the preset dependencies, of saving & closing the depending profiles, and
8381 // finally of deleting the preset.
8382 this->select_preset("", true);
8383
8384 BOOST_LOG_TRIVIAL(info) << boost::format("delete preset finished");
8385}
static unsigned int count
Definition AuxiliaryDataViewModel.cpp:246
static std::string get_type_string(Preset::Type type)
Definition Preset.cpp:590
#define SLIC3R_APP_FULL_NAME
Definition libslic3r.h:11
wxString format_wxstr(const char *fmt, TArgs &&... args)
Definition format.hpp:22
#define _L_PLURAL(s, plural, n)
Definition I18N.hpp:96

References _L, _L_PLURAL, _u8L, count, delete_preset(), Slic3r::PhysicalPrinter::delete_preset(), Slic3r::PhysicalPrinterCollection::delete_preset_from_printers(), Slic3r::PhysicalPrinterCollection::empty(), Slic3r::GUI::format_wxstr(), Slic3r::from_u8(), Slic3r::PhysicalPrinterCollection::get_printers_with_only_preset(), Slic3r::PhysicalPrinterCollection::get_printers_with_preset(), Slic3r::PhysicalPrinterCollection::get_selected_printer(), Slic3r::PhysicalPrinterCollection::get_selected_printer_preset_name(), Slic3r::Preset::get_type_string(), m_preset_bundle, m_presets, m_presets_choice, m_type, parent(), select_preset(), Slic3r::PhysicalPrinterCollection::select_printer(), Slic3r::GUI::DPIAware< P >::ShowModal(), SLIC3R_APP_FULL_NAME, title(), Slic3r::Preset::TYPE_FILAMENT, and Slic3r::Preset::TYPE_PRINTER.

Referenced by create_preset_tab(), and delete_preset().

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

◆ description_line_widget()

wxSizer * Slic3r::GUI::Tab::description_line_widget ( wxWindow * parent,
ogStaticText ** StaticText,
wxString text = wxEmptyString )
inherited
5342{
5343 *StaticText = new ogStaticText(parent, text);
5344
5345// auto font = (new wxSystemSettings)->GetFont(wxSYS_DEFAULT_GUI_FONT);
5346 (*StaticText)->SetFont(wxGetApp().normal_font());
5347
5348 auto sizer = new wxBoxSizer(wxHORIZONTAL);
5349 sizer->Add(*StaticText, 1, wxEXPAND|wxALL, 0);
5350 return sizer;
5351}

References description_line_widget(), and parent().

Referenced by build_preset_description_line(), and description_line_widget().

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

◆ edit_custom_gcode()

void Slic3r::GUI::Tab::edit_custom_gcode ( const t_config_option_key & opt_key)
inherited
4379{
4380 EditGCodeDialog dlg = EditGCodeDialog(this, opt_key, get_custom_gcode(opt_key));
4381 if (dlg.ShowModal() == wxID_OK) {
4382 const std::string edited_gcode = dlg.get_edited_gcode();
4383 // Orca: this dialog writes the value straight into the config, bypassing the field's change
4384 // handler, so the reserved keyword check has to run here as it does when editing in place.
4386 set_custom_gcode(opt_key, edited_gcode);
4387 update_dirty();
4388 update();
4389 }
4390}
static bool validate_custom_gcode(const wxString &title, const std::string &gcode)
Definition Tab.cpp:4333
virtual void set_custom_gcode(const t_config_option_key &opt_key, const std::string &value)
Definition Tab.cpp:4397
virtual const std::string & get_custom_gcode(const t_config_option_key &opt_key)
Definition Tab.cpp:4392
friend class EditGCodeDialog
Definition Tab.hpp:565
bool validate_custom_gcodes_was_shown
Definition Tab.hpp:521
static wxString custom_gcode_group_title(const Page *page, const t_config_option_key &opt_key)
Definition Tab.cpp:4368

References Slic3r::GUI::custom_gcode_group_title(), EditGCodeDialog, get_custom_gcode(), Slic3r::GUI::EditGCodeDialog::get_edited_gcode(), m_active_page, set_custom_gcode(), Slic3r::GUI::DPIAware< P >::ShowModal(), update(), update_dirty(), validate_custom_gcode(), and validate_custom_gcodes_was_shown.

Referenced by Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrint::build(), and Slic3r::GUI::TabPrinter::build_fff().

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

◆ extruder_page()

Page * Slic3r::GUI::TabPrinter::extruder_page ( ) const
9015{
9016 for (const PageShp &page : m_pages)
9017 if (page->title() == "Extruder")
9018 return page.get();
9019 return nullptr;
9020}

References extruder_page(), and Slic3r::GUI::Tab::m_pages.

Referenced by activate_option(), build_unregular_pages(), extruder_page(), and extruder_page_data_index().

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

◆ extruder_page_data_index()

int Slic3r::GUI::TabPrinter::extruder_page_data_index ( const std::string & field_id) const
9023{
9024 if (Page *page = extruder_page())
9025 for (const auto &group : page->m_optgroups)
9026 if (auto it = group->opt_map().find(field_id); it != group->opt_map().end())
9027 return it->second.second;
9028 return -1;
9029}

References extruder_page(), and extruder_page_data_index().

Referenced by extruder_page_data_index(), and on_value_change().

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

◆ extruder_variant_index()

int Slic3r::GUI::TabPrinter::extruder_variant_index ( int extruder)
9032{
9033 const auto *extruders = m_config->option<ConfigOptionEnumsGeneric>("extruder_type");
9034 const int index = extruder < int(extruders->size()) ?
9035 m_config->get_index_for_extruder(extruder + 1, "printer_extruder_id", ExtruderType(extruders->values[extruder]),
9036 get_actual_nozzle_volume_type(extruder), "printer_extruder_variant") :
9037 -1;
9038 return index < 0 ? extruder : index;
9039}

References extruder_variant_index(), Slic3r::GUI::Tab::get_actual_nozzle_volume_type(), and Slic3r::GUI::Tab::m_config.

Referenced by extruder_variant_index(), and toggle_options().

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

◆ extruders_count_changed()

void Slic3r::GUI::TabPrinter::extruders_count_changed ( size_t extruders_count)
5803{
5804 bool is_count_changed = false;
5805 if (m_extruders_count != extruders_count) {
5806 m_extruders_count = extruders_count;
5807 m_preset_bundle->on_extruders_count_changed(extruders_count);
5808 is_count_changed = true;
5809
5810 wxGetApp().plater()->get_partplate_list().on_extruder_count_changed((int)m_extruders_count);
5811 }
5812 // Orca: support multi tool
5813 else if (m_extruders_count == 1 &&
5814 m_preset_bundle->project_config.option<ConfigOptionFloats>("flush_volumes_matrix")->values.size()>1)
5815 m_preset_bundle->update_multi_material_filament_presets();
5816
5817 /* This function should be call in any case because of correct updating/rebuilding
5818 * of unregular pages of a Printer Settings
5819 */
5821
5822 if (is_count_changed) {
5823 on_value_change("extruders_count", extruders_count);
5824 // BBS
5825 //wxGetApp().obj_list()->update_objects_list_filament_column(extruders_count);
5826 }
5827}

References build_unregular_pages(), extruders_count_changed(), m_extruders_count, Slic3r::GUI::Tab::m_preset_bundle, and on_value_change().

Referenced by build_unregular_pages(), extruders_count_changed(), on_preset_loaded(), and sync_extruders_count().

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

◆ filter_diff_option()

void Slic3r::GUI::Tab::filter_diff_option ( std::vector< std::string > & options)
protectedinherited
1088{
1089 for (auto &opt : options) {
1090 const auto hash_pos = opt.find_last_of('#');
1091 if (hash_pos == std::string::npos) continue;
1092 bool found = false;
1093 for (auto page : m_pages) {
1094 if (auto iter = page->m_opt_id_map.find(opt); iter != page->m_opt_id_map.end()) {
1095 opt = iter->second;
1096 found = true;
1097 break;
1098 }
1099 }
1100 if (!found) opt = opt.substr(0, hash_pos);
1101 }
1102 options.erase(std::remove(options.begin(), options.end(), ""), options.end());
1103}

References m_pages.

Referenced by Slic3r::GUI::TabPrintModel::activate_selected_page(), Slic3r::GUI::TabPrintModel::reload_config(), update_changed_ui(), and Slic3r::GUI::TabPrintModel::update_model_config().

Here is the caller graph for this function:

◆ generate_extruder_options()

std::vector< wxString > Slic3r::GUI::Tab::generate_extruder_options ( )
inherited
8931{
8932 std::vector<wxString> options;
8934 auto variants = m_config->option<ConfigOptionStrings>("filament_extruder_variant");
8935 if (!variants)
8936 return options;
8937
8938 for (auto &v : variants->values) {
8939 std::string drive, nozzle;
8940
8941 static std::vector<std::string> known_nozzle_types;
8942 if (known_nozzle_types.empty()) {
8943 for (auto nvt : get_valid_nozzle_volume_type()) {
8944 known_nozzle_types.push_back(get_nozzle_volume_type_string(nvt));
8945 }
8946 std::sort(known_nozzle_types.begin(), known_nozzle_types.end(),
8947 [](const std::string& a, const std::string& b) { return a.size() > b.size(); });
8948 }
8949 bool found = false;
8950 for (const auto& nozzle_type : known_nozzle_types) {
8951 if (v.size() > nozzle_type.size() &&
8952 v.substr(v.size() - nozzle_type.size()) == nozzle_type &&
8953 v[v.size() - nozzle_type.size() - 1] == ' ') {
8954 drive = v.substr(0, v.size() - nozzle_type.size() - 1);
8955 nozzle = nozzle_type;
8956 found = true;
8957 break;
8958 }
8959 }
8960 if (!found) {
8961 size_t pos = v.rfind(' ');
8962 if (pos != std::string::npos) {
8963 drive = v.substr(0, pos);
8964 nozzle = v.substr(pos + 1);
8965 } else {
8966 drive = v;
8967 nozzle = "";
8968 }
8969 }
8970 options.push_back(wxString::Format("%s %s", _L(drive), short_nozzle_volume_name(nozzle)));
8971 }
8972 return options;
8973 }
8974
8975 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
8976 auto nozzle_volumes_def = m_preset_bundle->project_config.def()->get("nozzle_volume_type");
8977 int extruder_nums = m_preset_bundle->get_printer_extruder_count();
8978
8979 if (!nozzle_volumes || extruder_nums <= 0) {
8980 return options;
8981 }
8982
8983 // Orca: the printer tab has one tag per extruder, named as its former "Extruder N" pages were.
8984 // parse_extruder_selection() counts a hybrid extruder as two tags; that still lines up because
8985 // only the last extruder can be hybrid.
8987 for (int i = 0; i < extruder_nums; ++i)
8988 options.push_back(translate_category(wxString::Format("Extruder %d", i + 1), m_type));
8989 return options;
8990 }
8991
8992 std::string pt = m_preset_bundle->printers.get_edited_preset().get_printer_type(m_preset_bundle);
8993 // Orca: the main/deputy toolhead names describe a Bambu dual-nozzle printer, where extruder 0 is
8994 // the left (deputy) and extruder 1 the right (main) nozzle. Other printers number their tools.
8995 const bool toolhead_names = extruder_nums == 2 && m_preset_bundle->is_bbl_vendor();
8996 for (int i = 0; i < extruder_nums; ++i) {
8997 wxString extruder_name = !toolhead_names ? wxString::Format("T%d", i + 1) :
8998 _L(DevPrinterConfigUtil::get_toolhead_display_name(
8999 pt, (i == 0) ? DEPUTY_EXTRUDER_ID : MAIN_EXTRUDER_ID,
9001 NozzleVolumeType volume_type = NozzleVolumeType(nozzle_volumes->values[i]);
9002
9003 if (volume_type == NozzleVolumeType::nvtHybrid) {
9004 options.push_back(wxString::Format("%s %s", extruder_name, short_nozzle_volume_name(get_nozzle_volume_type_string(NozzleVolumeType::nvtStandard))));
9005 options.push_back(wxString::Format("%s %s", extruder_name, short_nozzle_volume_name(get_nozzle_volume_type_string(NozzleVolumeType::nvtHighFlow))));
9006 } else {
9007 options.push_back(wxString::Format("%s %s", extruder_name,
9009 }
9010 }
9011 return options;
9012}
#define DEPUTY_EXTRUDER_ID
Definition DevDefs.h:102
#define MAIN_EXTRUDER_ID
Definition DevDefs.h:101
static wxString translate_category(const wxString &title, Preset::Type preset_type, bool translate=true)
Definition Tab.cpp:823
static wxString short_nozzle_volume_name(const std::string &volume_name)
Definition Tab.cpp:8908
ToolHeadComponent
Toolhead component type (extruder / nozzle / hotend).
Definition DevConfigUtil.h:33
@ Nozzle
Definition DevConfigUtil.h:35
std::string get_nozzle_volume_type_string(NozzleVolumeType nozzle_volume_type)
Definition PrintConfig.cpp:860
static std::set< NozzleVolumeType > get_valid_nozzle_volume_type()
Definition PrintConfig.hpp:679
ToolHeadNameCase
Name case style for toolhead display names.
Definition DevConfigUtil.h:40
@ TitleCase
Definition DevConfigUtil.h:41

References _L, DEPUTY_EXTRUDER_ID, generate_extruder_options(), Slic3r::get_nozzle_volume_type_string(), Slic3r::DevPrinterConfigUtil::get_toolhead_display_name(), Slic3r::get_valid_nozzle_volume_type(), m_config, m_preset_bundle, m_type, MAIN_EXTRUDER_ID, Slic3r::Nozzle, Slic3r::nozzle_type(), Slic3r::nvtHighFlow, Slic3r::nvtHybrid, Slic3r::nvtStandard, Slic3r::GUI::short_nozzle_volume_name(), Slic3r::TitleCase, translate_category(), Slic3r::Preset::TYPE_FILAMENT, and Slic3r::Preset::TYPE_PRINTER.

Referenced by generate_extruder_options(), update_changed_tree_ui(), update_extruder_switch_colors(), and update_extruder_variants().

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

◆ get_actual_nozzle_volume_type()

NozzleVolumeType Slic3r::GUI::Tab::get_actual_nozzle_volume_type ( int extruder_id)
inherited
9080{
9081 int extruder_count = m_preset_bundle->get_printer_extruder_count();
9082 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
9083 if (extruder_count == 1) {
9084 if (extruder_id < 0)
9086
9087 return NozzleVolumeType(nozzle_volumes->values[extruder_id]);
9088 }
9089
9090 if (extruder_id < 0 || extruder_id >= extruder_count)
9092
9093 if (m_actual_nozzle_volumes.size() != static_cast<size_t>(extruder_count))
9095
9096 return m_actual_nozzle_volumes[extruder_id];
9097}

References get_actual_nozzle_volume_type(), m_actual_nozzle_volumes, m_preset_bundle, and Slic3r::nvtStandard.

Referenced by Slic3r::GUI::TabPrinter::activate_option(), Slic3r::GUI::TabPrinter::extruder_variant_index(), get_actual_nozzle_volume_type(), get_extruder_sync_enable_state(), switch_excluder(), sync_excluder(), and update_extruder_variants().

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

◆ get_category_icon_map()

const std::map< wxString, std::string > & Slic3r::GUI::Tab::get_category_icon_map ( )
inlineinherited
506{ return m_category_icon; }

References m_category_icon.

Referenced by Slic3r::GUI::ActionRegistry::materialize_setting_actions().

Here is the caller graph for this function:

◆ get_combo_box()

TabPresetComboBox * Slic3r::GUI::Tab::get_combo_box ( )
inlineinherited
495{ return m_presets_choice; }

References m_presets_choice.

Referenced by Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_filament_target(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_preset_target(), and Slic3r::GUI::Sidebar::update_presets().

Here is the caller graph for this function:

◆ get_config()

DynamicPrintConfig * Slic3r::GUI::Tab::get_config ( )
inlineinherited
493{ return m_config; }

References m_config.

Referenced by Slic3r::GUI::ObjectList::add_settings_item(), and Slic3r::GUI::PresetComboBox::get_tooltip().

Here is the caller graph for this function:

◆ get_config_manipulation()

ConfigManipulation Slic3r::GUI::Tab::get_config_manipulation ( )
protectedinherited
9949{
9950 auto load_config = [this]()
9951 {
9952 update_dirty();
9953 // Initialize UI components with the config values.
9954 reload_config();
9955 update();
9956 };
9957
9958 auto cb_toggle_field = [this](const t_config_option_key& opt_key, bool toggle, int opt_index) {
9959 return toggle_option(opt_key, toggle, opt_index >= 0 ? opt_index + 256 : opt_index);
9960 };
9961
9962 auto cb_toggle_line = [this](const t_config_option_key &opt_key, bool toggle, int opt_index) {
9963 return toggle_line(opt_key, toggle, opt_index >= 0 ? opt_index + 256 : opt_index);
9964 };
9965
9966 auto cb_set_option_label = [this](const t_config_option_key &opt_key, const wxString &label, int opt_index) {
9967 return set_option_label(opt_key, label, opt_index >= 0 ? opt_index + 256 : opt_index);
9968 };
9969
9970 auto cb_value_change = [this](const std::string& opt_key, const boost::any& value) {
9971 return on_value_change(opt_key, value);
9972 };
9973
9974 return ConfigManipulation(load_config, cb_toggle_field, cb_toggle_line, cb_value_change, nullptr, this, cb_set_option_label);
9975}
void toggle_line(const std::string &opt_key, bool toggle, int opt_index=-1)
Definition Tab.cpp:1970
void set_option_label(const std::string &opt_key, const wxString &label, int opt_index=-1)
Definition Tab.cpp:1981
virtual void on_value_change(const std::string &opt_key, const boost::any &value)
Definition Tab.cpp:2071
void toggle_option(const std::string &opt_key, bool toggle, int opt_index=-1)
Definition Tab.cpp:1961

References load_config(), on_value_change(), reload_config(), set_option_label(), toggle_line(), toggle_option(), update(), and update_dirty().

Referenced by Tab().

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

◆ get_current_active_extruder()

int Slic3r::GUI::Tab::get_current_active_extruder ( )
inherited
742{
743 if (m_extruder_switch && m_extruder_switch->IsThisEnabled()) {
744 int selection = m_extruder_switch->GetSelection();
745 int extruder_id;
747 parse_extruder_selection(selection, extruder_id, nozzle_type);
748 return extruder_id;
749 }
750 return 0;
751}

References m_extruder_switch, Slic3r::nozzle_type(), and parse_extruder_selection().

Referenced by Slic3r::GUI::TabPrinter::activate_option(), Slic3r::GUI::TabPrinter::build_unregular_pages(), Slic3r::GUI::TabPrinter::on_value_change(), switch_excluder(), sync_excluder(), Slic3r::GUI::TabPrinter::toggle_options(), and update_variant_sizer_visibility().

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

◆ get_custom_ctrl_with_blinking_ptr()

std::pair< OG_CustomCtrl *, bool * > Slic3r::GUI::Tab::get_custom_ctrl_with_blinking_ptr ( const t_config_option_key & opt_key,
int opt_index = -1 )
inherited
1934{
1935 if (!m_active_page)
1936 return {nullptr, nullptr};
1937
1938 std::pair<OG_CustomCtrl*, bool*> ret = {nullptr, nullptr};
1939
1940 for (auto opt_group : m_active_page->m_optgroups) {
1941 ret = opt_group->get_custom_ctrl_with_blinking_ptr(opt_key, opt_index);
1942 if (ret.first && ret.second)
1943 break;
1944 }
1945 return ret;
1946}

References get_custom_ctrl_with_blinking_ptr(), and m_active_page.

Referenced by activate_option(), and get_custom_ctrl_with_blinking_ptr().

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

◆ get_custom_gcode()

const std::string & Slic3r::GUI::Tab::get_custom_gcode ( const t_config_option_key & opt_key)
virtualinherited

Reimplemented in Slic3r::GUI::TabFilament.

4393{
4394 return m_config->opt_string(opt_key);
4395}

References m_config.

Referenced by edit_custom_gcode().

Here is the caller graph for this function:

◆ get_extruder_sync_enable_state()

bool Slic3r::GUI::Tab::get_extruder_sync_enable_state ( int extruder_id)
inherited
9100{
9101 Preset& printer_preset = m_preset_bundle->printers.get_edited_preset();
9102 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
9103 auto extruders = printer_preset.config.option<ConfigOptionEnumsGeneric>("extruder_type");
9104 // Orca: every rule below describes the two toolheads of a dual-nozzle printer as left/right.
9105 // A printer with any other extruder count has no single counterpart to copy to, so it gets no
9106 // sync button (a toolchanger would need a target to be chosen).
9107 if (nozzle_volumes->values.size() != 2 || extruders->values.size() != 2) {
9108 return false;
9109 }
9110
9111 NozzleVolumeType left_nozzle = NozzleVolumeType(nozzle_volumes->values[0]);
9112 NozzleVolumeType right_nozzle = NozzleVolumeType(nozzle_volumes->values[1]);
9113 ExtruderType left_extruder = ExtruderType(extruders->values[0]);
9114 ExtruderType right_extruder = ExtruderType(extruders->values[1]);
9115
9116 if (left_extruder != right_extruder) {
9117 return false;
9118 }
9119
9120 if (left_nozzle == right_nozzle) {
9121 return true;
9122 }
9123
9124 if (left_nozzle != NozzleVolumeType::nvtHybrid && right_nozzle != NozzleVolumeType::nvtHybrid) {
9125 return false;
9126 }
9127
9128 if (left_nozzle == NozzleVolumeType::nvtHybrid && right_nozzle == NozzleVolumeType::nvtHybrid) {
9129 return true;
9130 }
9131
9132 // Hybrid rules
9133 auto current_nozzle = get_actual_nozzle_volume_type(extruder_id);
9134 if (left_nozzle != NozzleVolumeType::nvtHybrid) {
9135 if (extruder_id == 0) {
9136 return true;
9137 }
9138 if (extruder_id == 1 && current_nozzle == left_nozzle) {
9139 return true;
9140 }
9141 return false;
9142 }
9143 if (right_nozzle != NozzleVolumeType::nvtHybrid) {
9144 if (extruder_id == 1) {
9145 return true;
9146 }
9147 if (extruder_id == 0 && current_nozzle == right_nozzle) {
9148 return true;
9149 }
9150 return false;
9151 }
9152 return false;
9153}

References Slic3r::Preset::config, get_actual_nozzle_volume_type(), get_extruder_sync_enable_state(), m_preset_bundle, Slic3r::nvtHybrid, Slic3r::ConfigBase::option(), and Slic3r::ConfigOptionVector< int >::values.

Referenced by get_extruder_sync_enable_state(), switch_excluder(), sync_excluder(), and update_variant_sizer_visibility().

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

◆ get_field() [1/2]

Field * Slic3r::GUI::Tab::get_field ( const t_config_option_key & opt_key,
int opt_index = -1 ) const
inherited
1924{
1925 return m_active_page ? m_active_page->get_field(opt_key, opt_index) : nullptr;
1926}

References get_field(), and m_active_page.

Referenced by activate_option(), commit_preset_config_value(), compatible_widget_create(), compatible_widget_reload(), decorate(), get_field(), get_field(), on_value_change(), Slic3r::GUI::TabPrinter::refresh_printer_agent_dropdown(), Slic3r::GUI::TabPrinter::toggle_options(), Slic3r::GUI::TabPrinter::update_input_shaper_menu(), and update_label_colours().

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

◆ get_field() [2/2]

Field * Slic3r::GUI::Tab::get_field ( const t_config_option_key & opt_key,
Page ** selected_page,
int opt_index = -1 )
inherited
1949{
1950 Field* field = nullptr;
1951 for (auto page : m_pages) {
1952 field = page->get_field(opt_key, opt_index);
1953 if (field != nullptr) {
1954 *selected_page = page.get();
1955 return field;
1956 }
1957 }
1958 return field;
1959}

References get_field(), and m_pages.

Here is the call graph for this function:

◆ get_line()

Line * Slic3r::GUI::Tab::get_line ( const t_config_option_key & opt_key)
inherited
1929{
1930 return m_active_page ? m_active_page->get_line(opt_key) : nullptr;
1931}

References get_line(), and m_active_page.

Referenced by decorate(), get_line(), and update_label_colours().

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

◆ get_presets()

PresetCollection * Slic3r::GUI::Tab::get_presets ( )
inlineinherited
494{ return m_presets; }

References m_presets.

Referenced by Slic3r::GUI::SavePresetDialog::Item::Item(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), and Slic3r::GUI::PresetComboBox::get_tooltip().

Here is the caller graph for this function:

◆ get_sys_and_mod_flags()

void Slic3r::GUI::Tab::get_sys_and_mod_flags ( const std::string & opt_key,
bool & sys_page,
bool & modified_page )
inherited
1418{
1419 auto opt = m_options_list.find(opt_key);
1420 if (opt == m_options_list.end())
1421 return;
1422 // If the value is empty, clear the system flag
1423 if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
1424 auto* compatible_values = m_config->option<ConfigOptionStrings>(opt_key);
1425 if (compatible_values && compatible_values->values.empty()) {
1426 sys_page = false; // Empty value should NOT be treated as a system value
1427 }
1428 } else if (sys_page) {
1429 sys_page = (opt->second & osSystemValue) != 0;
1430 }
1431
1432 modified_page |= (opt->second & osInitValue) == 0;
1433
1434 //if (sys_page) sys_page = (opt->second & osSystemValue) != 0;
1435 //modified_page |= (opt->second & osInitValue) == 0;
1436}

References get_sys_and_mod_flags(), m_config, m_options_list, osInitValue, and osSystemValue.

Referenced by decorate(), get_sys_and_mod_flags(), and update_changed_tree_ui().

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

◆ init_options_list()

void Slic3r::GUI::TabPrinter::init_options_list ( )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

1386{
1389 m_options_list.emplace("extruders_count", m_opt_status_value);
1390}
virtual void init_options_list()
Definition Tab.cpp:1376
int m_opt_status_value
Definition Tab.hpp:273

References Slic3r::GUI::Tab::init_options_list(), init_options_list(), Slic3r::GUI::Tab::m_opt_status_value, Slic3r::GUI::Tab::m_options_list, m_printer_technology, and Slic3r::ptFFF.

Referenced by build_unregular_pages(), init_options_list(), and sync_extruders_count().

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

◆ is_printer_extruder_page()

bool Slic3r::GUI::Tab::is_printer_extruder_page ( const Page * page) const
inlineinherited
399{ return m_type == Preset::TYPE_PRINTER && page && page->title() == "Extruder"; }

References m_type, Slic3r::GUI::Page::title(), and Slic3r::Preset::TYPE_PRINTER.

Referenced by check_extruder_options_status(), switch_excluder(), update_changed_tree_ui(), update_extruder_switch_colors(), and update_variant_sizer_visibility().

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

◆ load_config()

void Slic3r::GUI::Tab::load_config ( const DynamicPrintConfig & config)
inherited
1636{
1637 bool modified = 0;
1638 for(auto opt_key : m_config->diff(config)) {
1639 m_config->set_key_value(opt_key, config.option(opt_key)->clone());
1640 modified = 1;
1641 }
1642 if (modified) {
1643 update_dirty();
1644 //# Initialize UI components with the config values.
1645 reload_config();
1646 update();
1647 }
1648}

References Slic3r::ConfigOption::clone(), load_config(), m_config, Slic3r::ConfigBase::option(), reload_config(), update(), and update_dirty().

Referenced by get_config_manipulation(), Slic3r::GUI::MainFrame::load_config(), load_config(), set_custom_gcode(), Slic3r::GUI::TabFilament::set_custom_gcode(), and Slic3r::GUI::Sidebar::priv::switch_diameter().

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

◆ load_current_preset()

void Slic3r::GUI::Tab::load_current_preset ( )
inherited
7134{
7135 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<<boost::format(": enter, m_type %1%")%Preset::get_type_string(m_type);
7136 const Preset& preset = m_presets->get_edited_preset();
7137 std::vector<std::string> prev_variant_list;
7138 int prev_extruder_count = 0;
7139
7141
7143 // For the printer profile, generate the extruder pages.
7144 if (preset.printer_technology() == ptFFF) {
7145 prev_variant_list = static_cast<TabPrinter*>(this)->m_extruder_variant_list;
7146 prev_extruder_count = static_cast<TabPrinter*>(this)->m_extruders_count;
7148 }
7149 else
7150 wxGetApp().obj_list()->update_objects_list_filament_column(1);
7151 }
7152 if (m_type == Preset::TYPE_PRINT) {
7153 if (auto tab = wxGetApp().plate_tab) {
7154 tab->m_config->apply(*m_config);
7155 tab->update_extruder_variants();
7156 }
7157 for (auto tab : wxGetApp().model_tabs_list) {
7158 tab->m_config->apply(*m_config);
7159 tab->update_extruder_variants();
7160 }
7161 }
7162 update();
7163
7164 // Reload preset pages with the new configuration values.
7165 update_extruder_variants(-1, false);
7166 reload_config();
7167
7168 update_ui_items_related_on_parent_preset(m_presets->get_selected_preset_parent());
7169
7170// m_undo_to_sys_btn->Enable(!preset.is_default);
7171
7172#if 0
7173 // use CallAfter because some field triggers schedule on_change calls using CallAfter,
7174 // and we don't want them to be called after this update_dirty() as they would mark the
7175 // preset dirty again
7176 // (not sure this is true anymore now that update_dirty is idempotent)
7177 wxTheApp->CallAfter([this]
7178#endif
7179 {
7180 // checking out if this Tab exists till this moment
7181 if (!wxGetApp().checked_tab(this))
7182 return;
7183 update_tab_ui();
7184
7185 // update show/hide tabs
7187 const PrinterTechnology printer_technology = m_presets->get_edited_preset().printer_technology();
7188 if (printer_technology != static_cast<TabPrinter*>(this)->m_printer_technology)
7189 {
7190 // The change of the technology requires to remove some of unrelated Tabs
7191 // During this action, wxNoteBook::RemovePage invoke wxEVT_NOTEBOOK_PAGE_CHANGED
7192 // and as a result a function select_active_page() is called fron Tab::OnActive()
7193 // But we don't need it. So, to avoid activation of the page, set m_active_page to NULL
7194 // till unusable Tabs will be deleted
7195 Page* tmp_page = m_active_page;
7196 m_active_page = nullptr;
7197 for (auto tab : wxGetApp().tabs_list) {
7198 if (tab->type() == Preset::TYPE_PRINTER) { // Printer tab is shown every time
7199 int cur_selection = wxGetApp().tab_panel()->GetSelection();
7200 if (cur_selection != 0)
7201 wxGetApp().tab_panel()->SetSelection(wxGetApp().tab_panel()->GetPageCount() - 1);
7202 continue;
7203 }
7204 if (tab->supports_printer_technology(printer_technology))
7205 {
7206#ifdef _MSW_DARK_MODE
7207 if (!wxGetApp().tabs_as_menu()) {
7208 std::string bmp_name = tab->type() == Slic3r::Preset::TYPE_FILAMENT ? "spool" :
7209 tab->type() == Slic3r::Preset::TYPE_SLA_MATERIAL ? "" : "cog";
7210 tab->Hide(); // #ys_WORKAROUND : Hide tab before inserting to avoid unwanted rendering of the tab
7211 dynamic_cast<Notebook*>(wxGetApp().tab_panel())->InsertPage(wxGetApp().tab_panel()->FindPage(this), wxString(), tab, tab->title(), bmp_name);
7212 }
7213 else
7214#endif
7215 wxGetApp().tab_panel()->InsertPage(wxGetApp().tab_panel()->FindPage(this), tab, tab->title(), "");
7216 #ifdef __linux__ // the tabs apparently need to be explicitly shown on Linux (pull request #1563)
7217 int page_id = wxGetApp().tab_panel()->FindPage(tab);
7218 wxGetApp().tab_panel()->GetPage(page_id)->Show(true);
7219 #endif // __linux__
7220 }
7221 else {
7222 int page_id = wxGetApp().tab_panel()->FindPage(tab);
7223 wxGetApp().tab_panel()->GetPage(page_id)->Show(false);
7224 wxGetApp().tab_panel()->RemovePage(page_id);
7225 }
7226 }
7227 static_cast<TabPrinter*>(this)->m_printer_technology = printer_technology;
7228 m_active_page = tmp_page;
7229#ifdef _MSW_DARK_MODE
7230 if (!wxGetApp().tabs_as_menu())
7231 dynamic_cast<Notebook*>(wxGetApp().tab_panel())->SetPageImage(wxGetApp().tab_panel()->FindPage(this), printer_technology == ptFFF ? "printer" : "sla_printer");
7232#endif
7233 }
7234 //update the object config due to extruder count change
7235 DynamicPrintConfig& new_print_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
7236 std::vector<std::string> new_variant_list = wxGetApp().preset_bundle->printers.get_edited_preset().config.option<ConfigOptionStrings>("printer_extruder_variant")->values;
7237 int new_extruder_count = wxGetApp().preset_bundle->get_printer_extruder_count();
7238 if (prev_extruder_count != new_extruder_count || prev_variant_list.size() != new_variant_list.size())
7239 {
7240 //process the object params here
7241 Model& model = wxGetApp().plater()->model();
7242 size_t num_objects = model.objects.size();
7243 for (int i = 0; i < num_objects; ++i) {
7244 ModelObject* object = model.objects[i];
7245 DynamicPrintConfig object_config = object->config.get();
7246 if (!object_config.empty()) {
7247 object_config.update_values_from_multi_to_multi_2(prev_variant_list, new_variant_list, new_print_config, print_options_with_variant);
7248 object->config.assign_config(std::move(object_config));
7249 }
7250 for (ModelVolume* v : object->volumes) {
7251 if (v->is_model_part() || v->is_modifier()) {
7252 DynamicPrintConfig volume_config = v->config.get();
7253 if (!volume_config.empty()) {
7254 volume_config.update_values_from_multi_to_multi_2(prev_variant_list,new_variant_list,new_print_config, print_options_with_variant);
7255 v->config.assign_config(std::move(volume_config));
7256 }
7257 }
7258 }
7259
7260 for (auto &layer_config_it : object->layer_config_ranges) {
7261 ModelConfig& layer_model_config = layer_config_it.second;
7262 DynamicPrintConfig layer_config = layer_model_config.get();
7263 if (!layer_config.empty()) {
7264 layer_config.update_values_from_multi_to_multi_2(prev_variant_list,new_variant_list,new_print_config, print_options_with_variant);
7265 layer_model_config.assign_config(std::move(layer_config));
7266 }
7267 }
7268 }
7269 }
7270
7272 if (printer_technology == ptFFF) {
7273 static_cast<TabPrinter*>(this)->m_initial_extruders_count = static_cast<const ConfigOptionFloats*>(m_presets->get_selected_preset().config.option("nozzle_diameter"))->values.size(); //static_cast<TabPrinter*>(this)->m_extruders_count;
7274 const Preset* parent_preset = m_presets->get_selected_preset_parent();
7275 static_cast<TabPrinter*>(this)->m_sys_extruders_count = parent_preset == nullptr ? 0 :
7276 static_cast<const ConfigOptionFloats*>(parent_preset->config.option("nozzle_diameter"))->values.size();
7277 }
7278 }
7279 else {
7283 }
7284 m_opt_status_value = (m_presets->get_selected_preset_parent() ? osSystemValue : 0) | osInitValue;
7286 if (m_type == Preset::TYPE_PRINT) {
7287 for (auto tab : wxGetApp().model_tabs_list) {
7288 tab->init_options_list();
7289 }
7290 }
7293 }
7294#if 0
7295 );
7296#endif
7297 BOOST_LOG_TRIVIAL(info) << __FUNCTION__<<boost::format(": exit");
7298}
void update_tab_ui(bool update_plater_presets=false)
Definition Tab.cpp:1624
void update_extruder_variants(int extruder_id=-1, bool reload=true)
Call from: 1: on_value_change "nozzle_volume_type" 2: on_preset_loaded (extruder_id = -1).
Definition Tab.cpp:8835
void update_frequently_changed_parameters()
Definition Tab.cpp:2957
void update_btns_enabling()
Definition Tab.cpp:7364
void update_visibility()
Definition Tab.cpp:1807
void update_ui_items_related_on_parent_preset(const Preset *selected_preset_parent)
Definition Tab.cpp:7114
virtual void on_preset_loaded()
Definition Tab.hpp:415
@ TYPE_SLA_PRINT
Definition Preset.hpp:247
std::set< std::string > print_options_with_variant
Definition PrintConfig.cpp:10102

References Slic3r::ModelConfig::assign_config(), Slic3r::ModelVolume::config, Slic3r::Preset::config, Slic3r::DynamicConfig::empty(), Slic3r::ModelConfig::get(), Slic3r::Preset::get_type_string(), init_options_list(), Slic3r::ModelVolume::is_model_part(), Slic3r::ModelVolume::is_modifier(), Slic3r::ModelObject::layer_config_ranges, load_current_preset(), m_active_page, m_config, m_opt_status_value, m_presets, m_type, Slic3r::Model::objects, on_preset_loaded(), on_presets_changed(), Slic3r::ConfigBase::option(), osInitValue, osSystemValue, Slic3r::print_options_with_variant, Slic3r::GUI::printer_technology(), Slic3r::Preset::printer_technology(), Slic3r::ptFFF, reload_config(), Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, Slic3r::Preset::TYPE_SLA_PRINT, update(), update_btns_enabling(), update_changed_ui(), update_extruder_variants(), update_frequently_changed_parameters(), update_tab_ui(), update_ui_items_related_on_parent_preset(), Slic3r::DynamicPrintConfig::update_values_from_multi_to_multi_2(), update_visibility(), and Slic3r::ModelObject::volumes.

Referenced by load_current_preset(), on_presets_changed(), select_preset(), and transfer_options().

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

◆ load_initial_data()

void Slic3r::GUI::Tab::load_initial_data ( )
inherited
773{
774 m_config = &m_presets->get_edited_preset().config;
775 bool has_parent = m_presets->get_selected_preset_parent() != nullptr;
779}
wxString m_tt_value_unlock
Definition Tab.hpp:253
wxString * m_ttg_non_system
Definition Tab.hpp:246
wxString m_ttg_white_bullet_ns
Definition Tab.hpp:244
wxString m_ttg_value_unlock
Definition Tab.hpp:243

References m_bmp_non_system, m_bmp_value_unlock, m_bmp_white_bullet, m_config, m_presets, m_tt_non_system, m_tt_value_unlock, m_ttg_non_system, m_ttg_value_unlock, and m_ttg_white_bullet_ns.

Referenced by Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrint::build(), Slic3r::GUI::TabPrinter::build(), Slic3r::GUI::TabPrintPlate::build(), Slic3r::GUI::TabSLAMaterial::build(), and Slic3r::GUI::TabSLAPrint::build().

Here is the caller graph for this function:

◆ load_key_value()

void Slic3r::GUI::Tab::load_key_value ( const std::string & opt_key,
const boost::any & value,
bool saved_value = false )
protectedinherited
2019{
2020 if (!saved_value) change_opt_value(*m_config, opt_key, value);
2021 // Mark the print & filament enabled if they are compatible with the currently selected preset.
2022 if (opt_key == "compatible_printers" || opt_key == "compatible_prints") {
2023 // Don't select another profile if this profile happens to become incompatible.
2025 }
2026 if (m_presets_choice)
2027 m_presets_choice->update_dirty();
2029 update();
2030}
void change_opt_value(DynamicPrintConfig &config, const t_config_option_key &opt_key, const boost::any &value, int opt_index)
Definition GUI.cpp:140

References Slic3r::GUI::change_opt_value(), load_key_value(), m_config, m_preset_bundle, m_presets_choice, Slic3r::Never, on_presets_changed(), and update().

Referenced by apply_preset_config_values(), compatible_widget_create(), Slic3r::GUI::TabPrinter::create_bed_shape_widget(), load_key_value(), and on_roll_back_value().

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

◆ may_discard_current_dirty_preset()

bool Slic3r::GUI::Tab::may_discard_current_dirty_preset ( PresetCollection * presets = nullptr,
const std::string & new_printer_name = "",
bool no_transfer = false,
bool no_transfer_variant = false )
inherited
7719{
7720 if (presets == nullptr) presets = m_presets;
7721
7722 UnsavedChangesDialog dlg(m_type, presets, new_printer_name, no_transfer);
7723 if (dlg.ShowModal() == wxID_CANCEL)
7724 return false;
7725
7726 if (dlg.save_preset()) // save selected changes
7727 {
7728 const std::vector<std::string>& unselected_options = dlg.get_unselected_options(presets->type());
7729 const std::string& name = dlg.get_preset_name();
7730 //BBS: add project embedded preset relate logic
7731 bool save_to_project = dlg.get_save_to_project_option();
7732
7733 if (m_type == presets->type()) // save changes for the current preset from this tab
7734 {
7735 // revert unselected options to the old values
7736 presets->get_edited_preset().config.apply_only(presets->get_selected_preset().config, unselected_options);
7737 //BBS: add project embedded preset relate logic
7738 save_preset(name, false, save_to_project);
7739 //save_preset(name);
7740 }
7741 else
7742 {
7743 //BBS: add project embedded preset relate logic
7744 m_preset_bundle->save_changes_for_preset(name, presets->type(), unselected_options, save_to_project);
7745 //m_preset_bundle->save_changes_for_preset(name, presets->type(), unselected_options);
7746
7747 // If filament preset is saved for multi-material printer preset,
7748 // there are cases when filament comboboxs are updated for old (non-modified) colors,
7749 // but in full_config a filament_colors option aren't.
7750 if (presets->type() == Preset::TYPE_FILAMENT && wxGetApp().extruders_edited_cnt() > 1)
7751 wxGetApp().plater()->force_filament_colors_update();
7752 }
7753 }
7754 else if (dlg.transfer_changes()) // move selected changes
7755 {
7756 std::vector<std::string> selected_options = dlg.get_selected_options();
7757 if (!no_transfer && no_transfer_variant) {
7758 auto & options_list = wxGetApp().get_tab(presets->type())->m_options_list;
7759 bool has_variants = false;
7760 for (auto &opt : selected_options) {
7761 if (auto n = opt.find('#'); n != std::string::npos) {
7762 auto iter = options_list.lower_bound(opt.substr(0, n));
7763 if (iter == options_list.end() || opt.compare(0, n, iter->first)) {
7764 has_variants = true;
7765 opt.clear();
7766 }
7767 }
7768 }
7769 if (has_variants) {
7770 auto msg = _L("Switching to a printer with different extruder types or numbers will discard or reset changes to extruder or multi-nozzle-related parameters.");
7771 MessageDialog(wxGetApp().plater(), msg, _L("Use Modified Value"), wxOK | wxICON_WARNING).ShowModal();
7772 selected_options.erase(std::remove(selected_options.begin(), selected_options.end(), ""), selected_options.end());
7773 }
7774 }
7775
7776 if (m_type == presets->type()) // move changes for the current preset from this tab
7777 {
7779 auto it = std::find(selected_options.begin(), selected_options.end(), "extruders_count");
7780 if (it != selected_options.end()) {
7781 // erase "extruders_count" option from the list
7782 selected_options.erase(it);
7783 // cache the extruders count
7784 static_cast<TabPrinter*>(this)->cache_extruder_cnt();
7785 }
7786 }
7787
7788 // copy selected options to the cache from edited preset
7789 cache_config_diff(selected_options);
7790 }
7791 else
7792 wxGetApp().get_tab(presets->type())->cache_config_diff(selected_options);
7793 }
7794
7795 return true;
7796}
std::string name() const
Definition Tab.hpp:349
void cache_config_diff(const std::vector< std::string > &selected_options, const DynamicPrintConfig *config=nullptr)
Definition Tab.cpp:2739

References _L, Slic3r::ConfigBase::apply_only(), cache_config_diff(), Slic3r::Preset::config, Slic3r::PresetCollection::get_edited_preset(), Slic3r::GUI::UnsavedChangesDialog::get_preset_name(), Slic3r::GUI::UnsavedChangesDialog::get_save_to_project_option(), Slic3r::GUI::UnsavedChangesDialog::get_selected_options(), Slic3r::PresetCollection::get_selected_preset(), Slic3r::GUI::UnsavedChangesDialog::get_unselected_options(), m_preset_bundle, m_presets, m_type, may_discard_current_dirty_preset(), name(), Slic3r::GUI::plater(), save_preset(), Slic3r::GUI::UnsavedChangesDialog::save_preset(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::UnsavedChangesDialog::ShowModal(), Slic3r::GUI::UnsavedChangesDialog::transfer_changes(), Slic3r::PresetCollection::type(), Slic3r::Preset::TYPE_FILAMENT, and Slic3r::Preset::TYPE_PRINTER.

Referenced by may_discard_current_dirty_preset(), and select_preset().

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

◆ msw_rescale()

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

Reimplemented from Slic3r::GUI::Tab.

1393{
1395
1397 m_reset_to_filament_color->msw_rescale();
1398
1399 //BBS: GUI refactor
1400 //Layout();
1401 m_parent->Layout();
1402}
virtual void msw_rescale()
Definition Tab.cpp:1824

References Slic3r::GUI::Tab::m_parent, m_reset_to_filament_color, Slic3r::GUI::Tab::msw_rescale(), and msw_rescale().

Referenced by msw_rescale().

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

◆ name()

std::string Slic3r::GUI::Tab::name ( ) const
inlineinherited
349{ return m_presets->name(); }

References m_presets.

Referenced by may_discard_current_dirty_preset(), OnTreeSelChange(), save_preset(), and update_preset_description_line().

Here is the caller graph for this function:

◆ on_gcode_flavor_changed()

void Slic3r::GUI::TabPrinter::on_gcode_flavor_changed ( )
6642{
6643 auto* flavor_option = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor");
6644 if (!flavor_option)
6645 return;
6646 update_input_shaper_menu(flavor_option->value);
6647}
void update_input_shaper_menu(GCodeFlavor flavor)
Definition Tab.cpp:6579

References Slic3r::GUI::Tab::m_config, on_gcode_flavor_changed(), and update_input_shaper_menu().

Referenced by on_gcode_flavor_changed().

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

◆ on_preset_loaded()

void Slic3r::GUI::TabPrinter::on_preset_loaded ( )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

6371{
6372 // R8: reset the belt-tilt transition tracking to reflect the freshly loaded preset WITHOUT
6373 // running update_fff()'s reset logic. on_preset_loaded() is called from Tab::load_current_preset()
6374 // on every printer preset load, right before update()->update_fff(). Seeding m_was_belt_printer
6375 // from the loaded preset's belt_printer flag means a preset switch (belt preset -> non-belt preset)
6376 // enters update_fff() with m_was_belt_printer==false, so the belt->off clear branch is skipped and
6377 // the newly loaded preset's manual tilt is preserved. An in-place belt toggle does NOT go through
6378 // here (only through on_value_change->update), so m_was_belt_printer stays true there and the clear
6379 // still fires. Seed m_belt_synced_tilt from the loaded tilt as a safeguard.
6380 m_was_belt_printer = m_config->opt_bool("belt_printer");
6381 m_belt_synced_tilt_x = m_config->opt_float("build_plate_tilt_x");
6382 m_belt_synced_tilt_y = m_config->opt_float("build_plate_tilt_y");
6383
6384 // Orca
6385 //update nozzle_volume_type
6386 const Preset& current_printer = m_preset_bundle->printers.get_selected_preset();
6387 const Preset* base_printer = m_preset_bundle->printers.get_preset_base(current_printer);
6388 if (!base_printer)
6389 base_printer = &current_printer;
6390 std::string base_name = base_printer->name;
6391 // update the extruders count field
6392 auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(m_config->option("nozzle_diameter"));
6393 size_t extruders_count = nozzle_diameter->values.size();
6394 // update the GUI field according to the number of nozzle diameters supplied
6395 if (m_extruders_count != extruders_count)
6396 extruders_count_changed(extruders_count);
6397
6398 m_extruder_variant_list = m_config->option<ConfigOptionStrings>("printer_extruder_variant")->values;
6399
6400 if (base_name != m_base_preset_name) {
6401 bool use_default_nozzle_volume_type = true;
6402 m_base_preset_name = base_name;
6403 std::string prev_nozzle_volume_type = wxGetApp().app_config->get_nozzle_volume_types_from_config(base_name);
6404 if (!prev_nozzle_volume_type.empty()) {
6405 ConfigOptionEnumsGeneric* nozzle_volume_type_option = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
6406 if (nozzle_volume_type_option->deserialize(prev_nozzle_volume_type)) {
6407 use_default_nozzle_volume_type = false;
6408 }
6409 }
6410 if (use_default_nozzle_volume_type) {
6411 m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type")->values = current_printer.config.option<ConfigOptionEnumsGeneric>("default_nozzle_volume_type")->values;
6412 }
6413
6414 // Changing printer model drops any Filament Track Switch context from the previous
6415 // printer; clear both device-derived flags so a switch-less printer never inherits a
6416 // stale installed/active state (re-derived by device sync when a printer is connected).
6417 if (auto* has_switcher = m_preset_bundle->project_config.opt<ConfigOptionBool>("has_filament_switcher"))
6418 has_switcher->value = false;
6419 if (auto* dynamic_map = m_preset_bundle->project_config.opt<ConfigOptionBool>("enable_filament_dynamic_map"))
6420 dynamic_map->value = false;
6421 // Orca: also clear the sidebar switcher status icon on printer-model change (mirrors BBS's
6422 // reset_fila_switch on machine change); it re-derives from device sync once a printer connects.
6423 if (wxGetApp().plater())
6424 wxGetApp().plater()->sidebar().reset_fila_switch();
6425 }
6426
6427 // Purge mode selection is only meaningful for printers with multiple sub-nozzles per
6428 // extruder (prime saving) or fast-purge support; reset stale project values that the
6429 // current printer cannot honor and toggle the sidebar button accordingly.
6430 auto extruder_max_nozzle_count = current_printer.config.option<ConfigOptionIntsNullable>("extruder_max_nozzle_count");
6431 bool has_multiple_nozzle = extruder_max_nozzle_count &&
6432 std::any_of(extruder_max_nozzle_count->values.begin(), extruder_max_nozzle_count->values.end(),
6433 [](int v) { return v > 1 && v != ConfigOptionIntsNullable::nil_value(); });
6434 auto support_fast_purge_opt = current_printer.config.option<ConfigOptionBool>("support_fast_purge_mode");
6435 bool support_fast_purge = support_fast_purge_opt ? support_fast_purge_opt->value : false;
6436 bool show_purge_mode = has_multiple_nozzle || support_fast_purge;
6437 if (auto *prime_volume_mode = m_preset_bundle->project_config.option<ConfigOptionEnum<PrimeVolumeMode>>("prime_volume_mode")) {
6438 if (!show_purge_mode)
6439 prime_volume_mode->value = PrimeVolumeMode::pvmDefault;
6440 else if (!has_multiple_nozzle && prime_volume_mode->value == PrimeVolumeMode::pvmSaving)
6441 prime_volume_mode->value = PrimeVolumeMode::pvmDefault;
6442 else if (!support_fast_purge && prime_volume_mode->value == PrimeVolumeMode::pvmFast)
6443 prime_volume_mode->value = PrimeVolumeMode::pvmDefault;
6444 }
6445 if (wxGetApp().plater())
6446 wxGetApp().plater()->sidebar().enable_purge_mode_btn(show_purge_mode);
6447
6448 // Sidebar nozzle-count badge on the extruder cards. The `extruder_nozzle_stats` key is session-only —
6449 // saved presets never carry it, so any preset switch rebuilds the edited config without it — so
6450 // re-baseline it whenever it is missing (each extruder gets extruder_max_nozzle_count nozzles of its
6451 // selected volume type), then refresh the badges. Idempotent, so run on every preset load.
6452 if (wxGetApp().plater())
6453 wxGetApp().plater()->sidebar().enable_nozzle_count_edit(has_multiple_nozzle);
6454 const auto *nozzle_stats = m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionStrings>("extruder_nozzle_stats");
6455 if (nozzle_stats == nullptr || nozzle_stats->values.empty())
6457 if (auto *nozzle_volume_type = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type"))
6458 for (size_t idx = 0; idx < nozzle_volume_type->values.size(); ++idx)
6460}
std::string m_base_preset_name
Definition Tab.hpp:743
double m_belt_synced_tilt_x
Definition Tab.hpp:727
bool m_was_belt_printer
Definition Tab.hpp:726
double m_belt_synced_tilt_y
Definition Tab.hpp:728
void seedExtruderNozzleStats(PresetBundle *preset_bundle)
Definition MultiNozzleSync.cpp:282
void updateNozzleCountDisplay(PresetBundle *preset_bundle, int extruder_id, NozzleVolumeType volume_type)
Definition MultiNozzleSync.cpp:263
ConfigOptionIntsTempl< true > ConfigOptionIntsNullable
Definition Config.hpp:1155
@ pvmFast
Definition PrintConfig.hpp:659
@ pvmDefault
Definition PrintConfig.hpp:657
@ pvmSaving
Definition PrintConfig.hpp:658
zaa_minimize_perimeter_height nozzle_volume_type((ConfigOptionStrings, extruder_ams_count))((ConfigOptionStrings
zaa_minimize_perimeter_height extruder_max_nozzle_count((ConfigOptionBool, support_fast_purge_mode))((ConfigOptionStrings

References Slic3r::Preset::config, Slic3r::ConfigOptionEnumsGenericTempl< NULLABLE >::deserialize(), Slic3r::extruder_max_nozzle_count(), extruders_count_changed(), m_base_preset_name, m_belt_synced_tilt_x, m_belt_synced_tilt_y, Slic3r::GUI::Tab::m_config, m_extruder_variant_list, m_extruders_count, Slic3r::GUI::Tab::m_preset_bundle, m_was_belt_printer, Slic3r::Preset::name, Slic3r::nozzle_diameter(), Slic3r::nozzle_volume_type(), on_preset_loaded(), Slic3r::ConfigBase::option(), Slic3r::GUI::plater(), Slic3r::pvmDefault, Slic3r::pvmFast, Slic3r::pvmSaving, Slic3r::GUI::seedExtruderNozzleStats(), Slic3r::GUI::updateNozzleCountDisplay(), and Slic3r::ConfigOptionSingle< T >::value.

Referenced by on_preset_loaded().

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

◆ on_presets_changed()

void Slic3r::GUI::Tab::on_presets_changed ( )
protectedinherited
2772{
2773 if (wxGetApp().plater() == nullptr)
2774 return;
2775
2776 // Instead of PostEvent (EVT_TAB_PRESETS_CHANGED) just call update_presets
2777 wxGetApp().plater()->sidebar().update_presets(m_type);
2778
2779 // Check if printer agent needs switching
2781 wxGetApp().switch_printer_agent();
2782
2783 // Trigger per-vendor preset update check
2784 const Preset& printer_preset = m_preset_bundle->printers.get_edited_preset();
2785 if (printer_preset.vendor) {
2786 wxGetApp().get_preset_updater()->check_vendor_update(printer_preset.vendor->id);
2787 }
2788 }
2789
2790 bool is_bbl_vendor_preset = m_preset_bundle->is_bbl_vendor();
2791 if (is_bbl_vendor_preset) {
2792 wxGetApp().plater()->get_partplate_list().set_render_option(true, true);
2793 if (m_preset_bundle->printers.get_edited_preset().has_cali_lines(wxGetApp().preset_bundle)) {
2794 wxGetApp().plater()->get_partplate_list().set_render_cali(true);
2795 } else {
2796 wxGetApp().plater()->get_partplate_list().set_render_cali(false);
2797 }
2798 } else {
2799 wxGetApp().plater()->get_partplate_list().set_render_option(false, true);
2800 wxGetApp().plater()->get_partplate_list().set_render_cali(false);
2801 }
2802
2803 // Printer selected at the Printer tab, update "compatible" marks at the print and filament selectors.
2804 for (auto t: m_dependent_tabs)
2805 {
2806 Tab* tab = wxGetApp().get_tab(t);
2807 // If the printer tells us that the print or filament/sla_material preset has been switched or invalidated,
2808 // refresh the print or filament/sla_material tab page.
2809 // But if there are options, moved from the previously selected preset, update them to edited preset
2810 tab->apply_config_from_cache();
2811 tab->load_current_preset();
2812 }
2813 // clear m_dependent_tabs after first update from select_preset()
2814 // to avoid needless preset loading from update() function
2815 m_dependent_tabs.clear();
2816
2817 wxGetApp().plater()->update_project_dirty_from_presets();
2818
2819 // ORCA also update states of plates for plates toolbar. same method exist on Plater::priv::on_select_preset()
2820 auto& plate_list = wxGetApp().plater()->get_partplate_list();
2821 for (auto plate : plate_list.get_plate_list())
2822 plate->update_slice_result_valid_state(false);
2823}
std::vector< Preset::Type > m_dependent_tabs
Definition Tab.hpp:269

References Tab(), apply_config_from_cache(), Slic3r::VendorProfile::id, load_current_preset(), m_dependent_tabs, m_preset_bundle, m_type, on_presets_changed(), Slic3r::GUI::plater(), Slic3r::Preset::TYPE_PRINTER, and Slic3r::Preset::vendor.

Referenced by Slic3r::GUI::TabPrinter::create_bed_shape_widget(), load_current_preset(), load_key_value(), on_presets_changed(), on_value_change(), save_preset(), select_preset(), update_dirty(), and update_tab_ui().

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

◆ on_roll_back_value()

void Slic3r::GUI::Tab::on_roll_back_value ( const bool to_sys = false)
inherited
1529{
1530 // BBS: restore all pages in preset
1531 // if (!m_active_page) return;
1532
1533 int os;
1534 if (to_sys) {
1535 if (!m_is_nonsys_values) return;
1536 os = osSystemValue;
1537 }
1538 else {
1539 // BBS: restore all pages in preset
1540 if (!m_presets->get_edited_preset().is_dirty) return;
1541 os = osInitValue;
1542 }
1543
1544 m_postpone_update_ui = true;
1545
1546 // BBS: restore all preset
1547 for (auto page : m_pages)
1548 for (auto group : page->m_optgroups) {
1549 if (group->title == "Capabilities") {
1550 if ((m_options_list["extruders_count"] & os) == 0)
1551 to_sys ? group->back_to_sys_value("extruders_count") : group->back_to_initial_value("extruders_count");
1552 }
1553 if (group->title == "Size and coordinates") {
1554 if ((m_options_list["printable_area"] & os) == 0) {
1555 to_sys ? group->back_to_sys_value("printable_area") : group->back_to_initial_value("printable_area");
1556 load_key_value("printable_area", true/*some value*/, true);
1557 }
1558 }
1559 if (group->title == "Profile dependencies") {
1560 if (m_type != Preset::TYPE_PRINTER && (m_options_list["compatible_printers"] & os) == 0) {
1561 to_sys ? group->back_to_sys_value("compatible_printers") : group->back_to_initial_value("compatible_printers");
1562 load_key_value("compatible_printers", true/*some value*/, true);
1563 }
1564 if ((m_type == Preset::TYPE_FILAMENT || m_type == Preset::TYPE_SLA_MATERIAL) && (m_options_list["compatible_prints"] & os) == 0) {
1565 to_sys ? group->back_to_sys_value("compatible_prints") : group->back_to_initial_value("compatible_prints");
1566 load_key_value("compatible_prints", true/*some value*/, true);
1567 }
1568 }
1569 for (const auto &kvp : group->opt_map()) {
1570 const std::string &opt_key = kvp.first;
1571 auto iter = m_options_list.find(opt_key);
1572 if (iter != m_options_list.end() && (iter->second & os) == 0)
1573 to_sys ? group->back_to_sys_value(opt_key) : group->back_to_initial_value(opt_key);
1574 }
1575 }
1576
1577 // BBS: restore all pages in preset
1578 m_presets->discard_current_changes();
1579
1580 m_postpone_update_ui = false;
1581
1582 // Orca: the restored config may have another extruder count than the tab shows.
1583 if (auto printer_tab = dynamic_cast<TabPrinter *>(this))
1584 printer_tab->sync_extruders_count();
1585
1586 // When all values are rolled, then we have to update whole tab in respect to the reverted values
1587 update();
1588 if (m_active_page)
1589 m_active_page->update_visibility(m_mode, true);
1590
1591 // BBS: restore all pages in preset, update_dirty also update combobox
1592 update_dirty();
1593
1594 if (m_compatible_printers.checkbox) {
1595 bool is_empty = m_config->option<ConfigOptionStrings>("compatible_printers")->values.empty();
1596 m_compatible_printers.checkbox->SetValue(is_empty);
1597 is_empty ? m_compatible_printers.btn->Disable() : m_compatible_printers.btn->Enable();
1598 }
1599 if (m_compatible_prints.checkbox) {
1600 bool is_empty = m_config->option<ConfigOptionStrings>("compatible_prints")->values.empty();
1601 m_compatible_prints.checkbox->SetValue(is_empty);
1602 is_empty ? m_compatible_prints.btn->Disable() : m_compatible_prints.btn->Enable();
1603 }
1604
1605 m_page_view->GetParent()->Layout();
1606}
PresetDependencies m_compatible_printers
Definition Tab.hpp:198
PresetDependencies m_compatible_prints
Definition Tab.hpp:199
bool m_postpone_update_ui
Definition Tab.hpp:277
bool m_is_nonsys_values
Definition Tab.hpp:276

References Slic3r::ConfigOptionVector< T >::empty(), load_key_value(), m_active_page, m_compatible_printers, m_compatible_prints, m_config, m_is_nonsys_values, m_mode, m_options_list, m_page_view, m_pages, m_postpone_update_ui, m_presets, m_type, on_roll_back_value(), osInitValue, osSystemValue, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, update(), and update_dirty().

Referenced by create_preset_tab(), and on_roll_back_value().

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

◆ on_value_change()

void Slic3r::GUI::TabPrinter::on_value_change ( const std::string & opt_key,
const boost::any & value )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

6984{
6985 if (wxGetApp().plater() == nullptr || m_config_manipulation.is_applying())
6986 return;
6987
6988 const int pos = opt_key.find("#");
6989 // Orca: fields of the single Extruder page keep index 0 but edit the selected extruder.
6990 const int data_idx = pos > 0 ? extruder_page_data_index(opt_key) : -1;
6991
6992 if (pos > 0) {
6993 std::string temp_str = opt_key;
6994 boost::erase_head(temp_str, pos + 1);
6995 int orig_opt_idx = static_cast<size_t>(atoi(temp_str.c_str()));
6996 int opt_idx = orig_opt_idx >= 0 ? orig_opt_idx : 0;
6997 if (data_idx >= 0)
6998 opt_idx = data_idx;
6999
7000 std::string opt_key_pure = opt_key;
7001 boost::erase_tail(opt_key_pure, opt_key_pure.size() - pos);
7002
7003 if (opt_key_pure == "retract_after_wipe" || opt_key_pure == "retract_before_wipe") {
7004 auto percent_value_clamp = [](double percent_value) { return std::clamp(percent_value, 0., 100.); };
7005 double dvalue = boost::any_cast<double>(value);
7006
7007 double retract_before_wipe = percent_value_clamp(opt_key_pure == "retract_before_wipe"
7008 ? dvalue : m_config->option<ConfigOptionPercents>("retract_before_wipe")->get_at(opt_idx));
7009
7010 double retract_after_wipe = percent_value_clamp(opt_key_pure == "retract_after_wipe"
7011 ? dvalue : m_config->option<ConfigOptionPercents>("retract_after_wipe")->get_at(opt_idx));
7012
7013 bool need_to_reload_config = false;
7014
7015 if (percent_value_clamp(dvalue) != dvalue) {
7016 change_opt_value(*m_config, opt_key_pure, percent_value_clamp(dvalue), opt_idx);
7017 need_to_reload_config = true;
7018 }
7019
7020 if (retract_after_wipe > 100. - retract_before_wipe) {
7021 change_opt_value(*m_config, "retract_after_wipe", 100. - retract_before_wipe, opt_idx);
7022 need_to_reload_config = true;
7023 }
7024
7025 if (need_to_reload_config && !m_postpone_update_ui) {
7026 update_dirty();
7027 reload_config();
7028 update_tab_ui();
7029 }
7030 }
7031 }
7032
7033 // Orca: report Extruder page changes as "key#<extruder>", as the former "Extruder N" pages did,
7034 // so per-extruder handling in Tab::on_value_change() sees the extruder that was edited.
7035 if (data_idx >= 0)
7036 Tab::on_value_change(opt_key.substr(0, pos) + "#" + std::to_string(get_current_active_extruder()), value);
7037 else
7038 Tab::on_value_change(opt_key, value);
7039}
const double & get_at(size_t i) const
Definition Config.hpp:676
int extruder_page_data_index(const std::string &field_id) const
Definition Tab.cpp:9022
ConfigManipulation m_config_manipulation
Definition Tab.hpp:562
ConfigOptionPercentsTempl< false > ConfigOptionPercents
Definition Config.hpp:1334
zaa_minimize_perimeter_height retract_after_wipe((ConfigOptionFloats, retraction_length))((ConfigOptionFloats

References Slic3r::GUI::change_opt_value(), extruder_page_data_index(), Slic3r::GUI::Tab::get_current_active_extruder(), Slic3r::GUI::Tab::m_config, Slic3r::GUI::Tab::m_config_manipulation, Slic3r::GUI::Tab::m_postpone_update_ui, Slic3r::GUI::Tab::on_value_change(), on_value_change(), Slic3r::GUI::plater(), reload_config(), Slic3r::retract_after_wipe(), Slic3r::GUI::Tab::update_dirty(), and Slic3r::GUI::Tab::update_tab_ui().

Referenced by build_fff(), build_unregular_pages(), extruders_count_changed(), on_value_change(), set_extruder_volume_type(), and update_pages().

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

◆ OnActivate()

void Slic3r::GUI::Tab::OnActivate ( )
virtualinherited
844{
845 //BBS: GUI refactor
846 //noUpdates seems not working
847 //wxWindowUpdateLocker noUpdates(this);
848/*#ifdef __WXOSX__
849// wxWindowUpdateLocker noUpdates(this);
850 auto size = GetSizer()->GetSize();
851 m_tmp_panel->GetSizer()->SetMinSize(size.x + m_size_move, size.y);
852 Fit();
853 m_size_move *= -1;
854#endif // __WXOSX__*/
855
856#ifdef __WXMSW__
857 // Workaround for tooltips over Tree Controls displayed over excessively long
858 // tree control items, stealing the window focus.
859 //
860 // In case the Tab was reparented from the MainFrame to the floating dialog,
861 // the tooltip created by the Tree Control before reparenting is not reparented,
862 // but it still points to the MainFrame. If the tooltip pops up, the MainFrame
863 // is incorrectly focussed, stealing focus from the floating dialog.
864 //
865 // The workaround is to delete the tooltip control.
866 // Vojtech tried to reparent the tooltip control, but it did not work,
867 // and if the Tab was later reparented back to MainFrame, the tooltip was displayed
868 // at an incorrect position, therefore it is safer to just discard the tooltip control
869 // altogether.
870 HWND hwnd_tt = TreeView_GetToolTips(m_tabctrl->GetHandle());
871 if (hwnd_tt) {
872 HWND hwnd_toplevel = find_toplevel_parent(m_tabctrl)->GetHandle();
873 HWND hwnd_parent = ::GetParent(hwnd_tt);
874 if (hwnd_parent != hwnd_toplevel) {
875 ::DestroyWindow(hwnd_tt);
876 TreeView_SetToolTips(m_tabctrl->GetHandle(), nullptr);
877 }
878 }
879#endif
880
881 // The OnActivate() that shows the tab builds the page.
882 if (wxGetApp().mainframe != nullptr && !wxGetApp().mainframe->is_active_and_shown_tab(m_parent))
883 return;
884
885 // BBS: select on first active
886 if (!m_active_page)
888
889 //BBS: GUI refactor
890 m_page_view->Freeze();
891
892 // create controls on active page
894 //BBS: GUI refactor
895 //m_main_sizer->Layout();
896 m_parent->Layout();
897
898#ifdef _MSW_DARK_MODE
899 // Because of DarkMode we use our own Notebook (inherited from wxSiplebook) instead of wxNotebook
900 // And it looks like first Layout of the page doesn't update a size of the m_presets_choice
901 // So we have to set correct size explicitely
902 /* if (wxSize ok_sz = wxSize(35 * m_em_unit, m_presets_choice->GetBestSize().y);
903 ok_sz != m_presets_choice->GetSize()) {
904 m_presets_choice->SetMinSize(ok_sz);
905 m_presets_choice->SetSize(ok_sz);
906 GetSizer()->GetItem(size_t(0))->GetSizer()->Layout();
907 if (wxGetApp().tabs_as_menu())
908 m_presets_choice->update();
909 }*/
910#endif // _MSW_DARK_MODE
911 Refresh();
912
913 //BBS: GUI refactor
914 m_page_view->Thaw();
915}
wxTopLevelWindow * find_toplevel_parent(wxWindow *window)
Definition GUI_Utils.cpp:155

References activate_selected_page(), Slic3r::GUI::find_toplevel_parent(), m_active_page, m_page_view, m_parent, m_tabctrl, and restore_last_select_item().

Referenced by Slic3r::GUI::ParamsPanel::OnActivate(), Slic3r::GUI::MainFrame::select_tab(), Slic3r::GUI::PlaterPresetComboBox::switch_to_tab(), and tree_sel_change_delayed().

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

◆ OnKeyDown()

void Slic3r::GUI::Tab::OnKeyDown ( wxKeyEvent & event)
inherited
8077{
8078 if (event.GetKeyCode() == WXK_TAB)
8079 m_tabctrl->Navigate(event.ShiftDown() ? wxNavigationKeyEvent::IsBackward : wxNavigationKeyEvent::IsForward);
8080 else
8081 event.Skip();
8082}

References m_tabctrl, and OnKeyDown().

Referenced by create_preset_tab(), and OnKeyDown().

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

◆ OnTreeSelChange()

void Slic3r::GUI::Tab::OnTreeSelChange ( wxCommandEvent & event)
inherited

References name().

Here is the call graph for this function:

◆ options_list_storage_key()

std::string Slic3r::GUI::Tab::options_list_storage_key ( const std::string & opt_key) const
inherited
1161{
1162 if (opt_key == "printable_area" || opt_key == "bed_exclude_area" || opt_key == "compatible_prints" ||
1163 opt_key == "compatible_printers" || opt_key == "thumbnails" || opt_key == "wrapping_exclude_area")
1164 return opt_key;
1165
1166 if (m_config == nullptr || !m_config->has(opt_key))
1167 return opt_key;
1168
1169 const ConfigOption* option = m_config->option(opt_key);
1170 if (option == nullptr || !option->is_vector())
1171 return opt_key;
1172
1173 const ConfigOptionDef* def = m_config->def()->get(opt_key);
1174 if (def == nullptr)
1175 return opt_key;
1176
1177 const bool serialized = def->gui_flags == "serialized";
1178 const bool is_plugin_field = def->gui_type == ConfigOptionDef::GUIType::plugin_picker;
1179 return (serialized || is_plugin_field) ? opt_key : opt_key + "#0";
1180}
@ plugin_picker
Definition Config.hpp:2334

References Slic3r::ConfigOptionDef::gui_flags, Slic3r::ConfigOptionDef::gui_type, Slic3r::ConfigOption::is_vector(), m_config, and Slic3r::ConfigOptionDef::plugin_picker.

Referenced by init_options_list().

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

◆ page_build_pending()

bool Slic3r::GUI::Tab::page_build_pending ( ) const
inherited
7857{
7858 return m_active_page != nullptr && (m_active_page->build_pending() || m_active_page->visibility_pending());
7859}

References m_active_page, and page_build_pending().

Referenced by Slic3r::GUI::ParamsPanel::SettingsPagePrebuild::built(), page_build_pending(), and page_build_step().

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

◆ page_build_step()

bool Slic3r::GUI::Tab::page_build_step ( )
inherited
7862{
7863 if (m_active_page == nullptr)
7864 return false;
7865 if (m_active_page->build_pending())
7866 m_active_page->build_step(m_mode);
7867 else
7868 m_active_page->update_visibility(m_mode, true);
7869 return page_build_pending();
7870}
bool page_build_pending() const
Definition Tab.cpp:7856

References m_active_page, m_mode, page_build_pending(), and page_build_step().

Referenced by Slic3r::GUI::ParamsPanel::SettingsPagePrebuild::build_step(), and page_build_step().

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

◆ parent()

◆ parse_extruder_selection()

void Slic3r::GUI::Tab::parse_extruder_selection ( int selection,
int & extruder_id,
NozzleVolumeType & nozzle_type )
inherited
683{
684 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
685 int extruder_nums = m_preset_bundle->get_printer_extruder_count();
686
687 int current_index = 0;
688
689 for (int i = 0; i < extruder_nums; ++i) {
690 NozzleVolumeType volume_type = NozzleVolumeType(nozzle_volumes->values[i]);
691
692 if (volume_type == NozzleVolumeType::nvtHybrid) {
693 if (selection == current_index) {
694 extruder_id = i;
696 return;
697 } else if (selection == current_index + 1) {
698 extruder_id = i;
700 return;
701 }
702 current_index += 2;
703 } else {
704 if (selection == current_index) {
705 extruder_id = i;
706 nozzle_type = volume_type;
707 return;
708 }
709 current_index += 1;
710 }
711 }
712
713 extruder_id = 0;
715}

References m_preset_bundle, Slic3r::nozzle_type(), Slic3r::nvtHighFlow, Slic3r::nvtHybrid, and Slic3r::nvtStandard.

Referenced by check_extruder_options_status(), create_preset_tab(), and get_current_active_extruder().

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

◆ reactive_preset_combo_box()

void Slic3r::GUI::Tab::reactive_preset_combo_box ( )
inherited
7125{
7126 if (!m_presets_choice) return;
7127 //BBS: add workaround to fix the issue caused by wxwidget 3.15 upgrading
7128 m_presets_choice->Enable(false);
7129 m_presets_choice->Enable(true);
7130}

References m_presets_choice, and reactive_preset_combo_box().

Referenced by reactive_preset_combo_box().

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

◆ rebuild_page_tree()

void Slic3r::GUI::Tab::rebuild_page_tree ( )
inherited
7302{
7303 // get label of the currently selected item
7304 auto sel_item = m_tabctrl->GetSelection();
7305 // BBS: fix new layout, record last select
7306 if (sel_item < 0)
7307 sel_item = m_last_select_item;
7308 const auto selected = sel_item >= 0 ? m_tabctrl->GetItemText(sel_item) : "";
7309
7310 int item = -1;
7311
7312 // Delete/Append events invoke wxEVT_TAB_SEL_CHANGED event.
7313 // To avoid redundant clear/activate functions call
7314 // suppress activate page before page_tree rebuilding
7316
7317 int curr_item = 0;
7318 for (auto p : m_pages)
7319 {
7320 if (!p->get_show())
7321 continue;
7322 if (m_tabctrl->GetCount() <= curr_item) {
7323 m_tabctrl->AppendItem(translate_category(p->title(), m_type), p->iconID());
7324 } else {
7325 m_tabctrl->SetItemText(curr_item, translate_category(p->title(), m_type));
7326 }
7327 m_tabctrl->SetItemTextColour(curr_item, p->get_item_colour() == m_modified_label_clr ? p->get_item_colour() : StateColor(
7328 std::make_pair(0x6B6B6C, (int) StateColor::NotChecked),
7329 std::make_pair(p->get_item_colour(), (int) StateColor::Normal)));
7330 if (translate_category(p->title(), m_type) == selected)
7331 item = curr_item;
7332 curr_item++;
7333 }
7334 while (m_tabctrl->GetCount() > curr_item) {
7335 m_tabctrl->DeleteItem(m_tabctrl->GetCount() - 1);
7336 }
7337
7338 // BBS: on mac, root is selected, this fix it
7339 m_tabctrl->Unselect();
7340 // BBS: not select on hide tab
7341 if (item == -1 && m_parent->is_active_and_shown_tab(this)) {
7342 // this is triggered on first load, so we don't disable the sel change event
7343 item = m_tabctrl->GetFirstVisibleItem();
7344 }
7345 // BBS: fix new layout, record last select
7346 if (sel_item == m_last_select_item)
7347 m_last_select_item = item;
7348 else
7350
7351 // allow activate page before selection of a page_tree item
7353 //BBS: GUI refactor
7354 if (item >= 0)
7355 {
7356 bool ret = update_current_page_in_background(item);
7357 //if m_active_page is changed in update_current_page_in_background
7358 //will just update the selected item of the treectrl
7359 if (m_parent->is_active_and_shown_tab(this)) // FIX: modify state not update
7360 m_tabctrl->SelectItem(item);
7361 }
7362}
bool update_current_page_in_background(int &item)
Definition Tab.cpp:7900
int m_last_select_item
Definition Tab.hpp:267
@ NotChecked
Definition StateColor.hpp:23

References m_disable_tree_sel_changed_event, m_last_select_item, m_modified_label_clr, m_pages, m_parent, m_tabctrl, m_type, StateColor::Normal, StateColor::NotChecked, rebuild_page_tree(), translate_category(), and update_current_page_in_background().

Referenced by Slic3r::GUI::TabPrinter::build_unregular_pages(), create_preset_tab(), rebuild_page_tree(), Slic3r::GUI::TabPrinter::update_pages(), and update_visibility().

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

◆ refresh_printer_agent_dropdown()

void Slic3r::GUI::TabPrinter::refresh_printer_agent_dropdown ( ) const
8673{
8674 auto* choice = dynamic_cast<PrinterAgentChoice*>(get_field("printer_agent"));
8675 if (!choice || !choice->getWindow())
8676 return;
8677
8679 if (agents.empty())
8680 return;
8681
8682 // why: rows live on PrinterAgentChoice now; rebuild them from the live registry and re-select the stored id.
8683 const std::string selected_agent = wxGetApp().preset_bundle->printers.get_edited_preset()
8684 .config.opt_string("printer_agent");
8685 choice->reload_rows();
8686 choice->set_value(selected_agent, false);
8687 this->GetParent()->Layout();
8688}

References Slic3r::GUI::Tab::get_field(), Slic3r::NetworkAgentFactory::get_registered_printer_agents(), and refresh_printer_agent_dropdown().

Referenced by refresh_printer_agent_dropdown().

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

◆ reload_config()

void Slic3r::GUI::TabPrinter::reload_config ( )
overridevirtual

Reimplemented from Slic3r::GUI::Tab.

6501{
6503
6504 // "extruders_count" doesn't update from the update_config(),
6505 // so update it implicitly
6506 if (m_active_page && m_active_page->title() == "Multimaterial")
6507 m_active_page->set_value("extruders_count", int(m_extruders_count));
6508
6509 if (m_config) {
6510 // imex_tool_layout / imex_viz_theme are now real enum options handled by
6511 // standard Choice fields; only the modes grid still needs explicit re-sync
6512 // because it spans three options at once and isn't a Field.
6513 if (m_imex_modes_ctrl) {
6514 int n_cols = 0, n_rows = 0, layout = 0;
6515 imex_grid_shape(m_config, n_cols, n_rows, layout);
6516 m_imex_modes_ctrl->set_grid_size(n_cols, n_rows, layout);
6517 m_imex_modes_ctrl->load_from_config(*m_config);
6518 }
6519 }
6520}

References Slic3r::GUI::imex_grid_shape(), Slic3r::GUI::Tab::m_active_page, Slic3r::GUI::Tab::m_config, m_extruders_count, m_imex_modes_ctrl, Slic3r::GUI::Tab::reload_config(), and reload_config().

Referenced by build_unregular_pages(), on_value_change(), and reload_config().

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

◆ restore_last_select_item()

void Slic3r::GUI::Tab::restore_last_select_item ( )
inherited
7849{
7850 auto item = m_last_select_item;
7851 if (item == -1)
7852 item = m_tabctrl->GetFirstVisibleItem();
7853 m_tabctrl->SelectItem(item);
7854}

References m_last_select_item, m_tabctrl, and restore_last_select_item().

Referenced by create_preset_tab(), Slic3r::GUI::Plater::priv::on_modify_filament(), OnActivate(), restore_last_select_item(), Slic3r::GUI::ParamsPanel::set_active_tab(), and Slic3r::GUI::PlaterPresetComboBox::switch_to_tab().

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

◆ save_preset()

void Slic3r::GUI::Tab::save_preset ( std::string name = std::string(),
bool detach = false,
bool save_to_project = false,
bool from_input = false,
std::string input_name = "" )
inherited

m_tabctrl->OnSetFocus();

8122{
8123 // ORCA: Validate before opening any save-name UI for filament presets.
8125 return;
8126
8127 // since buttons(and choices too) don't get focus on Mac, we set focus manually
8128 // to the treectrl so that the EVT_* events are fired for the input field having
8129 // focus currently.is there anything better than this ?
8131 if (from_input) {
8132 SavePresetDialog dlg(m_parent, m_type, m_mode, detach ? _u8L("Detached") : "");
8133 dlg.Show(false);
8134 dlg.input_name_from_other(input_name);
8135 wxCommandEvent evt(wxEVT_TEXT, GetId());
8136 dlg.GetEventHandler()->ProcessEvent(evt);
8137 dlg.confirm_from_other();
8138 name = input_name;
8139 detach = dlg.get_detach_value(m_type);
8140 }
8141
8142 if (name.empty()) {
8143 SavePresetDialog dlg(m_parent, m_type, m_mode, detach ? _u8L("Detached") : "");
8144 if (!m_just_edit) {
8145 if (dlg.ShowModal() != wxID_OK)
8146 return;
8147 }
8148 name = dlg.get_name();
8149 //BBS: add project embedded preset relate logic
8150 save_to_project = dlg.get_save_to_project_selection(m_type);
8151 detach = dlg.get_detach_value(m_type);
8152 }
8153
8154 //BBS record current preset name
8155 Preset& edited_preset = m_presets->get_edited_preset();
8156 std::string curr_preset_name = edited_preset.name;
8157
8158 bool exist_preset = false;
8159 Preset* new_preset = m_presets->find_preset(name, false);
8160 if (new_preset) {
8161 exist_preset = true;
8162 }
8163
8164 // Orca: check if compatible_printers exists and is not empty, set it to the current printer if it is empty
8165 // Ensures that custom filaments based on system are not accidentally allowed for all printers
8166 // Can still be set for all after creation
8167 if (m_presets->type() == Preset::TYPE_FILAMENT && !exist_preset && edited_preset.is_system) {
8168 Preset* _curr_printer = const_cast<Preset*>(&wxGetApp().preset_bundle->printers.get_selected_preset_base());
8169 ConfigOptionStrings* compatible_printers = m_config->option<ConfigOptionStrings>("compatible_printers");
8170 if (nullptr != _curr_printer && compatible_printers && compatible_printers->values.empty())
8171 compatible_printers->values.push_back(_curr_printer->name);
8172 }
8173 // Save the preset into Slic3r::data_dir / presets / section_name / preset_name.json
8174 m_presets->save_current_preset(name, detach, save_to_project, nullptr);
8175
8176 //BBS create new settings
8177 new_preset = m_presets->find_preset(name, false, true);
8178 //Preset* preset = &m_presets.preset(it - m_presets.begin(), true);
8179 if (!new_preset) {
8180 BOOST_LOG_TRIVIAL(info) << "create new preset failed";
8181 return;
8182 }
8183
8184 // set sync_info for sync service
8185 if (exist_preset) {
8186 new_preset->sync_info = "update";
8187 BOOST_LOG_TRIVIAL(info) << "sync_preset: update preset = " << new_preset->name;
8188 }
8189 else {
8190 new_preset->sync_info = "create";
8191 if (wxGetApp().is_user_login())
8192 new_preset->user_id = wxGetApp().getAgent()->get_user_id();
8193 BOOST_LOG_TRIVIAL(info) << "sync_preset: create preset = " << new_preset->name;
8194 }
8195 new_preset->save_info();
8196
8197 // Mark the print & filament enabled if they are compatible with the currently selected preset.
8198 // If saving the preset changes compatibility with other presets, keep the now incompatible dependent presets selected, however with a "red flag" icon showing that they are no more compatible.
8200 // Add the new item into the UI component, remove dirty flags and activate the saved item.
8201 update_tab_ui();
8202
8203 // Update the selection boxes at the plater.
8205
8206 //BBS if create a new prset name, preset changed from preset name to new preset name
8207 if (!exist_preset) {
8208 wxGetApp().plater()->sidebar().update_presets_from_to(m_type, curr_preset_name, new_preset->name);
8209 }
8210
8211 // If current profile is saved, "delete preset" button have to be enabled
8212 m_btn_delete_preset->Show();
8213 m_btn_delete_preset->GetParent()->Layout();
8214
8216 static_cast<TabPrinter*>(this)->m_initial_extruders_count = static_cast<TabPrinter*>(this)->m_extruders_count;
8217
8218 // Parent preset is "default" after detaching, so we should to update UI values, related on parent preset
8219 if (detach)
8220 update_ui_items_related_on_parent_preset(m_presets->get_selected_preset_parent());
8221
8223
8224 /* If filament preset is saved for multi-material printer preset,
8225 * there are cases when filament comboboxs are updated for old (non-modified) colors,
8226 * but in full_config a filament_colors option aren't.*/
8227 if (m_type == Preset::TYPE_FILAMENT && wxGetApp().extruders_edited_cnt() > 1)
8228 wxGetApp().plater()->force_filament_colors_update();
8229
8230 {
8231 // Profile compatiblity is updated first when the profile is saved.
8232 // Update profile selection combo boxes at the depending tabs to reflect modifications in profile compatibility.
8233 std::vector<Preset::Type> dependent;
8234 switch (m_type) {
8235 case Preset::TYPE_PRINT:
8236 dependent = { Preset::TYPE_FILAMENT };
8237 break;
8239 dependent = { Preset::TYPE_SLA_MATERIAL };
8240 break;
8242 if (static_cast<const TabPrinter*>(this)->m_printer_technology == ptFFF)
8244 else
8246 break;
8247 default:
8248 break;
8249 }
8250 for (Preset::Type preset_type : dependent)
8251 wxGetApp().get_tab(preset_type)->update_tab_ui();
8252 }
8253
8254 // show() reloads the presets, so only a visible Compare dialog needs updating.
8255 DiffPresetDialog* diff_dialog = DiffPresetDialog::if_built();
8256 if (diff_dialog != nullptr && diff_dialog->IsShown())
8257 diff_dialog->update_presets(m_type);
8258}
static DiffPresetDialog * if_built()
Definition Lazy.hpp:183
bool m_just_edit
Definition Tab.hpp:208
bool validate_filament_temperature_pairs()
Definition Tab.cpp:8722

References _u8L, Slic3r::GUI::SavePresetDialog::confirm_from_other(), Slic3r::GUI::SavePresetDialog::get_detach_value(), Slic3r::GUI::SavePresetDialog::get_name(), Slic3r::GUI::SavePresetDialog::get_save_to_project_selection(), Slic3r::GUI::LazyInstance< DiffPresetDialog >::if_built(), Slic3r::GUI::SavePresetDialog::input_name_from_other(), Slic3r::Preset::is_system, m_btn_delete_preset, m_config, Slic3r::GUI::TabPrinter::m_extruders_count, m_just_edit, m_mode, m_parent, m_preset_bundle, m_presets, m_type, name(), Slic3r::Preset::name, Slic3r::Never, on_presets_changed(), Slic3r::ptFFF, Slic3r::Preset::save_info(), save_preset(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::Preset::sync_info, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, Slic3r::Preset::TYPE_SLA_PRINT, update_changed_ui(), Slic3r::GUI::DiffPresetDialog::update_presets(), update_tab_ui(), update_ui_items_related_on_parent_preset(), Slic3r::Preset::user_id, validate_filament_temperature_pairs(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by build_preset_description_line(), create_preset_tab(), may_discard_current_dirty_preset(), and save_preset().

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

◆ saved_preset_is_dirty()

bool Slic3r::GUI::Tab::saved_preset_is_dirty ( ) const
inherited
5387{ return m_presets->saved_is_dirty(); }

References m_presets, and saved_preset_is_dirty().

Referenced by saved_preset_is_dirty().

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

◆ select_preset()

bool Slic3r::GUI::Tab::select_preset ( std::string preset_name = "",
bool delete_current = false,
const std::string & last_selected_ph_printer_name = "",
bool force_select = false,
bool force_no_transfer = false )
inherited
7389{
7390 BOOST_LOG_TRIVIAL(info) << boost::format("select preset, name %1%, delete_current %2%")
7391 %preset_name %delete_current;
7392 if (preset_name.empty()) {
7393 if (delete_current) {
7394 // Find an alternate preset to be selected after the current preset is deleted.
7395 const std::deque<Preset> &presets = m_presets->get_presets();
7396 size_t idx_current = m_presets->get_idx_selected();
7397 // Find the next visible preset.
7398 preset_name = presets[idx_current].inherits();
7399 if (preset_name.empty()) {
7400 size_t idx_new = idx_current + 1;
7401 if (idx_new < presets.size())
7402 for (; idx_new < presets.size() && ! presets[idx_new].is_visible; ++ idx_new) ;
7403 if (idx_new == presets.size())
7404 for (idx_new = idx_current - 1; idx_new > 0 && ! presets[idx_new].is_visible; -- idx_new);
7405 preset_name = presets[idx_new].name;
7406 BOOST_LOG_TRIVIAL(info) << boost::format("cause by delete current ,choose the next visible, idx %1%, name %2%")
7407 %idx_new %preset_name;
7408 } else {
7409 BOOST_LOG_TRIVIAL(info) << boost::format("cause by delete current ,choose base, name %1%") % preset_name;
7410 }
7411 } else {
7412 //BBS select first visible item first
7413 const std::deque<Preset> &presets = this->m_presets->get_presets();
7414 size_t idx_new = 0;
7415 if (idx_new < presets.size())
7416 for (; idx_new < presets.size() && ! presets[idx_new].is_visible; ++ idx_new) ;
7417 preset_name = presets[idx_new].name;
7418 if (idx_new == presets.size()) {
7419 // If no name is provided, select the "-- default --" preset.
7420 preset_name = m_presets->default_preset().name;
7421 }
7422 BOOST_LOG_TRIVIAL(info) << boost::format("not cause by delete current ,choose the first visible, idx %1%, name %2%")
7423 %idx_new %preset_name;
7424 }
7425 }
7426 //BBS: add project embedded preset logic and refine is_external
7427 assert(! delete_current || (m_presets->get_edited_preset().name != preset_name && (m_presets->get_edited_preset().is_user() || m_presets->get_edited_preset().is_project_embedded)));
7428 //assert(! delete_current || (m_presets->get_edited_preset().name != preset_name && m_presets->get_edited_preset().is_user()));
7429 bool current_dirty = ! delete_current && m_presets->current_is_dirty();
7430 bool print_tab = m_presets->type() == Preset::TYPE_PRINT || m_presets->type() == Preset::TYPE_SLA_PRINT;
7431 bool printer_tab = m_presets->type() == Preset::TYPE_PRINTER;
7432 bool canceled = false;
7433 bool no_transfer = false;
7434 bool technology_changed = false;
7435 m_dependent_tabs.clear();
7436 if ((m_presets->type() == Preset::TYPE_FILAMENT) && !preset_name.empty())
7437 {
7438 Preset *to_be_selected = m_presets->find_preset(preset_name, false, true);
7439 if (to_be_selected) {
7440 std::string current_type, to_select_type;
7441 ConfigOptionStrings* cur_opt = dynamic_cast <ConfigOptionStrings *>(m_presets->get_edited_preset().config.option("filament_type"));
7442 ConfigOptionStrings* to_select_opt = dynamic_cast <ConfigOptionStrings *>(to_be_selected->config.option("filament_type"));
7443 if (cur_opt && (cur_opt->values.size() > 0)) {
7444 current_type = cur_opt->values[0];
7445 }
7446 if (to_select_opt && (to_select_opt->values.size() > 0)) {
7447 to_select_type = to_select_opt->values[0];
7448 }
7449 if (current_type != to_select_type)
7450 no_transfer = true;
7451 }
7452 }
7453 else if (printer_tab)
7454 no_transfer = true;
7455
7456 if (force_no_transfer) {
7457 no_transfer = true;
7458 }
7459 if (current_dirty && ! may_discard_current_dirty_preset(nullptr, preset_name, no_transfer) && !force_select) {
7460 canceled = true;
7461 BOOST_LOG_TRIVIAL(info) << boost::format("current dirty and cancelled");
7462 } else if (print_tab) {
7463 // Before switching the print profile to a new one, verify, whether the currently active filament or SLA material
7464 // are compatible with the new print.
7465 // If it is not compatible and the current filament or SLA material are dirty, let user decide
7466 // whether to discard the changes or keep the current print selection.
7467 PresetWithVendorProfile printer_profile = m_preset_bundle->printers.get_edited_preset_with_vendor_profile();
7468 PrinterTechnology printer_technology = printer_profile.preset.printer_technology();
7469 PresetCollection &dependent = (printer_technology == ptFFF) ? m_preset_bundle->filaments : m_preset_bundle->sla_materials;
7470 bool old_preset_dirty = dependent.current_is_dirty();
7471 bool new_preset_compatible = is_compatible_with_print(dependent.get_edited_preset_with_vendor_profile(),
7472 m_presets->get_preset_with_vendor_profile(*m_presets->find_preset(preset_name, true)), printer_profile);
7473 if (! canceled)
7474 canceled = old_preset_dirty && ! may_discard_current_dirty_preset(&dependent, preset_name) && ! new_preset_compatible && !force_select;
7475 if (! canceled) {
7476 // The preset will be switched to a different, compatible preset, or the '-- default --'.
7478 if (old_preset_dirty && ! new_preset_compatible)
7479 dependent.discard_current_changes();
7480 }
7481 BOOST_LOG_TRIVIAL(info) << boost::format("select process, new_preset_compatible %1%, old_preset_dirty %2%, cancelled %3%")
7482 %new_preset_compatible %old_preset_dirty % canceled;
7483 } else if (printer_tab) {
7484 // Before switching the printer to a new one, verify, whether the currently active print and filament
7485 // are compatible with the new printer.
7486 // If they are not compatible and the current print or filament are dirty, let user decide
7487 // whether to discard the changes or keep the current printer selection.
7488 //
7489 // With the introduction of the SLA printer types, we need to support switching between
7490 // the FFF and SLA printers.
7491 const Preset &new_printer_preset = *m_presets->find_preset(preset_name, true);
7492 const PresetWithVendorProfile new_printer_preset_with_vendor_profile = m_presets->get_preset_with_vendor_profile(new_printer_preset);
7493 PrinterTechnology old_printer_technology = m_presets->get_edited_preset().printer_technology();
7494 PrinterTechnology new_printer_technology = new_printer_preset.printer_technology();
7495 if (new_printer_technology == ptSLA && old_printer_technology == ptFFF && !wxGetApp().may_switch_to_SLA_preset(_omitL("New printer preset selected")))
7496 canceled = true;
7497 else {
7498 struct PresetUpdate {
7499 Preset::Type tab_type;
7500 PresetCollection *presets;
7501 PrinterTechnology technology;
7502 bool old_preset_dirty;
7503 bool new_preset_compatible;
7504 };
7505 std::vector<PresetUpdate> updates = {
7507 //{ Preset::Type::TYPE_SLA_PRINT, &m_preset_bundle->sla_prints, ptSLA },
7509 //{ Preset::Type::TYPE_SLA_MATERIAL, &m_preset_bundle->sla_materials,ptSLA }
7510 };
7511 Preset *to_be_selected = m_presets->find_preset(preset_name, false, true);
7512 ConfigOptionStrings* cur_opt2 = dynamic_cast <ConfigOptionStrings *>(m_presets->get_edited_preset().config.option("printer_extruder_variant"));
7513 ConfigOptionStrings* to_select_opt2 = dynamic_cast <ConfigOptionStrings *>(to_be_selected->config.option("printer_extruder_variant"));
7514 bool no_transfer_variant = cur_opt2->values != to_select_opt2->values;
7515 for (PresetUpdate &pu : updates) {
7516 pu.old_preset_dirty = (old_printer_technology == pu.technology) && pu.presets->current_is_dirty();
7517 pu.new_preset_compatible = (new_printer_technology == pu.technology) && is_compatible_with_printer(pu.presets->get_edited_preset_with_vendor_profile(), new_printer_preset_with_vendor_profile);
7518 if (!canceled)
7519 canceled = pu.old_preset_dirty && !may_discard_current_dirty_preset(pu.presets, preset_name, false, no_transfer_variant) && !pu.new_preset_compatible && !force_select;
7520 }
7521 if (!canceled) {
7522 for (PresetUpdate &pu : updates) {
7523 // The preset will be switched to a different, compatible preset, or the '-- default --'.
7524 if (pu.technology == new_printer_technology)
7525 m_dependent_tabs.emplace_back(pu.tab_type);
7526 if (pu.old_preset_dirty && !pu.new_preset_compatible)
7527 pu.presets->discard_current_changes();
7528 }
7529 }
7530 }
7531 if (! canceled)
7532 technology_changed = old_printer_technology != new_printer_technology;
7533
7534 BOOST_LOG_TRIVIAL(info) << boost::format("select machine, technology_changed %1%, canceled %2%")
7535 %technology_changed % canceled;
7536 }
7537
7538 BOOST_LOG_TRIVIAL(info) << boost::format("before delete action, canceled %1%, delete_current %2%") %canceled %delete_current;
7539 bool delete_third_printer = false;
7540 std::deque<Preset> filament_presets;
7541 std::deque<Preset> process_presets;
7542 if (! canceled && delete_current) {
7543 // Delete the file and select some other reasonable preset.
7544 // It does not matter which preset will be made active as the preset will be re-selected from the preset_name variable.
7545 // The 'external' presets will only be removed from the preset list, their files will not be deleted.
7546 try {
7547 //BBS delete preset
7548 Preset &current_preset = m_presets->get_selected_preset();
7549
7550 // Obtain compatible filament and process presets for printers
7551 if (m_preset_bundle && m_presets->get_preset_base(current_preset) == &current_preset && printer_tab && !current_preset.is_system && !current_preset.is_from_bundle()) {
7552 delete_third_printer = true;
7553 for (const Preset &preset : m_preset_bundle->filaments.get_presets()) {
7554 if (preset.is_compatible && !preset.is_default) {
7555 if (preset.inherits() != "")
7556 filament_presets.push_front(preset);
7557 else
7558 filament_presets.push_back(preset);
7559 }
7560 }
7561 for (const Preset &preset : m_preset_bundle->prints.get_presets()) {
7562 if (preset.is_compatible && !preset.is_default) {
7563 if (preset.inherits() != "")
7564 process_presets.push_front(preset);
7565 else
7566 process_presets.push_back(preset);
7567 }
7568 }
7569 }
7570 if (!current_preset.setting_id.empty()) {
7571 wxGetApp().delete_preset_from_cloud(current_preset.setting_id, current_preset.file);
7572 }
7573 BOOST_LOG_TRIVIAL(info) << "delete preset = " << current_preset.name << ", setting_id = " << current_preset.setting_id;
7574 BOOST_LOG_TRIVIAL(info) << boost::format("will delete current preset...");
7575 m_presets->delete_current_preset();
7576 } catch (const std::exception & ex) {
7577 //FIXME add some error reporting!
7578 canceled = true;
7579 BOOST_LOG_TRIVIAL(info) << boost::format("found exception when delete: %1%") %ex.what();
7580 }
7581 }
7582
7583 if (canceled) {
7584 BOOST_LOG_TRIVIAL(info) << boost::format("canceled delete, update ui...");
7586 if (!last_selected_ph_printer_name.empty() &&
7587 m_presets->get_edited_preset().name == PhysicalPrinter::get_preset_name(last_selected_ph_printer_name)) {
7588 // If preset selection was canceled and previously was selected physical printer, we should select it back
7589 m_preset_bundle->physical_printers.select_printer(last_selected_ph_printer_name);
7590 }
7591 if (m_preset_bundle->physical_printers.has_selection()) {
7592 // If preset selection was canceled and physical printer was selected
7593 // we must disable selection marker for the physical printers
7594 m_preset_bundle->physical_printers.unselect_printer();
7595 }
7596 }
7597
7598 update_tab_ui();
7599
7600 // Trigger the on_presets_changed event so that we also restore the previous value in the plater selector,
7601 // if this action was initiated from the plater.
7603 } else {
7604 BOOST_LOG_TRIVIAL(info) << boost::format("successfully delete, will update compatibility");
7605 if (current_dirty)
7606 m_presets->discard_current_changes();
7607
7608 const bool is_selected = m_presets->select_preset_by_name(preset_name, false) || delete_current;
7609 assert(m_presets->get_edited_preset().name == preset_name || ! is_selected);
7610 // Mark the print & filament enabled if they are compatible with the currently selected preset.
7611 // The following method should not discard changes of current print or filament presets on change of a printer profile,
7612 // if they are compatible with the current printer.
7613 auto update_compatible_type = [delete_current](bool technology_changed, bool on_page, bool show_incompatible_presets) {
7614 return (delete_current || technology_changed) ? PresetSelectCompatibleType::Always :
7617 };
7618 if (current_dirty || delete_current || print_tab || printer_tab)
7619 m_preset_bundle->update_compatible(
7620 update_compatible_type(technology_changed, print_tab, (print_tab ? this : wxGetApp().get_tab(Preset::TYPE_PRINT))->m_show_incompatible_presets),
7621 update_compatible_type(technology_changed, false, wxGetApp().get_tab(Preset::TYPE_FILAMENT)->m_show_incompatible_presets));
7622 // Initialize the UI from the current preset.
7623 if (printer_tab)
7624 static_cast<TabPrinter*>(this)->update_pages();
7625
7626 if (! is_selected && printer_tab)
7627 {
7628 /* There is a case, when :
7629 * after Config Wizard applying we try to select previously selected preset, but
7630 * in a current configuration this one:
7631 * 1. doesn't exist now,
7632 * 2. have another printer_technology
7633 * So, it is necessary to update list of dependent tabs
7634 * to the corresponding printer_technology
7635 */
7636 const PrinterTechnology printer_technology = m_presets->get_edited_preset().printer_technology();
7641 }
7642
7643 // check if there is something in the cache to move to the new selected preset
7645
7646 // Orca: update presets for the selected printer
7647 if (m_type == Preset::TYPE_PRINTER && wxGetApp().app_config->get_bool("remember_printer_config")) {
7648 m_preset_bundle->update_selections(*wxGetApp().app_config);
7649 wxGetApp().plater()->sidebar().on_filament_count_change(m_preset_bundle->filament_presets.size());
7650 }
7652
7653 // Wait for the settings dialog to close; its edits are still provisional.
7654 if (printer_tab && is_selected) {
7655 Plater *plater = wxGetApp().plater();
7656 ParamsDialog *dialog = wxGetApp().params_dialog();
7657 if (plater && !plater->is_loading_project() &&
7658 (!dialog || !dialog->IsShown()))
7660 }
7661
7662 {
7663 Slic3r::LifecycleEventContext ctx;
7664 ctx.name = preset_name;
7666 switch (m_type) {
7667 case Preset::TYPE_PRINT: ctx.msg = "print"; break;
7668 case Preset::TYPE_SLA_PRINT: ctx.msg = "sla_print"; break;
7669 case Preset::TYPE_FILAMENT: ctx.msg = "filament"; break;
7670 case Preset::TYPE_SLA_MATERIAL: ctx.msg = "sla_material"; break;
7671 case Preset::TYPE_PRINTER: ctx.msg = "printer"; break;
7672 default: break;
7673 }
7675 }
7676
7677 if (delete_third_printer) {
7678 wxGetApp().CallAfter([filament_presets, process_presets]() {
7679 PresetBundle *preset_bundle = wxGetApp().preset_bundle;
7680 std::string old_filament_name = preset_bundle->filaments.get_edited_preset().name;
7681 std::string old_process_name = preset_bundle->prints.get_edited_preset().name;
7682
7683 for (const Preset &preset : filament_presets) {
7684 if (!preset.setting_id.empty()) {
7685 wxGetApp().delete_preset_from_cloud(preset.setting_id, preset.file);
7686 }
7687 BOOST_LOG_TRIVIAL(info) << "delete filament preset = " << preset.name << ", setting_id = " << preset.setting_id;
7688 preset_bundle->filaments.delete_preset(preset.name);
7689 }
7690
7691 for (const Preset &preset : process_presets) {
7692 if (!preset.setting_id.empty()) {
7693 wxGetApp().delete_preset_from_cloud(preset.setting_id, preset.file);
7694 }
7695 BOOST_LOG_TRIVIAL(info) << "delete print preset = " << preset.name << ", setting_id = " << preset.setting_id;
7696 preset_bundle->prints.delete_preset(preset.name);
7697 }
7698
7699 preset_bundle->update_compatible(PresetSelectCompatibleType::Always);
7700 preset_bundle->filaments.select_preset_by_name(old_filament_name, true);
7701 preset_bundle->prints.select_preset_by_name(old_process_name, true);
7702 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " old filament name is:" << old_filament_name << " old process name is: " << old_process_name;
7703
7704 });
7705 }
7706
7707 }
7708
7709 if (technology_changed)
7710 wxGetApp().mainframe->technology_changed();
7711 BOOST_LOG_TRIVIAL(info) << boost::format("select preset, exit");
7712
7713 return !canceled;
7714}
void normalize_bed_types(bool printer_setting_changed)
Definition Plater.cpp:15672
bool is_loading_project() const
Definition Plater.hpp:1074
bool may_discard_current_dirty_preset(PresetCollection *presets=nullptr, const std::string &new_printer_name="", bool no_transfer=false, bool no_transfer_variant=false)
Definition Tab.cpp:7718
void load_current_preset()
Definition Tab.cpp:7133
void apply_config_from_cache()
Definition Tab.cpp:2745
static std::string get_preset_name(std::string full_name)
Definition Preset.cpp:4707
bool is_compatible_with_printer(const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_printer, const DynamicPrintConfig *extra_config)
Definition Preset.cpp:909
std::string name
Definition LifecycleEvents.hpp:75
std::string msg
Definition LifecycleEvents.hpp:83
@ PresetSelected
Definition LifecycleEvents.hpp:47
@ Ok
Definition LifecycleEvents.hpp:68
bool is_compatible_with_print(const PresetWithVendorProfile &preset, const PresetWithVendorProfile &active_print, const PresetWithVendorProfile &active_printer)
Definition Preset.cpp:871
LifecycleEvtCode code
Definition LifecycleEvents.hpp:79
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234
@ OnlyIfWasCompatible
Definition Preset.hpp:525
@ Always
Definition Preset.hpp:527
#define _omitL(s)
Definition I18N.hpp:9

References _omitL, Slic3r::Always, apply_config_from_cache(), Slic3r::LifecycleEventContext::code, Slic3r::Preset::config, Slic3r::PresetCollection::current_is_dirty(), Slic3r::PresetCollection::delete_preset(), Slic3r::PresetCollection::discard_current_changes(), Slic3r::PresetBundle::filaments, Slic3r::Preset::file, Slic3r::fire_lifecycle_event(), Slic3r::PresetCollection::get_edited_preset(), Slic3r::PresetCollection::get_edited_preset_with_vendor_profile(), Slic3r::PhysicalPrinter::get_preset_name(), Slic3r::is_compatible_with_print(), Slic3r::is_compatible_with_printer(), Slic3r::Preset::is_from_bundle(), Slic3r::Preset::is_system, load_current_preset(), m_dependent_tabs, m_preset_bundle, m_presets, m_show_incompatible_presets, m_type, may_discard_current_dirty_preset(), Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, Slic3r::Preset::name, Slic3r::Never, Slic3r::Ok, on_presets_changed(), Slic3r::OnlyIfWasCompatible, Slic3r::ConfigBase::option(), Slic3r::GUI::plater(), Slic3r::PresetWithVendorProfile::preset, Slic3r::PresetSelected, Slic3r::GUI::printer_technology(), Slic3r::Preset::printer_technology(), Slic3r::PresetBundle::prints, Slic3r::ptFFF, Slic3r::ptSLA, select_preset(), Slic3r::PresetCollection::select_preset_by_name(), Slic3r::Preset::setting_id, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, Slic3r::Preset::TYPE_SLA_PRINT, Slic3r::PresetBundle::update_compatible(), update_tab_ui(), and Slic3r::ConfigOptionVector< T >::values.

Referenced by Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_filament_target(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::bind_preset_target(), create_preset_tab(), delete_preset(), Slic3r::GUI::Plater::priv::on_modify_filament(), select_preset(), Slic3r::GUI::PresetComboBox::selection_is_changed_according_to_physical_printers(), Slic3r::GUI::Sidebar::priv::sync_extruder_list(), and transfer_options().

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

◆ set_custom_gcode()

void Slic3r::GUI::Tab::set_custom_gcode ( const t_config_option_key & opt_key,
const std::string & value )
virtualinherited

Reimplemented in Slic3r::GUI::TabFilament.

4398{
4399 DynamicPrintConfig new_conf = *m_config;
4400 new_conf.set_key_value(opt_key, new ConfigOptionString(value));
4401 load_config(new_conf);
4402}

References Slic3r::ConfigOptionString, load_config(), m_config, and Slic3r::DynamicConfig::set_key_value().

Referenced by edit_custom_gcode().

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

◆ set_expanded()

void Slic3r::GUI::Tab::set_expanded ( bool value)
inherited
7833{
7834 if (value) {
7835 if (m_presets_choice)
7837 m_main_sizer->Show(m_tabctrl);
7838 }
7839 else {
7840 m_active_page = NULL;
7841 if (m_presets_choice)
7843 m_main_sizer->Hide(m_tabctrl);
7844 }
7845}

References m_active_page, m_main_sizer, m_presets_choice, m_tabctrl, and set_expanded().

Referenced by set_expanded().

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

◆ set_extruder_volume_type()

void Slic3r::GUI::TabPrinter::set_extruder_volume_type ( int extruder_id,
NozzleVolumeType type )
8577{
8578 // -1 means single extruder, so we should default use extruder id 0
8579 if (extruder_id == -1)
8580 extruder_id = 0;
8581 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
8582 assert(nozzle_volumes->values.size() > (size_t)extruder_id);
8583 nozzle_volumes->values[extruder_id] = type;
8584
8585 // Carry the extruder's nozzle count over to the new flow type and refresh the sidebar badge.
8588
8589 on_value_change((boost::format("nozzle_volume_type#%1%") % extruder_id).str(), int(type));
8590
8591 //save to app config
8592 if (!m_base_preset_name.empty()) {
8593 // do not save hybrid flow status to config: it depends on the nozzles currently installed
8594 // on the connected printer, so it must not be restored in a later session
8595 ConfigOptionEnumsGeneric nozzle_volume_type_option = *m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
8596 for (size_t i = 0; i < nozzle_volume_type_option.values.size(); i++) {
8597 if (nozzle_volume_type_option.values[i] == (int) nvtHybrid)
8598 nozzle_volume_type_option.values[i] = (int) nvtStandard;
8599 }
8600 std::string nozzle_volume_type_str = nozzle_volume_type_option.serialize();
8601 wxGetApp().app_config->save_nozzle_volume_types_to_config(m_base_preset_name, nozzle_volume_type_str);
8602 }
8603
8604}
std::string serialize() const override
Definition Config.hpp:2244
void onNozzleVolumeTypeSwitch(PresetBundle *preset_bundle, int extruder_id, NozzleVolumeType type)
Definition MultiNozzleSync.cpp:306

References m_base_preset_name, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::nvtHybrid, Slic3r::nvtStandard, on_value_change(), Slic3r::GUI::onNozzleVolumeTypeSwitch(), Slic3r::ConfigOptionEnumsGenericTempl< NULLABLE >::serialize(), set_extruder_volume_type(), Slic3r::GUI::Tab::type(), Slic3r::GUI::updateNozzleCountDisplay(), and Slic3r::ConfigOptionVector< int >::values.

Referenced by set_extruder_volume_type().

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

◆ set_just_edit()

void Slic3r::GUI::Tab::set_just_edit ( bool just_edit)
inherited
8817{
8818 m_just_edit = just_edit;
8819 if (just_edit) {
8820 m_presets_choice->Disable();
8821 m_btn_delete_preset->Disable();
8822 } else {
8823 m_presets_choice->Enable();
8824 m_btn_delete_preset->Enable();
8825 }
8826}

References m_btn_delete_preset, m_just_edit, m_presets_choice, and set_just_edit().

Referenced by Slic3r::GUI::Plater::priv::on_modify_filament(), Slic3r::GUI::ParamsDialog::Popup(), and set_just_edit().

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

◆ set_option_label()

void Slic3r::GUI::Tab::set_option_label ( const std::string & opt_key,
const wxString & label,
int opt_index = -1 )
inherited
1982{
1983 // Same as toggle_line: a runtime rename (brim_width -> "Brim ear radius") must reach every page
1984 // so the Speed Dial titles the setting before the page has been shown.
1985 for (const PageShp& page : m_pages) {
1986 if (!page) continue;
1987 if (Line *line = page->get_line(opt_key, opt_index))
1988 line->set_label(label);
1989 }
1990}

References m_pages, and set_option_label().

Referenced by get_config_manipulation(), and set_option_label().

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

◆ set_tooltips_text()

void Slic3r::GUI::Tab::set_tooltips_text ( )
protectedinherited
9364{
9365 // --- Tooltip text for reset buttons (for whole options group)
9366 // Text to be shown on the "Revert to system" aka "Lock to system" button next to each input field.
9367 //m_ttg_value_lock = _(L("LOCKED LOCK icon indicates that the settings are the same as the system (or default) values "
9368 // "for the current option group"));
9369 //m_ttg_value_unlock = _(L("UNLOCKED LOCK icon indicates that some settings were changed and are not equal "
9370 // "to the system (or default) values for the current option group.\n"
9371 // "Click to reset all settings for current option group to the system (or default) values."));
9372 //m_ttg_white_bullet_ns = _(L("WHITE BULLET icon indicates a non system (or non default) preset."));
9373 //m_ttg_non_system = &m_ttg_white_bullet_ns;
9374 // Text to be shown on the "Undo user changes" button next to each input field.
9375 //m_ttg_white_bullet = _(L("WHITE BULLET icon indicates that the settings are the same as in the last saved "
9376 // "preset for the current option group."));
9377 //m_ttg_value_revert = _(L("BACK ARROW icon indicates that the settings were changed and are not equal to "
9378 // "the last saved preset for the current option group.\n"
9379 // "Click to reset all settings for the current option group to the last saved preset."));
9380
9381 // --- Tooltip text for reset buttons (for each option in group)
9382 // Text to be shown on the "Revert to system" aka "Lock to system" button next to each input field.
9383 //m_tt_value_lock = _(L("LOCKED LOCK icon indicates that the value is the same as the system (or default) value."));
9384 m_tt_value_unlock = _(L("Click to reset current value and attach to the global value."));
9385 // m_tt_white_bullet_ns= _(L("WHITE BULLET icon indicates a non system preset."));
9386 //m_tt_non_system = &m_ttg_white_bullet_ns;
9387 // Text to be shown on the "Undo user changes" button next to each input field.
9388 //m_tt_white_bullet = _(L("WHITE BULLET icon indicates that the value is the same as in the last saved preset."));
9389 m_tt_value_revert = _(L("Click to drop current modifications and reset to saved value."));
9390}

References _, L, m_tt_value_revert, m_tt_value_unlock, and set_tooltips_text().

Referenced by create_preset_tab(), and set_tooltips_text().

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

◆ set_type()

void Slic3r::GUI::Tab::set_type ( )
protectedinherited
249{
251 else if (m_name == "sla_print") { m_type = Slic3r::Preset::TYPE_SLA_PRINT; }
253 else if (m_name == "sla_material") { m_type = Slic3r::Preset::TYPE_SLA_MATERIAL; }
255 else { m_type = Slic3r::Preset::TYPE_INVALID; assert(false); }
256}
#define PRESET_PRINTER_NAME
Definition Preset.hpp:35
#define PRESET_PRINT_NAME
Definition Preset.hpp:34
#define PRESET_FILAMENT_NAME
Definition Preset.hpp:33
std::string m_name
Definition Tab.hpp:162
@ TYPE_INVALID
Definition Preset.hpp:245

References m_name, m_type, PRESET_FILAMENT_NAME, PRESET_PRINT_NAME, PRESET_PRINTER_NAME, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_INVALID, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and Slic3r::Preset::TYPE_SLA_PRINT.

◆ setting_row_state()

Tab::SettingRowState Slic3r::GUI::Tab::setting_row_state ( const std::string & opt_id) const
inherited
1993{
1994 bool found = false;
1995 for (const PageShp& page : m_pages) {
1996 if (!page) continue;
1997 for (const ConfigOptionsGroupShp& group : page->m_optgroups) {
1998 if (!group) continue;
1999 for (const Line& line : group->get_lines()) {
2000 for (const Option& opt : line.get_options()) {
2001 if (opt.opt_id != opt_id)
2002 continue;
2003 if (line.toggle_visible) // shown on any owning page is enough
2004 return {true, line.label, line.label_en, line.get_options().size() > 1};
2005 found = true;
2006 }
2007 }
2008 }
2009 }
2010 // Never registered on a page -> visible, but with no row label to contribute.
2011 return {!found, wxString(), wxString(), false};
2012}

References m_pages, and setting_row_state().

Referenced by Slic3r::GUI::ActionRegistry::materialize_setting_actions(), and setting_row_state().

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

◆ show_timelapse_warning_dialog()

void Slic3r::GUI::Tab::show_timelapse_warning_dialog ( )
inherited
2633 {
2635 wxString msg_text = _(L("When recording timelapse without toolhead, it is recommended to add a \"Timelapse Wipe Tower\" \n"
2636 "by right-click the empty position of build plate and choose \"Add Primitive\"->\"Timelapse Wipe Tower\"."));
2637 msg_text += "\n";
2638 MessageDialog dialog(nullptr, msg_text, "", wxICON_WARNING | wxOK);
2639 dialog.ShowModal();
2641 }
2642}
bool m_is_timelapse_wipe_tower_already_prompted
Definition Tab.hpp:308

References _, L, m_is_timelapse_wipe_tower_already_prompted, show_timelapse_warning_dialog(), and Slic3r::GUI::DPIAware< P >::ShowModal().

Referenced by show_timelapse_warning_dialog().

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

◆ supports_printer_technology()

bool Slic3r::GUI::TabPrinter::supports_printer_technology ( const PrinterTechnology ) const
inlineoverridevirtual

Implements Slic3r::GUI::Tab.

770{ return true; }

◆ switch_excluder()

void Slic3r::GUI::Tab::switch_excluder ( int extruder_id = -1,
bool reload = true )
inherited
9178{
9179 Preset & printer_preset = m_preset_bundle->printers.get_edited_preset();
9180 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
9181 auto extruders = printer_preset.config.option<ConfigOptionEnumsGeneric>("extruder_type");
9182
9183 // Orca: the printer tab re-targets its pages to the extruder selected on the switch. Resolved before
9184 // the range check below, which keeps the extruder_type read in get_index_for_extruder in range.
9185 if (m_type == Preset::TYPE_PRINTER && extruder_id == -1)
9186 extruder_id = get_current_active_extruder();
9187 if (!m_variant_combo && (extruder_id >= (int)nozzle_volumes->size() || extruder_id >= (int)extruders->size()))
9188 extruder_id = 0;
9189 if (m_extruder_switch) {
9190 int current_extruder = get_current_active_extruder();
9191 bool sync_enable = get_extruder_sync_enable_state(current_extruder);
9193 m_extruder_sync->Show();
9195 if (extruder_id == -1)
9196 extruder_id = current_extruder;
9197 else if (extruder_id != current_extruder)
9198 return;
9199 }
9200 } else if (m_variant_combo) {
9201 int current_variant = m_variant_combo->GetSelection();
9202 if (current_variant < 0)
9203 current_variant = 0;
9204 if (extruder_id == -1)
9205 extruder_id = current_variant;
9206 else if (extruder_id != current_variant)
9207 return;
9208 }
9209 auto get_index_for_extruder =
9210 [this, &extruders, variant_keys = extruder_variant_keys[m_type >= Preset::TYPE_COUNT ? Preset::TYPE_PRINT : m_type]](int extruder_id, int stride = 1) {
9211 return m_config->get_index_for_extruder(extruder_id + 1, variant_keys.first,
9212 ExtruderType(extruders->values[extruder_id]), get_actual_nozzle_volume_type(extruder_id), variant_keys.second, stride);
9213 };
9214 auto index = m_variant_combo ? extruder_id : get_index_for_extruder(extruder_id == -1 ? 0 : extruder_id);
9215 if (index < 0)
9216 return;
9217 if (m_extruder_switch) m_extruder_switch->SetClientData(reinterpret_cast<void*>(static_cast<std::uintptr_t>(index)));
9218 if (m_variant_combo) m_variant_combo->SetClientData(reinterpret_cast<void *>(static_cast<std::uintptr_t>(index)));
9219 for (auto page : m_pages) {
9220 bool is_extruder = false;
9221 int page_index = index;
9223 if (page->title() == "Extruder")
9224 is_extruder = true;
9225 else if (page->title().StartsWith("Motion ability"))
9226 page_index = get_index_for_extruder(extruder_id == -1 ? 0 : extruder_id, 2);
9227 }
9228 page->m_opt_id_map.clear();
9229 for (auto group : page->m_optgroups) {
9230 for (auto &opt : group->opt_map()) {
9231 if (is_extruder && opt.second.second >= 0) {
9232 // Per-variant options use the variant column, the others (nozzle_diameter,
9233 // extruder_offset, ...) are sized by the extruder count and use the extruder.
9234 const int idx = printer_options_with_variant_1.count(opt.second.first) > 0 ? page_index : extruder_id;
9235 const_cast<int &>(opt.second.second) = idx;
9236 page->m_opt_id_map.insert({opt.second.first + "#" + std::to_string(idx), opt.first});
9237 continue;
9238 }
9239 auto iter = std::find(printer_extruder_options.begin(), printer_extruder_options.end(), opt.second.first);
9240 if (iter != printer_extruder_options.end()) {
9241 page->m_opt_id_map.insert({opt.first, opt.first});
9242 continue;
9243 }
9244
9245 if (opt.second.second >= 0) {
9246 const_cast<int &>(opt.second.second) = page_index;
9247 page->m_opt_id_map.insert({opt.second.first + "#" + std::to_string(page_index), opt.first});
9248 group->draw_multi_extruder = variant_switch_active();
9249 }
9250 }
9251 }
9252 }
9253 if (reload) {
9254 reload_config();
9257 if (m_active_page)
9258 m_active_page->update_visibility(m_mode, true);
9259 m_page_view->GetParent()->Layout();
9260 }
9261}
bool get_extruder_sync_enable_state(int extruder_id)
Definition Tab.cpp:9099
bool m_extruder_switch_variants
Definition Tab.hpp:338
bool variant_switch_active() const
Definition Tab.cpp:9155
std::set< std::string > printer_extruder_options
Definition PrintConfig.cpp:10224

References Slic3r::Preset::config, Slic3r::GUI::extruder_variant_keys, get_actual_nozzle_volume_type(), get_current_active_extruder(), get_extruder_sync_enable_state(), is_printer_extruder_page(), m_active_page, m_config, m_extruder_switch, m_extruder_switch_variants, m_extruder_sync, m_mode, m_page_view, m_pages, m_preset_bundle, m_type, m_variant_combo, Slic3r::ConfigBase::option(), Slic3r::printer_extruder_options, Slic3r::printer_options_with_variant_1, reload_config(), Slic3r::ConfigOptionVector< int >::size(), switch_excluder(), toggle_options(), Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, update_changed_ui(), Slic3r::ConfigOptionVector< int >::values, Slic3r::GUI::variant_keys(), and variant_switch_active().

Referenced by create_preset_tab(), switch_excluder(), and update_extruder_variants().

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

◆ sync_excluder()

void Slic3r::GUI::Tab::sync_excluder ( )
inherited
9264{
9265 Preset & printer_preset = m_preset_bundle->printers.get_edited_preset();
9266 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
9267 auto extruders = printer_preset.config.option<ConfigOptionEnumsGeneric>("extruder_type");
9268 // Motion ability options hold a (normal, silent) pair per variant, so switch_excluder indexes that page with stride 2.
9269 const int stride = m_active_page->title().StartsWith("Motion ability") ? 2 : 1;
9270 auto get_index_for_extruder =
9272 return m_config->get_index_for_extruder(extruder_id + 1, variant_keys.first,
9273 ExtruderType(extruders->values[extruder_id]), nozzle_type, variant_keys.second, stride);
9274 };
9275 int active_index = get_current_active_extruder();
9276 // The button copies to the other toolhead, so it is only offered when that other one exists;
9277 // without this the `1 - active_index` below would index an extruder that is not there.
9278 if (!get_extruder_sync_enable_state(active_index))
9279 return;
9280 auto active_nozzle = get_actual_nozzle_volume_type(active_index);
9281 int from_index = get_index_for_extruder(active_index, active_nozzle);
9282 int dest_index = get_index_for_extruder(1 - active_index, active_nozzle);
9283 if (from_index < 0 || dest_index < 0) // no variant column for this nozzle on one of the extruders
9284 return;
9285 auto dirty_options = m_presets->current_dirty_options(true);
9286 DynamicConfig config_origin, config_to_apply;
9287 for (int i = 0; i < dirty_options.size(); ++i) {
9288 auto &opt = dirty_options[i];
9289 auto n= opt.find('#');
9290 if (n == std::string::npos)
9291 continue;
9292 auto field = m_active_page->get_field(opt.substr(0, n), from_index + 256);
9293 auto line = m_active_page->get_line(opt.substr(0, n), from_index + 256);
9294 if (field == nullptr || line == nullptr)
9295 continue;
9296 ++n;
9297 auto is_from_slot = [&](const std::string &dirty_opt) {
9298 int slot = std::atoi(dirty_opt.c_str() + n);
9299 return slot >= from_index && slot < from_index + stride;
9300 };
9301 bool dirty = is_from_slot(opt);
9302 while (i + 1 < dirty_options.size() && dirty_options[i + 1].compare(0, n, opt, 0, n) == 0) {
9303 dirty |= is_from_slot(dirty_options[i + 1]);
9304 ++i;
9305 }
9306 if (dirty) {
9307 auto key = opt.substr(0, n - 1);
9308 auto option = dynamic_cast<ConfigOptionVectorBase*>(m_config->option(key));
9309 auto option2 = dynamic_cast<ConfigOptionVectorBase*>(option->clone());
9310 for (int s = 0; s < stride; ++s)
9311 option2->set_at(option, dest_index + s, from_index + s);
9312 if (*option == *option2) {
9313 delete option2;
9314 continue;
9315 }
9316 config_origin.set_key_value(key, option->clone());
9317 config_to_apply.set_key_value(key, option2);
9318 }
9319 }
9320 if (config_to_apply.empty()) {
9321 MessageDialog md(wxGetApp().plater(), _L("No modifications need to be copied."), _L("Copy parameters"), wxICON_INFORMATION | wxOK);
9322 md.ShowModal();
9323 return;
9324 }
9325
9326 std::string pt = m_preset_bundle->printers.get_edited_preset().get_printer_type(m_preset_bundle);
9329 wxString title = wxString::Format(_L("Modify parameters of %s"), _L(active_nozzle_name));
9330 wxString header = wxString::Format(_L("Do you want to modify the following parameters of the %s to that of the %s?"),
9331 _L(active_nozzle_name), _L(other_nozzle_name));
9332 UnsavedChangesDialog dlg(title, header, &config_origin, from_index, dest_index, active_index == 0, active_nozzle);
9333 dlg.ShowModal();
9334 if (dlg.transfer_changes()) {
9335 m_config->apply(config_to_apply);
9336 auto &applying_keys = const_cast<t_config_option_keys&>(m_config_manipulation.applying_keys());
9338 applying_keys = config_to_apply.keys();
9339 reload_config();
9341 applying_keys.clear();
9343 update();
9344 if (m_active_page)
9345 m_active_page->update_visibility(m_mode, true);
9346 m_page_view->GetParent()->Layout();
9347 }
9348}
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
std::vector< std::string > t_config_option_keys
Definition Config.hpp:97
@ LowerCase
Definition DevConfigUtil.h:43

References _L, Slic3r::Preset::config, Slic3r::DynamicConfig::empty(), Slic3r::GUI::extruder_variant_keys, get_actual_nozzle_volume_type(), get_current_active_extruder(), get_extruder_sync_enable_state(), Slic3r::DevPrinterConfigUtil::get_toolhead_display_name(), Slic3r::DynamicConfig::keys(), Slic3r::LowerCase, m_active_page, m_config, m_config_manipulation, m_mode, m_page_view, m_preset_bundle, m_presets, m_type, Slic3r::Nozzle, Slic3r::nozzle_type(), Slic3r::ConfigBase::option(), Slic3r::GUI::plater(), reload_config(), Slic3r::ConfigOptionVectorBase::set_at(), Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::UnsavedChangesDialog::ShowModal(), sync_excluder(), title(), Slic3r::GUI::UnsavedChangesDialog::transfer_changes(), Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_PRINT, update(), update_changed_ui(), Slic3r::ConfigOptionVector< int >::values, and Slic3r::GUI::variant_keys().

Referenced by create_preset_tab(), and sync_excluder().

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

◆ sync_extruders_count()

void Slic3r::GUI::TabPrinter::sync_extruders_count ( )
9048{
9050 return;
9051 const auto *nozzle_diameter = m_config->option<ConfigOptionFloats>("nozzle_diameter");
9052 if (nozzle_diameter == nullptr || nozzle_diameter->size() == m_extruders_count)
9053 return;
9057}

References extruders_count_changed(), init_options_list(), Slic3r::GUI::Tab::m_config, m_extruders_count, m_printer_technology, Slic3r::nozzle_diameter(), Slic3r::ptFFF, sync_extruders_count(), and Slic3r::GUI::update_all_extruder_variants().

Referenced by sync_extruders_count().

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

◆ sys_color_changed()

void Slic3r::GUI::Tab::sys_color_changed ( )
virtualinherited
1876{
1877 if (m_presets_choice)
1878 m_presets_choice->sys_color_changed();
1879
1880 // update buttons and cached bitmaps
1881 for (const auto btn : m_scaled_buttons)
1882 btn->msw_rescale();
1883 for (const auto bmp : m_scaled_bitmaps)
1884 bmp->msw_rescale();
1886 m_detach_preset_btn->msw_rescale();
1887
1888 // update icons for tree_ctrl
1889 for (ScalableBitmap& bmp : m_scaled_icons_list)
1890 bmp.msw_rescale();
1891 // recreate and set new ImageList for tree_ctrl
1892 m_icons->RemoveAll();
1893 m_icons = new wxImageList(m_scaled_icons_list.front().bmp().GetWidth(), m_scaled_icons_list.front().bmp().GetHeight(), false);
1894 for (ScalableBitmap& bmp : m_scaled_icons_list)
1895 //m_icons->Add(bmp.bmp());
1896 m_tabctrl->AssignImageList(m_icons);
1897
1898 // Colors for ui "decoration"
1900#ifdef _WIN32
1901 wxWindowUpdateLocker noUpdates(this);
1902 //BBS: GUI refactor
1903 //if (m_mode_sizer)
1904 // m_mode_sizer->msw_rescale();
1905 wxGetApp().UpdateDarkUI(this);
1906 wxGetApp().UpdateDarkUI(m_tabctrl);
1907#endif
1909
1910 // update options_groups
1911 if (m_active_page)
1912 m_active_page->sys_color_changed();
1914 m_extruder_switch->Rescale();
1915 if (m_variant_combo)
1916 m_variant_combo->Rescale();
1917
1918 //BBS: GUI refactor
1919 //Layout();
1920 m_parent->Layout();
1921}
void update_label_colours()
Definition Tab.cpp:917
void update_changed_tree_ui()
Definition Tab.cpp:1438

References m_active_page, m_detach_preset_btn, m_extruder_switch, m_icons, m_parent, m_presets_choice, m_scaled_bitmaps, m_scaled_buttons, m_scaled_icons_list, m_tabctrl, m_variant_combo, sys_color_changed(), update_changed_tree_ui(), and update_label_colours().

Referenced by sys_color_changed().

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

◆ title()

wxString Slic3r::GUI::Tab::title ( ) const
inlineinherited

◆ toggle_line()

void Slic3r::GUI::Tab::toggle_line ( const std::string & opt_key,
bool toggle,
int opt_index = -1 )
inherited
1971{
1972 // Apply to every page that owns the option, not just m_active_page. ConfigManipulation runs while
1973 // each tab updates at preset load, so the Speed Dial sees the same visibility regardless of page.
1974 for (const PageShp& page : m_pages) {
1975 if (!page) continue;
1976 if (Line *line = page->get_line(opt_key, opt_index))
1977 line->toggle_visible = toggle;
1978 }
1979};

References m_pages, and toggle_line().

Referenced by get_config_manipulation(), toggle_line(), Slic3r::GUI::TabFilament::toggle_options(), Slic3r::GUI::TabPrinter::toggle_options(), and Slic3r::GUI::TabFilament::update_filament_overrides_page().

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

◆ toggle_option()

void Slic3r::GUI::Tab::toggle_option ( const std::string & opt_key,
bool toggle,
int opt_index = -1 )
inherited
1962{
1963 if (!m_active_page)
1964 return;
1965 Field* field = m_active_page->get_field(opt_key, opt_index);
1966 if (field)
1967 field->toggle(toggle);
1968}

References m_active_page, Slic3r::GUI::Field::toggle(), and toggle_option().

Referenced by get_config_manipulation(), toggle_option(), Slic3r::GUI::TabFilament::toggle_options(), Slic3r::GUI::TabPrint::toggle_options(), Slic3r::GUI::TabPrinter::toggle_options(), and Slic3r::GUI::TabPrintPlate::update_mixed_filament_seq_state().

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

◆ toggle_options()

void Slic3r::GUI::TabPrinter::toggle_options ( )
overridevirtual

Implements Slic3r::GUI::Tab.

6650{
6651 if (!m_active_page || m_presets->get_edited_preset().printer_technology() == ptSLA)
6652 return;
6653
6654 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
6655
6656 //BBS: whether the preset is Bambu Lab printer
6657 bool is_BBL_printer = false;
6658 if (m_preset_bundle) {
6659 is_BBL_printer = wxGetApp().preset_bundle->is_bbl_vendor();
6660 }
6661
6662 bool have_multiple_extruders = true;
6663 //m_extruders_count > 1;
6664 //if (m_active_page->title() == "Custom G-code") {
6665 // toggle_option("change_filament_gcode", have_multiple_extruders);
6666 //}
6667 if (m_active_page->title() == L("Basic information")) {
6668 const auto &printer_cfg = m_preset_bundle->printers.get_edited_preset().config;
6669
6670 // SoftFever: hide BBL specific settings
6671 for (auto el : {"scan_first_layer", "bbl_calib_mark_logo", "bbl_use_printhost"})
6672 toggle_line(el, is_BBL_printer);
6673
6674 // SoftFever: hide non-BBL settings
6675 for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types", "pellet_modded_printer", "bed_mesh_max", "bed_mesh_min", "bed_mesh_probe_distance", "adaptive_bed_mesh_margin", "thumbnails"})
6676 toggle_line(el, !is_BBL_printer);
6677
6678 bool gcf_is_marlin_firmware = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == GCodeFlavor::gcfMarlinFirmware;
6679 toggle_line("enable_power_loss_recovery", is_BBL_printer || gcf_is_marlin_firmware);
6680
6681 // Belt printer: show belt-specific settings only when belt_printer is enabled.
6682 bool is_belt = m_config->opt_bool("belt_printer");
6683 // update_fff() derives build_plate_tilt_{x,y} from the belt tilt on a belt
6684 // printer, so an edit here would be overwritten; keep them read-only there.
6685 toggle_option("build_plate_tilt_x", !is_belt);
6686 toggle_option("build_plate_tilt_y", !is_belt);
6687 bool expert_or_above = (m_mode >= comExpert);
6688 toggle_line("belt_printer_infinite_y", is_belt);
6689 // Belt tilt: the sole mesh-side belt transform (visible by default in belt mode).
6690 toggle_line("belt_slice_rotation_angle", is_belt);
6691 toggle_line("belt_slice_rotation", is_belt);
6692
6693 // Remap, back-transform, and global mesh-transforms toggles are gated by belt
6694 // mode here; finer mode-based visibility is handled by each option's
6695 // ConfigOptionMode in PrintConfig.cpp. The axis remap is Develop-only: a
6696 // printer profile sets it once for its kinematics, and a wrong value sends
6697 // the gantry outside the machine.
6698 for (auto el : {"gcode_remap_x", "gcode_remap_y", "gcode_remap_z"})
6699 toggle_line(el, is_belt);
6700
6701 // Rotation is the only mesh-side belt transform. Gray out its angle when no
6702 // rotation axis is selected.
6703 auto rot_axis = m_config->option<ConfigOptionEnum<BeltRotationAxis>>("belt_slice_rotation")->value;
6704 toggle_option("belt_slice_rotation_angle", is_belt && rot_axis != BeltRotationAxis::None);
6705
6706 // Machine-frame transform: derived from the belt tilt. Only the expert
6707 // decouple override is exposed; its angle is shown only when decoupled.
6708 toggle_line("belt_frame_tilt_decouple", is_belt && expert_or_above);
6709 toggle_line("belt_frame_tilt_angle",
6710 is_belt && expert_or_above && m_config->opt_bool("belt_frame_tilt_decouple"));
6711
6712
6713 toggle_line("belt_support_floor_offset", is_belt);
6714 const bool support_parallel_printheads = printer_cfg.opt_bool("support_parallel_printheads");
6715 toggle_line("parallel_printheads_count", support_parallel_printheads);
6716
6717 const size_t exclusion_extruder_count = m_preset_bundle->get_printer_extruder_count();
6718 // UI visibility follows the selected mode even before any volumes are
6719 // entered. The runtime resolver still ignores empty configurations.
6720 const BedExcludeVolumeMode exclusion_mode = m_config->opt_enum<BedExcludeVolumeMode>("bed_exclude_volume_mode");
6721 // Legacy areas and collision volumes are additive. Keep the established
6722 // material keep-out editable while the opt-in motion constraints exist.
6723 toggle_option("bed_exclude_area", true);
6724 toggle_line("bed_exclude_volume_mode", exclusion_extruder_count > 1);
6725 toggle_line("bed_exclude_volumes", exclusion_extruder_count <= 1 || exclusion_mode != BedExcludeVolumeMode::PerExtruder);
6726
6727 toggle_line("fan_direction", m_config->opt_bool("auxiliary_fan"));
6728
6729 // The cooling filter and air filtration are alternative accessories: show only the one the printer supports.
6730 toggle_line("support_air_filtration", !m_config->opt_bool("support_cooling_filter"));
6731 toggle_line("cooling_filter_enabled", m_config->opt_bool("support_cooling_filter"));
6732 }
6733
6734
6735 if (m_active_page->title() == L("Machine G-code")) {
6736 PresetBundle *preset_bundle = wxGetApp().preset_bundle;
6737 std::string printer_type = preset_bundle->printers.get_edited_preset().get_printer_type(preset_bundle);
6738 toggle_line("wrapping_detection_gcode", DevPrinterConfigUtil::support_wrapping_detection(printer_type));
6739 }
6740
6741 if (m_active_page->title() == L("Multimaterial")) {
6742 // Orca-Belt: belt printers use the belt purge tower instead of the classic
6743 // wipe tower — show its enable only on belt printers, and hide the classic
6744 // wipe-tower fields there (the classic tower's G-code bypasses the belt transform).
6745 const bool is_belt_printer = m_config->opt_bool("belt_printer");
6746 toggle_line("enable_belt_purge_tower", is_belt_printer);
6747
6748 const bool supports_wipe_tower_2 = !is_BBL_printer && m_config->opt_enum<WipeTowerType>("wipe_tower_type") == WipeTowerType::Type2;
6749 toggle_line("wipe_tower_type", !is_BBL_printer && !is_belt_printer);
6750 // SoftFever: hide specific settings for BBL printer
6751 for (auto el : {
6752 "enable_filament_ramming",
6753 "cooling_tube_retraction",
6754 "cooling_tube_length",
6755 "parking_pos_retraction",
6756 "extra_loading_move",
6757 "high_current_on_filament_swap",
6758 })
6759 toggle_option(el, supports_wipe_tower_2);
6760
6761 auto bSEMM = m_config->opt_bool("single_extruder_multi_material");
6762 if (!bSEMM && m_config->opt_bool("manual_filament_change")) {
6763 DynamicPrintConfig new_conf = *m_config;
6764 new_conf.set_key_value("manual_filament_change", new ConfigOptionBool(false));
6765 load_config(new_conf);
6766 }
6767 toggle_option("extruders_count", !bSEMM);
6768 toggle_option("manual_filament_change", bSEMM);
6769 toggle_option("purge_in_prime_tower", bSEMM && supports_wipe_tower_2);
6770
6771 // IDEX/IQEX: show carriage config options only when is_imex is enabled
6772 bool is_imex = m_config->opt_bool("is_imex");
6773 for (auto el : {"imex_gantry_count", "imex_tools_per_gantry",
6774 "imex_nozzle_clearance_x", "imex_nozzle_clearance_y",
6775 "imex_carriage_margin"})
6777 toggle_option("imex_tool_layout", is_imex);
6778 toggle_option("imex_viz_theme", is_imex);
6779 toggle_option("imex_firmware_managed_zones", is_imex);
6780 if (m_imex_modes_ctrl) m_imex_modes_ctrl->set_applicable(is_imex);
6781
6782 // IDEX/IQEX: the tool_layout dropdown carries 4 corner values
6783 // (front-left / front-right / rear-left / rear-right) in storage, but front/rear
6784 // is meaningless on single-gantry setups. Collapse the dropdown to just two
6785 // items ("Left" / "Right") when imex_gantry_count == 1 — mapped to front-left
6786 // and front-right internally — and normalize any stored rear-* selection to its
6787 // front-* equivalent so the displayed selection always matches the stored value.
6788 if (is_imex) {
6789 if (Field* layout_field = get_field("imex_tool_layout"); layout_field) {
6790 if (auto* choice = dynamic_cast<Choice*>(layout_field); choice) {
6791 const int gantry_count = std::max(1, imex_cfg_int(*m_config, "imex_gantry_count"));
6792 // Not const: the rear-* -> front-* normalization below reassigns it.
6793 int current_val =
6794 static_cast<int>(imex_cfg_enum<ImexToolLayout>(*m_config, "imex_tool_layout"));
6795
6796 // Normalize rear-* → front-* when collapsing to 1 gantry.
6797 if (gantry_count == 1 && (current_val == static_cast<int>(ImexToolLayout::RearLeft)
6798 || current_val == static_cast<int>(ImexToolLayout::RearRight))) {
6799 ImexToolLayout normalized = (current_val == static_cast<int>(ImexToolLayout::RearLeft))
6802 DynamicPrintConfig new_conf = *m_config;
6803 new_conf.set_key_value("imex_tool_layout",
6804 new ConfigOptionEnum<ImexToolLayout>(normalized));
6805 load_config(new_conf);
6806 current_val = static_cast<int>(normalized);
6807 }
6808
6809 wxArrayString items;
6810 if (gantry_count >= 2) {
6811 items.Add(_L("Front-left"));
6812 items.Add(_L("Front-right"));
6813 items.Add(_L("Rear-left"));
6814 items.Add(_L("Rear-right"));
6815 } else {
6816 items.Add(_L("Left"));
6817 items.Add(_L("Right"));
6818 }
6819 choice->set_values(items);
6820 choice->set_value(boost::any(current_val), false);
6821 }
6822 }
6823 }
6824
6825 // Orca: "Tool change on wipe tower" only makes sense for multi-extruder (multi-toolhead) printers
6826 // using a Type 2 wipe tower. SEMM already always travels to the tower as part of the purge,
6827 // so the option is irrelevant there.
6828 const size_t extruders_count = m_config->option<ConfigOptionFloats>("nozzle_diameter")->size();
6829 toggle_option("tool_change_on_wipe_tower", !bSEMM && supports_wipe_tower_2 && extruders_count > 1);
6830 toggle_option("wait_for_temp_on_wipe_tower", !bSEMM && supports_wipe_tower_2 && extruders_count > 1);
6831 }
6832 if (m_active_page->title() == L("Extruder") && m_extruders_count > 0)
6833 {
6834 // Orca: the single Extruder page edits the extruder selected on the variant switch; its
6835 // controls carry field index 0 (i), the values are read for `extruder`.
6836 const size_t i = 0;
6837 const size_t extruder = std::min<size_t>(size_t(get_current_active_extruder()), m_extruders_count - 1);
6838 const int variant_index = extruder_variant_index(int(extruder));
6839 bool have_retract_length = m_config->opt_float("retraction_length", variant_index) > 0;
6840
6841 toggle_option("extruder_printable_area", false, i); // disable
6842 toggle_line("extruder_printable_area", m_preset_bundle->get_printer_extruder_count() == 2, i); //hide
6843 const bool per_extruder_exclusions =
6844 m_config->opt_enum<BedExcludeVolumeMode>("bed_exclude_volume_mode") == BedExcludeVolumeMode::PerExtruder;
6845 toggle_line("extruder_bed_exclude_volumes", m_preset_bundle->get_printer_extruder_count() > 1 && per_extruder_exclusions, i);
6846 toggle_option("extruder_printable_height", false, i);
6847 toggle_line("extruder_printable_height", m_preset_bundle->get_printer_extruder_count() == 2, i);
6848
6849 // when using firmware retraction, firmware decides retraction length
6850 bool use_firmware_retraction = m_config->opt_bool("use_firmware_retraction");
6851 toggle_option("retract_length", !use_firmware_retraction, i);
6852
6853 // user can customize travel length if we have retraction length or we"re using
6854 // firmware retraction
6855 toggle_option("retraction_minimum_travel", have_retract_length || use_firmware_retraction, i);
6856
6857 // user can customize other retraction options if retraction is enabled
6858 //BBS
6859 bool retraction = have_retract_length || use_firmware_retraction;
6860 std::vector<std::string> vec = {"z_hop", "retract_when_changing_layer"};
6861 for (auto el : vec)
6862 toggle_option(el, retraction, i);
6863
6864 // retract lift above / below + enforce only applies if using retract lift
6865 vec.resize(0);
6866 vec = {"retract_lift_above", "retract_lift_below", "retract_lift_enforce"};
6867 for (auto el : vec)
6868 toggle_option(el, retraction && (m_config->opt_float("z_hop", variant_index) > 0), i);
6869
6870 // some options only apply when not using firmware retraction
6871 vec.resize(0);
6872 vec = {"retraction_speed", "deretraction_speed", "retract_before_wipe", "retract_after_wipe",
6873 "retract_length", "retract_restart_extra", "wipe_distance"};
6874 for (auto el : vec)
6875 //BBS
6876 toggle_option(el, retraction && !use_firmware_retraction, i);
6877
6878 bool wipe = retraction && m_config->opt_bool("wipe", variant_index);
6879
6880 // Orca:
6881 double retract_before_wipe = m_config->option<ConfigOptionPercents>("retract_before_wipe")->get_at(variant_index);
6882 double retract_after_wipe = m_config->option<ConfigOptionPercents>("retract_after_wipe")->get_at(variant_index);
6883
6884 toggle_option("retract_before_wipe", wipe && !is_approx(retract_after_wipe, 100.), i);
6885 toggle_option("retract_after_wipe", wipe && !is_approx(retract_before_wipe, 100.), i);
6886
6887 if (use_firmware_retraction && wipe && retract_before_wipe < 100.0) {
6888 //wxMessageDialog dialog(parent(),
6889 MessageDialog dialog(parent(),
6890 _(L("The Retract before wipe option could be only 100% when using the Firmware Retraction mode.\n"
6891 "\nShall I set it to 100% in order to enable Firmware Retraction?")),
6892 _(L("Firmware Retraction")), wxICON_WARNING | wxYES | wxNO);
6893
6894 DynamicPrintConfig new_conf = *m_config;
6895 if (dialog.ShowModal() == wxID_YES) {
6896 auto wipe = static_cast<ConfigOptionBools*>(m_config->option("wipe")->clone());
6897 auto retract_before_wipe = static_cast<ConfigOptionPercents*>(m_config->option("retract_before_wipe")->clone());
6898 for (size_t w = 0; w < wipe->values.size(); w++) {
6899 wipe->values[w] = false;
6900 retract_before_wipe->values[w] = 100.0;
6901 }
6902 new_conf.set_key_value("wipe", wipe);
6903 new_conf.set_key_value("retract_before_wipe", retract_before_wipe);
6904 }
6905 else {
6906 new_conf.set_key_value("use_firmware_retraction", new ConfigOptionBool(false));
6907 }
6908 load_config(new_conf);
6909 }
6910 // BBS
6911 toggle_option("wipe_distance", wipe, i);
6912
6913 toggle_option("retract_length_toolchange", have_multiple_extruders, i);
6914
6915 bool toolchange_retraction = m_config->opt_float("retract_length_toolchange", variant_index) > 0;
6916 toggle_option("retract_restart_extra_toolchange", have_multiple_extruders && toolchange_retraction, i);
6917
6918 toggle_option("long_retractions_when_cut", !use_firmware_retraction && m_config->opt_int("enable_long_retraction_when_cut"), i);
6919 toggle_line("retraction_distances_when_cut", m_config->opt_bool("long_retractions_when_cut", variant_index), i);
6920
6921 toggle_option("travel_slope", m_config->opt_enum("z_hop_types", variant_index) != ZHopType::zhtNormal, i);
6922 }
6923
6924 if (m_active_page->title() == L("Motion ability")) {
6925 auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
6927
6928 // Orca: use booleans to avoid repeated comparisons with enum values
6929 const bool gcf_is_marlin_legacy = gcf == GCodeFlavor::gcfMarlinLegacy;
6930 const bool gcf_is_marlin_firmware = gcf == GCodeFlavor::gcfMarlinFirmware;
6931 const bool gcf_is_klipper = gcf == GCodeFlavor::gcfKlipper;
6932 const bool gcf_is_reprap_firmware = gcf == GCodeFlavor::gcfRepRapFirmware;
6933
6934 toggle_option("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper, 0);
6935 toggle_line("machine_max_acceleration_travel", !gcf_is_marlin_legacy && !gcf_is_klipper);
6936 toggle_option("machine_max_junction_deviation", gcf_is_marlin_firmware, 0);
6937 toggle_line("machine_max_junction_deviation", gcf_is_marlin_firmware);
6938
6939 // Check if junction deviation value is non-zero and firmware is Marlin
6940 bool enable_jerk = !gcf_is_marlin_firmware;
6941 if (gcf_is_marlin_firmware) {
6942 const auto *junction_deviation = m_config->option<ConfigOptionFloats>("machine_max_junction_deviation");
6943 if (junction_deviation != nullptr) {
6944 const auto &values = junction_deviation->values;
6945 enable_jerk = std::all_of(values.begin(), values.end(), [](double val) { return val == 0.0; });
6946 } else {
6947 enable_jerk = true;
6948 }
6949 }
6950 toggle_option("machine_max_jerk_x", enable_jerk, 0);
6951 toggle_option("machine_max_jerk_y", enable_jerk, 0);
6952 toggle_option("machine_max_jerk_z", enable_jerk, 0);
6953 toggle_option("machine_max_jerk_e", enable_jerk, 0);
6954
6955 bool emittable_limits = gcf_is_marlin_legacy || gcf_is_marlin_firmware || gcf_is_reprap_firmware;
6956 toggle_option("emit_machine_limits_to_gcode", emittable_limits);
6957
6958 bool resonance_avoidance = m_config->opt_bool("resonance_avoidance");
6959 toggle_option("min_resonance_avoidance_speed", resonance_avoidance);
6960 toggle_option("max_resonance_avoidance_speed", resonance_avoidance);
6961
6962 bool input_shaping_compatible = gcf_is_marlin_firmware || gcf_is_reprap_firmware;
6963
6964 for (auto is : {"input_shaping_emit", "input_shaping_type", "input_shaping_freq_x", "input_shaping_freq_y",
6965 "input_shaping_damp_x", "input_shaping_damp_y"})
6966 toggle_line(is, input_shaping_compatible);
6967
6968 if (input_shaping_compatible) {
6969 bool emit_machine_limits_to_gcode = m_config->opt_bool("emit_machine_limits_to_gcode");
6970 toggle_option("input_shaping_emit", emit_machine_limits_to_gcode);
6971 bool input_shaping_emit = emit_machine_limits_to_gcode && m_config->opt_bool("input_shaping_emit");
6972 toggle_option("input_shaping_type", input_shaping_emit);
6973 toggle_option("input_shaping_freq_x", input_shaping_emit);
6974 toggle_option("input_shaping_freq_y", input_shaping_emit && !gcf_is_reprap_firmware);
6975 toggle_option("input_shaping_damp_x", input_shaping_emit);
6976 toggle_option("input_shaping_damp_y", input_shaping_emit && !gcf_is_reprap_firmware);
6977 }
6978
6979 }
6980}
@ Choice
Definition Button.hpp:33
static bool support_wrapping_detection(const std::string &type_str)
Definition DevConfigUtil.h:122
int extruder_variant_index(int extruder)
Definition Tab.cpp:9031
CGALMeshPtr clone(const CGALMesh &m)
Definition MeshBoolean.cpp:658
zaa_minimize_perimeter_height is_imex((ConfigOptionBool, imex_firmware_managed_zones))((ConfigOptionInt
zaa_minimize_perimeter_height wipe((ConfigOptionInts, nozzle_temperature_range_low))((ConfigOptionInts
@ None
Definition PrintConfig.hpp:342
@ zhtNormal
Definition PrintConfig.hpp:584
T imex_cfg_enum(const ConfigBase &cfg, const std::string &key)
Definition IMEXHelpers.hpp:386
constexpr bool is_approx(Number value, Number test_value, Number precision=EPSILON)
Definition libslic3r.h:320
ConfigOptionBoolsTempl< false > ConfigOptionBools
Definition Config.hpp:2066
WipeTowerType
Definition PrintConfig.hpp:113
@ Type2
Definition PrintConfig.hpp:115
ImexToolLayout
Definition PrintConfig.hpp:262
@ FrontRight
Definition PrintConfig.hpp:264
@ FrontLeft
Definition PrintConfig.hpp:263
@ RearRight
Definition PrintConfig.hpp:266
@ RearLeft
Definition PrintConfig.hpp:265
int imex_cfg_int(const ConfigBase &cfg, const std::string &key)
Definition IMEXHelpers.cpp:269
zaa_minimize_perimeter_height use_firmware_retraction((ConfigOptionBool, use_relative_e_distances))((ConfigOptionBool
zaa_minimize_perimeter_height support_parallel_printheads((ConfigOptionInt, parallel_printheads_count))((ConfigOptionStrings
BedExcludeVolumeMode
Definition PrintConfig.hpp:642
@ PerExtruder
Definition PrintConfig.hpp:645

References _, _L, Slic3r::comExpert, extruder_variant_index(), Slic3r::FrontLeft, Slic3r::FrontRight, Slic3r::gcfKlipper, Slic3r::gcfMarlinFirmware, Slic3r::gcfMarlinLegacy, Slic3r::gcfRepRapFirmware, Slic3r::GUI::Tab::get_current_active_extruder(), Slic3r::PresetCollection::get_edited_preset(), Slic3r::GUI::Tab::get_field(), Slic3r::Preset::get_printer_type(), Slic3r::imex_cfg_enum(), Slic3r::imex_cfg_int(), Slic3r::is_approx(), Slic3r::is_imex(), L, Slic3r::load_config(), Slic3r::GUI::Tab::m_active_page, Slic3r::GUI::Tab::m_config, m_extruders_count, m_imex_modes_ctrl, Slic3r::GUI::Tab::m_mode, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::GUI::Tab::m_presets, Slic3r::None, Slic3r::GUI::Tab::parent(), Slic3r::PerExtruder, Slic3r::PresetBundle::printers, Slic3r::ptSLA, Slic3r::RearLeft, Slic3r::RearRight, Slic3r::retract_after_wipe(), Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::support_parallel_printheads(), Slic3r::DevPrinterConfigUtil::support_wrapping_detection(), Slic3r::GUI::Tab::toggle_line(), Slic3r::GUI::Tab::toggle_option(), toggle_options(), Slic3r::Type2, update_input_shaper_menu(), Slic3r::use_firmware_retraction(), Slic3r::wipe(), and Slic3r::zhtNormal.

Referenced by toggle_options(), and update_fff().

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

◆ toggle_show_hide_incompatible()

void Slic3r::GUI::Tab::toggle_show_hide_incompatible ( )
inherited
8388{
8390 if (m_presets_choice)
8391 m_presets_choice->set_show_incompatible_presets(m_show_incompatible_presets);
8393 update_tab_ui();
8394}
void update_show_hide_incompatible_button()
Definition Tab.cpp:8396

References m_presets_choice, m_show_incompatible_presets, toggle_show_hide_incompatible(), update_show_hide_incompatible_button(), and update_tab_ui().

Referenced by toggle_show_hide_incompatible().

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

◆ transfer_options()

void Slic3r::GUI::Tab::transfer_options ( const std::string & name_from,
const std::string & name_to,
std::vector< std::string > options )
inherited
8090{
8091 if (options.empty())
8092 return;
8093
8094 Preset* preset_from = m_presets->find_preset(name_from);
8095 Preset* preset_to = m_presets->find_preset(name_to);
8096
8098 auto it = std::find(options.begin(), options.end(), "extruders_count");
8099 if (it != options.end()) {
8100 // erase "extruders_count" option from the list
8101 options.erase(it);
8102 // cache the extruders count
8103 static_cast<TabPrinter*>(this)->cache_extruder_cnt(&preset_from->config);
8104 }
8105 }
8106 cache_config_diff(options, &preset_from->config);
8107
8108 if (name_to != m_presets->get_edited_preset().name )
8109 select_preset(preset_to->name);
8110
8113}

References apply_config_from_cache(), cache_config_diff(), Slic3r::Preset::config, load_current_preset(), m_presets, m_type, Slic3r::Preset::name, select_preset(), transfer_options(), and Slic3r::Preset::TYPE_PRINTER.

Referenced by transfer_options().

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

◆ translate_category()

wxString Slic3r::GUI::Tab::translate_category ( const wxString & title,
Preset::Type preset_type,
bool translate = true )
staticinherited
824{
825 auto tr = [translate](const wxString& s) { return translate ? _(s) : s; };
826 if (preset_type == Preset::TYPE_PRINTER && title.Contains("Extruder ")) {
827 auto preset = wxGetApp().preset_bundle;
828 if (preset && preset->is_bbl_vendor()) {
829 if (title == "Extruder 1") return tr(L("Left Extruder"));
830 if (title == "Extruder 2") return tr(L("Right Extruder"));
831 }
832 return tr(L("Extruder")) + title.SubString(8, title.Last());
833 }
834 // Orca: one "Extruder" page serves all extruders; name it "Extruders" when there are several.
835 if (preset_type == Preset::TYPE_PRINTER && title == "Extruder") {
836 auto preset = wxGetApp().preset_bundle;
837 if (preset && preset->get_printer_extruder_count() > 1)
838 return tr(L("Extruders"));
839 }
840 return tr(title);
841}
void translate(ExPolygonsWithIds &e, const Point &p)
Definition Emboss.cpp:1368

References _, L, title(), Slic3r::translate(), and Slic3r::Preset::TYPE_PRINTER.

Referenced by activate_option(), Slic3r::GUI::PublishSettingsDialog::build_option_model(), generate_extruder_options(), Slic3r::Search::make_option(), Slic3r::GUI::ActionRegistry::materialize_setting_actions(), rebuild_page_tree(), tree_sel_change_delayed(), update_changed_tree_ui(), update_current_page_in_background(), update_label_colours(), Slic3r::GUI::UnsavedChangesDialog::update_tree(), and Slic3r::GUI::UnsavedChangesDialog::update_tree().

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

◆ tree_sel_change_delayed()

bool Slic3r::GUI::Tab::tree_sel_change_delayed ( wxCommandEvent & event)
protectedinherited
7951{
7952 // The issue apparently manifests when Show()ing a window with overlay scrollbars while the UI is frozen. For this reason,
7953 // we will Thaw the UI prematurely on Linux. This means destroing the no_updates object prematurely.
7954#ifdef __linux__
7955 std::unique_ptr<wxWindowUpdateLocker> no_updates(new wxWindowUpdateLocker(this));
7956#else
7957 /* On Windows we use DoubleBuffering during rendering,
7958 * so on Window is no needed to call a Freeze/Thaw functions.
7959 * But under OSX (builds compiled with MacOSX10.14.sdk) wxStaticBitmap rendering is broken without Freeze/Thaw call.
7960 */
7961//#ifdef __WXOSX__ // Use Freeze/Thaw to avoid flickering during clear/activate new page
7962// wxWindowUpdateLocker noUpdates(this);
7963//#endif
7964#endif
7965
7966 //BBS: GUI refactor
7967 Page* page = nullptr;
7968 const auto sel_item = m_tabctrl->GetSelection();
7969 // BBS: bold selection
7970 //OutputDebugStringA("tree_sel_change_delayed ");
7971 //OutputDebugStringA(m_title.c_str());
7972 m_tabctrl->SetItemBold(sel_item, true);
7973 const auto selection = sel_item >= 0 ? m_tabctrl->GetItemText(sel_item) : "";
7974 //OutputDebugString(selection);
7975 //OutputDebugStringA("\n");
7976 for (auto p : m_pages)
7977 if (translate_category(p->title(), m_type) == selection)
7978 {
7979 page = p.get();
7980 m_is_nonsys_values = page->m_is_nonsys_values;
7981 m_is_modified_values = page->m_is_modified_values;
7982 break;
7983 }
7984
7985 //BBS: GUI refactor
7986 if (page == nullptr)
7987 {
7988 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format("can not find page with current selection %1%\n") % selection;
7989 return false;
7990 }
7991 void* item_data = m_tabctrl->GetItemData(sel_item);
7992 if (item_data)
7993 {
7994 //from update_current_page_in_background in not active tab
7995 m_tabctrl->SetItemData(sel_item, NULL);
7996 return false;
7997 }
7998
7999 if (!m_parent->is_active_and_shown_tab((wxPanel*)this))
8000 {
8001 Tab* current_tab = dynamic_cast<Tab*>(m_parent->get_current_tab());
8002
8003 m_page_view->Freeze();
8004
8005 if (current_tab)
8006 {
8007 current_tab->clear_pages();
8008 current_tab->unselect_tree_item();
8009 }
8010 m_active_page = page;
8011 // BBS: not changed
8012 // update_undo_buttons();
8013 this->OnActivate();
8014 m_parent->set_active_tab(this);
8016
8017 m_page_view->Thaw();
8018 return false;
8019 }
8020
8021 //process logic in the same tab when select treeCtrlItem
8022 if (m_active_page == page)
8023 return false;
8024
8025 m_active_page = page;
8027
8028 auto throw_if_canceled = std::function<void()>([this](){
8029#ifdef WIN32
8030 //BBS: GUI refactor
8031 //TODO: remove this call currently, after refactor, there is Paint event in the queue
8032 //this call will cause OnPaint immediately, which will cause crash
8033 //wxCheckForInterrupt(m_tabctrl);
8035 throw UIBuildCanceled();
8036#else // WIN32
8037 (void)this; // silence warning
8038#endif
8039 });
8040
8041 try {
8042 m_page_view->Freeze();
8043 // clear pages from the controls
8044 clear_pages();
8045 throw_if_canceled();
8046
8047 //BBS: GUI refactor
8048 if (wxGetApp().mainframe!=nullptr && wxGetApp().mainframe->is_active_and_shown_tab(m_parent))
8049 activate_selected_page(throw_if_canceled);
8050
8051 #ifdef __linux__
8052 no_updates.reset(nullptr);
8053 #endif
8054
8055 // BBS: not changed
8056 // update_undo_buttons();
8057 throw_if_canceled();
8058
8059 //BBS: GUI refactor
8060 //m_hsizer->Layout();
8061 m_parent->Layout();
8062 throw_if_canceled();
8063 // Refresh();
8064
8065 m_page_view->Thaw();
8066 } catch (const UIBuildCanceled&) {
8067 if (m_active_page)
8068 m_active_page->clear();
8069 m_page_view->Thaw();
8070 return true;
8071 }
8072
8073 return false;
8074}
bool m_is_modified_values
Definition Tab.hpp:275
void update_variant_sizer_visibility()
Definition Tab.cpp:9162
virtual void OnActivate()
Definition Tab.cpp:843

References Tab(), activate_selected_page(), clear_pages(), m_active_page, Slic3r::GUI::Page::m_is_modified_values, m_is_modified_values, Slic3r::GUI::Page::m_is_nonsys_values, m_is_nonsys_values, m_page_switch_planned, m_page_view, m_pages, m_parent, m_tabctrl, m_type, OnActivate(), translate_category(), tree_sel_change_delayed(), unselect_tree_item(), and update_variant_sizer_visibility().

Referenced by create_preset_tab(), and tree_sel_change_delayed().

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

◆ type()

Preset::Type Slic3r::GUI::Tab::type ( ) const
inlineinherited
350{ return m_type; }

References m_type.

Referenced by Tab(), Slic3r::GUI::TabPrint::TabPrint(), Slic3r::GUI::MainFrame::add_created_tab(), Slic3r::GUI::TabPrinter::build_unregular_pages(), Slic3r::GUI::ParamsPanel::set_active_tab(), Slic3r::GUI::TabPrinter::set_extruder_volume_type(), and Slic3r::GUI::TabPrinter::update_input_shaper_menu().

Here is the caller graph for this function:

◆ unselect_tree_item()

void Slic3r::GUI::Tab::unselect_tree_item ( )
inherited
7822{
7823 // BBS: bold selection
7824 const auto sel_item = m_tabctrl->GetSelection();
7825 m_last_select_item = sel_item;
7826 m_tabctrl->SetItemBold(sel_item, false);
7827 m_tabctrl->Unselect();
7828 m_active_page = nullptr;
7829}

References m_active_page, m_last_select_item, m_tabctrl, and unselect_tree_item().

Referenced by tree_sel_change_delayed(), and unselect_tree_item().

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

◆ update()

void Slic3r::GUI::TabPrinter::update ( )
overridevirtual

Implements Slic3r::GUI::Tab.

7042{
7043 m_update_cnt++;
7044 m_presets->get_edited_preset().printer_technology() == ptFFF ? update_fff() : update_sla();
7045 m_update_cnt--;
7046
7048 //BBS: GUI refactor
7049 //Layout();
7050 m_parent->Layout();
7051
7052 if (m_update_cnt == 0)
7053 wxGetApp().mainframe->on_config_changed(m_config);
7054}
void update_fff()
Definition Tab.cpp:7056
void update_sla()
Definition Tab.cpp:7111
virtual void update_description_lines()
Definition Tab.cpp:7872
int m_update_cnt
Definition Tab.hpp:326

References Slic3r::GUI::Tab::m_config, Slic3r::GUI::Tab::m_parent, Slic3r::GUI::Tab::m_presets, Slic3r::GUI::Tab::m_update_cnt, Slic3r::ptFFF, update(), Slic3r::GUI::Tab::update_description_lines(), update_fff(), and update_sla().

Referenced by build_unregular_pages(), and update().

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

◆ update_all_extruder_options_status()

void Slic3r::GUI::Tab::update_all_extruder_options_status ( )
inherited
1215{
1217 return;
1218 }
1220
1221 int extruder_count = m_preset_bundle->get_printer_extruder_count();
1222 auto extruders = m_preset_bundle->printers.get_edited_preset().config.option<ConfigOptionEnumsGeneric>("extruder_type");
1223 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
1224
1225 std::set<int> all_config_indices;
1226 for (int extruder_id = 0; extruder_id < extruder_count; ++extruder_id) {
1229 int config_index = m_config->get_index_for_extruder(
1230 extruder_id + 1,
1231 variant_keys.first,
1232 ExtruderType(extruders->values[extruder_id]),
1234 variant_keys.second
1235 );
1236 if (config_index >= 0) {
1237 all_config_indices.insert(config_index);
1238 }
1239 }
1240 }
1241
1242 auto dirty_options = m_presets->current_dirty_options(true);
1243 auto nonsys_options = m_presets->current_different_from_parent_options(true);
1245 update_custom_dirty(dirty_options, nonsys_options);
1246 auto filter_extruder_options = [](const std::vector<std::string>& options) {
1247 std::vector<std::string> filtered_options;
1248 for (const auto& opt : options) {
1249 if (opt.find('#') != std::string::npos) {
1250 filtered_options.push_back(opt);
1251 }
1252 }
1253 return filtered_options;
1254 };
1255
1256 auto filtered_dirty_options = filter_extruder_options(dirty_options);
1257 auto filtered_nonsys_options = filter_extruder_options(nonsys_options);
1258
1259 for (int config_index : all_config_indices) {
1260 int status_value = m_opt_status_value;
1261 for (const auto &opt_key : filtered_dirty_options) {
1262 m_all_extruder_options_status[opt_key] = status_value & ~osInitValue;
1263 }
1264 for (const auto &opt_key : filtered_nonsys_options) {
1265 auto iter = m_all_extruder_options_status.find(opt_key);
1266 if (iter != m_all_extruder_options_status.end()) {
1267 iter->second &= ~osSystemValue;
1268 } else {
1269 m_all_extruder_options_status[opt_key] = status_value & ~osSystemValue;
1270 }
1271 }
1272 }
1273}
virtual void update_custom_dirty(std::vector< std::string > &dirty_options, std::vector< std::string > &nonsys_options)
Definition Tab.hpp:421

References Slic3r::GUI::extruder_variant_keys, Slic3r::get_valid_nozzle_volume_type(), m_all_extruder_options_status, m_config, m_extruder_switch, m_opt_status_value, m_preset_bundle, m_presets, m_type, m_variant_combo, Slic3r::nozzle_type(), osInitValue, osSystemValue, Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, update_all_extruder_options_status(), update_custom_dirty(), and Slic3r::GUI::variant_keys().

Referenced by update_all_extruder_options_status(), and update_changed_ui().

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

◆ update_btns_enabling()

void Slic3r::GUI::Tab::update_btns_enabling ( )
inherited
7365{
7366 // we can delete any preset from the physical printer
7367 // and any user preset
7368 const Preset& preset = m_presets->get_edited_preset();
7369 m_btn_delete_preset->Show((m_type == Preset::TYPE_PRINTER && m_preset_bundle->physical_printers.has_selection())
7370 || preset.can_overwrite());
7371
7372 //if (m_btn_edit_ph_printer)
7373 // m_btn_edit_ph_printer->SetToolTip( m_preset_bundle->physical_printers.has_selection() ?
7374 // _L("Edit physical printer") : _L("Add physical printer"));
7375}

References Slic3r::Preset::can_overwrite(), m_btn_delete_preset, m_preset_bundle, m_presets, m_type, Slic3r::Preset::TYPE_PRINTER, and update_btns_enabling().

Referenced by load_current_preset(), update_btns_enabling(), and update_preset_choice().

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

◆ update_changed_tree_ui()

void Slic3r::GUI::Tab::update_changed_tree_ui ( )
inherited
1439{
1440 if (m_options_list.empty()) {
1442 for (auto page : m_pages) {
1443 page->m_is_nonsys_values = false;
1444 }
1445 }
1446 return;
1447 }
1448 auto cur_item = m_tabctrl->GetFirstVisibleItem();
1449 if (cur_item < 0 || !m_tabctrl->IsVisible(cur_item))
1450 return;
1451
1452 auto selected_item = m_tabctrl->GetSelection();
1453 auto selection = selected_item >= 0 ? m_tabctrl->GetItemText(selected_item) : "";
1454
1455 while (cur_item >= 0) {
1456 auto title = m_tabctrl->GetItemText(cur_item);
1457 for (auto page : m_pages)
1458 {
1459 if (translate_category(page->title(), m_type) != title)
1460 continue;
1461 bool sys_page = true;
1462 bool modified_page = false;
1463 if (page->title() == "General") {
1464 std::initializer_list<const char*> optional_keys{ "extruders_count", "printable_area" };
1465 for (auto &opt_key : optional_keys) {
1466 get_sys_and_mod_flags(opt_key, sys_page, modified_page);
1467 }
1468 }
1469 if (page->title() == "Dependencies") {
1471 sys_page = m_presets->get_selected_preset_parent() != nullptr;
1472 modified_page = false;
1473 } else {
1475 get_sys_and_mod_flags("compatible_prints", sys_page, modified_page);
1476 get_sys_and_mod_flags("compatible_printers", sys_page, modified_page);
1477 }
1478 }
1479 if (page->title() == "Speed" || page->title() == "Motion ability" || page->title() == "Filament" || page->title() == "Setting Overrides" || page->title() == "Multimaterial" || is_printer_extruder_page(page.get())) {
1480 auto options = generate_extruder_options();
1481 for (size_t switch_index = 0; switch_index < options.size(); ++switch_index) {
1482 std::vector<PageShp> pages_to_check = { page };
1483 check_extruder_options_status(switch_index, sys_page, modified_page, pages_to_check);
1484 }
1485 }
1486 for (auto group : page->m_optgroups)
1487 {
1488 if (!sys_page && modified_page)
1489 break;
1490 for (const auto &kvp : group->opt_map()) {
1491 const std::string &opt_key = kvp.first;
1492 get_sys_and_mod_flags(opt_key, sys_page, modified_page);
1493 }
1494 }
1495
1496 const wxColor *clr = sys_page ? (m_is_default_preset ? &m_default_text_clr : &m_sys_label_clr) :
1497 (modified_page || m_type >= Preset::TYPE_COUNT) ? &m_modified_label_clr : &m_default_text_clr;
1498
1499 if (page->set_item_colour(clr))
1500 m_tabctrl->SetItemTextColour(cur_item, clr == &m_modified_label_clr ? *clr : StateColor(
1501 std::make_pair(0x6B6B6C, (int) StateColor::NotChecked),
1502 std::make_pair(*clr, (int) StateColor::Normal)));
1503
1504 page->m_is_nonsys_values = !sys_page;
1505 page->m_is_modified_values = modified_page;
1506
1507 if (selection == title) {
1508 m_is_nonsys_values = page->m_is_nonsys_values;
1509 m_is_modified_values = page->m_is_modified_values;
1510 }
1511 break;
1512 }
1513 auto next_item = m_tabctrl->GetNextVisible(cur_item);
1514 cur_item = next_item;
1515 }
1516}
void check_extruder_options_status(int index, bool &sys_extruder, bool &modified_extruder, const std::vector< PageShp > &pages_to_check)
Definition Tab.cpp:1309
std::vector< wxString > generate_extruder_options()
Definition Tab.cpp:8930
@ TYPE_PLATE
Definition Preset.hpp:256
static constexpr const std::initializer_list< const char * > optional_keys
Definition Preset.cpp:4072

References check_extruder_options_status(), generate_extruder_options(), get_sys_and_mod_flags(), is_printer_extruder_page(), m_default_text_clr, m_is_default_preset, m_is_modified_values, m_is_nonsys_values, m_modified_label_clr, m_options_list, m_pages, m_presets, m_sys_label_clr, m_tabctrl, m_type, StateColor::Normal, StateColor::NotChecked, Slic3r::optional_keys, title(), translate_category(), Slic3r::Preset::TYPE_COUNT, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PLATE, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, and update_changed_tree_ui().

Referenced by sys_color_changed(), update_changed_tree_ui(), update_changed_ui(), and update_mode().

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

◆ update_changed_ui()

void Slic3r::GUI::Tab::update_changed_ui ( )
inherited
1107{
1109 return;
1110
1111 const bool deep_compare = (m_type == Preset::TYPE_PRINTER || m_type == Preset::TYPE_PRINT || m_type == Preset::TYPE_FILAMENT
1113 auto dirty_options = m_presets->current_dirty_options(deep_compare);
1114 auto nonsys_options = m_presets->current_different_from_parent_options(deep_compare);
1115 if (m_type == Preset::TYPE_PRINTER && static_cast<TabPrinter*>(this)->m_printer_technology == ptFFF) {
1116 TabPrinter* tab = static_cast<TabPrinter*>(this);
1117 if (tab->m_initial_extruders_count != tab->m_extruders_count)
1118 dirty_options.emplace_back("extruders_count");
1119 if (tab->m_sys_extruders_count != tab->m_extruders_count)
1120 nonsys_options.emplace_back("extruders_count");
1121 }
1122
1123 update_custom_dirty(dirty_options, nonsys_options);
1125
1126 filter_diff_option(dirty_options);
1127 filter_diff_option(nonsys_options);
1128
1129 for (auto& it : m_options_list)
1130 it.second = m_opt_status_value;
1131
1132 for (auto opt_key : dirty_options) {
1133 auto iter = m_options_list.find(opt_key);
1134 if (iter != m_options_list.end())
1135 iter->second &= ~osInitValue;
1136 }
1137 for (auto opt_key : nonsys_options) {
1138 auto iter = m_options_list.find(opt_key);
1139 if (iter != m_options_list.end())
1140 iter->second &= ~osSystemValue;
1141 }
1142
1143 decorate();
1145
1146 wxTheApp->CallAfter([this]() {
1147 if (parent()) //To avoid a crash, parent should be exist for a moment of a tree updating
1149 });
1150 // BBS:
1152}
void update_undo_buttons()
Definition Tab.cpp:1518
void update_all_extruder_options_status()
Definition Tab.cpp:1214
void decorate()
Definition Tab.cpp:976
void update_extruder_switch_colors()
Definition Tab.cpp:1275
void filter_diff_option(std::vector< std::string > &options)
Definition Tab.cpp:1087

References decorate(), filter_diff_option(), Slic3r::GUI::TabPrinter::m_extruders_count, Slic3r::GUI::TabPrinter::m_initial_extruders_count, m_opt_status_value, m_options_list, m_postpone_update_ui, m_presets, Slic3r::GUI::TabPrinter::m_sys_extruders_count, m_type, osInitValue, osSystemValue, parent(), Slic3r::ptFFF, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_MODEL, Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, Slic3r::Preset::TYPE_SLA_MATERIAL, update_all_extruder_options_status(), update_changed_tree_ui(), update_custom_dirty(), update_extruder_switch_colors(), and update_undo_buttons().

Referenced by activate_selected_page(), compatible_widget_create(), Slic3r::GUI::TabPrinter::create_bed_shape_widget(), create_preset_tab(), load_current_preset(), Slic3r::GUI::TabPrintModel::on_value_change(), Slic3r::GUI::TabPrintPlate::on_value_change(), Slic3r::anonymous_namespace{PluginHostPresets.cpp}::reload_local_bundle(), save_preset(), switch_excluder(), sync_excluder(), update_dirty(), and update_pages_with_multi_variant().

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

◆ update_current_page_in_background()

bool Slic3r::GUI::Tab::update_current_page_in_background ( int & item)
inherited
7901{
7902 Page* page = nullptr;
7903
7904 const auto selection = item >= 0 ? m_tabctrl->GetItemText(item) : "";
7905 for (auto p : m_pages)
7906 if (translate_category(p->title(), m_type) == selection)
7907 {
7908 page = p.get();
7909 break;
7910 }
7911
7912 if (page == nullptr || m_active_page == page)
7913 return false;
7914
7915 bool active_tab = false;
7916 if (wxGetApp().mainframe != nullptr && wxGetApp().mainframe->is_active_and_shown_tab(m_parent))
7917 active_tab = true;
7918
7919 if (!active_tab || (!m_parent->is_active_and_shown_tab((wxPanel*)this)))
7920 {
7921 m_is_nonsys_values = page->m_is_nonsys_values;
7922 m_is_modified_values = page->m_is_modified_values;
7923 // BBS: not need active
7924 // m_active_page = page;
7925
7926 // invalidated highlighter, if any exists
7927 m_highlighter.invalidate();
7928
7929 // clear pages from the controlls
7930 // BBS: fix after new layout, clear page in backgroud
7931 for (auto p : m_pages)
7932 p->clear();
7933 if (m_parent->is_active_and_shown_tab((wxPanel*)this))
7934 m_parent->clear_page();
7935
7937
7938 // BBS: this is not used, because we not SelectItem in background
7939 //todo: update selected item of tree_ctrl
7940 // wxTreeItemData item_data;
7941 // m_tabctrl->SetItemData(item, &item_data);
7942
7943 return false;
7944 }
7945
7946 return true;
7947}
struct Slic3r::GUI::Tab::Highlighter m_highlighter

References m_active_page, m_highlighter, Slic3r::GUI::Page::m_is_modified_values, m_is_modified_values, Slic3r::GUI::Page::m_is_nonsys_values, m_is_nonsys_values, m_pages, m_parent, m_tabctrl, m_type, translate_category(), update_current_page_in_background(), and update_undo_buttons().

Referenced by rebuild_page_tree(), and update_current_page_in_background().

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

◆ update_custom_dirty()

void Slic3r::GUI::TabPrinter::update_custom_dirty ( std::vector< std::string > & dirty_options,
std::vector< std::string > & nonsys_options )
overrideprotectedvirtual

Reimplemented from Slic3r::GUI::Tab.

9042{
9043 drop_unchanged_added_entries(dirty_options, *m_config, &m_presets->get_selected_preset());
9044 drop_unchanged_added_entries(nonsys_options, *m_config, m_presets->get_selected_preset_parent());
9045}
static void drop_unchanged_added_entries(std::vector< std::string > &options, const DynamicPrintConfig &current, const Preset *reference)
Definition Tab.cpp:1187

References Slic3r::GUI::drop_unchanged_added_entries(), Slic3r::GUI::Tab::m_config, Slic3r::GUI::Tab::m_presets, and update_custom_dirty().

Referenced by update_custom_dirty().

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

◆ update_description_lines()

void Slic3r::GUI::Tab::update_description_lines ( )
virtualinherited

Reimplemented in Slic3r::GUI::TabFilament, Slic3r::GUI::TabPrint, and Slic3r::GUI::TabSLAPrint.

7873{
7874 if (m_active_page && m_active_page->title() == "Dependencies" && m_parent_preset_description_line)
7876}
void update_preset_description_line()
Definition Tab.cpp:2873

References m_active_page, m_parent_preset_description_line, update_description_lines(), and update_preset_description_line().

Referenced by activate_selected_page(), Slic3r::GUI::TabPrinter::update(), Slic3r::GUI::TabSLAMaterial::update(), update_description_lines(), Slic3r::GUI::TabFilament::update_description_lines(), Slic3r::GUI::TabPrint::update_description_lines(), Slic3r::GUI::TabSLAPrint::update_description_lines(), and update_visibility().

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

◆ update_dirty()

void Slic3r::GUI::Tab::update_dirty ( )
inherited
1611{
1613 return;
1614
1615 if (m_presets_choice) {
1616 m_presets_choice->update_dirty();
1618 } else {
1619 m_presets->update_dirty();
1620 }
1622}

References m_postpone_update_ui, m_presets, m_presets_choice, on_presets_changed(), update_changed_ui(), and update_dirty().

Referenced by apply_config_from_cache(), apply_preset_config_values(), Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrinter::build_fff(), Slic3r::GUI::TabPrinter::build_unregular_pages(), edit_custom_gcode(), get_config_manipulation(), load_config(), on_roll_back_value(), Slic3r::GUI::TabFilament::on_value_change(), Slic3r::GUI::TabPrinter::on_value_change(), Slic3r::GUI::TabFilament::toggle_options(), update_dirty(), Slic3r::GUI::TabPrintModel::update_model_config(), Slic3r::GUI::validate_custom_gcode_cb(), and Slic3r::GUI::validate_custom_gcode_cb().

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

◆ update_extruder_switch_colors()

void Slic3r::GUI::Tab::update_extruder_switch_colors ( )
inherited
1276{
1278 return;
1279 }
1280
1281 auto options = generate_extruder_options();
1282
1283 std::vector<PageShp> pages_to_check;
1284 if (m_active_page) {
1285 const wxString t = m_active_page->title();
1286 if (t == "Speed" || t == "Motion ability" || t == "Filament" ||
1287 t == "Setting Overrides" || t == "Multimaterial" || is_printer_extruder_page(m_active_page)) {
1288 for (auto &p : m_pages){
1289 if (p.get() == m_active_page) {
1290 pages_to_check.push_back(p);
1291 break;
1292 }
1293 }
1294 }
1295 }
1296
1297 for (size_t switch_index = 0; switch_index < options.size(); ++switch_index) {
1298 bool sys_extruder = true;
1299 bool modified_extruder = false;
1300 if (!pages_to_check.empty())
1301 check_extruder_options_status((int) switch_index, sys_extruder, modified_extruder, pages_to_check);
1302 // no matching page: clear the flag so the tag doesn't keep a stale color
1303
1304 if (m_extruder_switch) m_extruder_switch->SetModified(switch_index, modified_extruder);
1305 if (m_variant_combo) m_variant_combo->SetModified(switch_index, modified_extruder);
1306 }
1307}

References check_extruder_options_status(), generate_extruder_options(), is_printer_extruder_page(), m_active_page, m_extruder_switch, m_pages, m_variant_combo, and update_extruder_switch_colors().

Referenced by update_changed_ui(), update_extruder_switch_colors(), and update_extruder_variants().

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

◆ update_extruder_variants()

void Slic3r::GUI::Tab::update_extruder_variants ( int extruder_id = -1,
bool reload = true )
inherited

Call from: 1: on_value_change "nozzle_volume_type" 2: on_preset_loaded (extruder_id = -1).

Parameters
extruder_id
8836{
8837 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << extruder_id;
8838 if (m_extruder_switch) {
8839 auto nozzle_volumes = m_preset_bundle->project_config.option<ConfigOptionEnumsGeneric>("nozzle_volume_type");
8840 int extruder_nums = m_preset_bundle->get_printer_extruder_count();
8841 nozzle_volumes->values.resize(extruder_nums);
8842
8843 // Orca: update `m_actual_nozzle_volumes` to current selected ones
8845 for (int i = 0; i < extruder_nums; i++) m_actual_nozzle_volumes[i] = (NozzleVolumeType)nozzle_volumes->values[i];
8846
8847 // Orca: when every extruder uses the same variant (e.g. a non-Bambu dual-nozzle printer), the
8848 // switch has no nozzle variants to select and nothing to sync. The printer tab still enables it
8849 // to choose the extruder its Extruder and Motion ability pages edit.
8850 m_extruder_switch_variants = extruder_nums >= 2 && m_preset_bundle->support_different_extruders();
8851 if (m_extruder_switch_variants || (m_type == Preset::TYPE_PRINTER && extruder_nums >= 2)) {
8852 auto options = generate_extruder_options();
8853 m_extruder_switch->SetOptions(options);
8854 int item_n = options.empty() ? 0 : options.size();
8855 if (m_type == Preset::TYPE_PRINTER){ // we are on printer settings dialog and larger padding can be used
8856 int h_pad = item_n > 8 ? 6 : (item_n > 6 ? 9 : (item_n > 5 ? 12 : (item_n > 4 ? 18 : (item_n > 3 ? 24 : (item_n > 2 ? 36 : 48)))));
8857 m_extruder_switch->SetButtonPadding(wxSize(h_pad, 3));
8858 }
8859 else {
8860 int h_pad = item_n > 6 ? 6 : (item_n > 4 ? 10 : (item_n > 2 ? 20 : 36));
8861 m_extruder_switch->SetButtonPadding(wxSize(h_pad, 3));
8862 }
8863
8864 int selection_index;
8865 if (extruder_id >= 0) {
8866 NozzleVolumeType current_nozzle_type = get_actual_nozzle_volume_type(extruder_id);
8867 selection_index = calculate_selection_index_for_extruder(extruder_id, current_nozzle_type);
8868 } else {
8869 selection_index = m_extruder_switch->GetSelection();
8870 if (selection_index < 0) {
8871 selection_index = 0;
8872 }
8873 }
8874
8875 m_extruder_switch->SetSelection(selection_index);
8876 m_extruder_switch->Enable(true);
8877 m_extruder_sync->Enable(true);
8878 } else {
8879 m_extruder_switch->Enable(false);
8880 m_extruder_sync->Enable(false);
8881 }
8882 } else if (m_variant_combo) {
8883 if (extruder_id >= 0)
8884 return;
8885
8886 const int selection = m_variant_combo->GetSelection();
8887 auto options = generate_extruder_options();
8888 m_variant_combo->SetOptions(options);
8889 int item_n = options.empty() ? 0 : options.size();
8890 int h_pad = item_n > 6 ? 6 : (item_n > 4 ? 8 : (item_n > 2 ? 20 : 36));
8891 m_variant_combo->SetButtonPadding(wxSize(h_pad, 3));
8892
8893 if (!options.empty())
8894 m_variant_combo->SetSelection(selection < 0 || selection >= (int) options.size() ? 0 : selection);
8895
8896 m_variant_combo->Enable(options.size() > 1);
8897 }
8898 switch_excluder(extruder_id, reload);
8899 if (m_type == Preset::TYPE_PRINT) {
8901 }
8904}
void update_pages_with_multi_variant()
Definition Tab.cpp:5353

References calculate_selection_index_for_extruder(), generate_extruder_options(), get_actual_nozzle_volume_type(), m_actual_nozzle_volumes, m_extruder_switch, m_extruder_switch_variants, m_extruder_sync, m_preset_bundle, m_type, m_variant_combo, Slic3r::nvtStandard, switch_excluder(), Slic3r::Preset::TYPE_PRINT, Slic3r::Preset::TYPE_PRINTER, update_extruder_switch_colors(), update_extruder_variants(), update_pages_with_multi_variant(), and update_variant_sizer_visibility().

Referenced by load_current_preset(), and update_extruder_variants().

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

◆ update_fff()

void Slic3r::GUI::TabPrinter::update_fff ( )
7057{
7058 // Sync IDEX/IQEX tool grid whenever carriage configuration changes.
7059 // set_grid_size() is a no-op when dimensions and layout are unchanged.
7060 // load_from_config() is gated on matches_config() — without that guard,
7061 // every keystroke in a row's textbox would destroy and rebuild the widget
7062 // (because notify() writes config → update_fff() runs → load_from_config()
7063 // detaches the textbox the user is typing in). The page-level reset still
7064 // refreshes the rows because that path actually changes the config, which
7065 // matches_config() then detects.
7066 if (m_imex_modes_ctrl) {
7067 int n_cols = 0, n_rows = 0, layout = 0;
7068 imex_grid_shape(m_config, n_cols, n_rows, layout);
7069 m_imex_modes_ctrl->set_grid_size(n_cols, n_rows, layout);
7070 if (!m_imex_modes_ctrl->matches_config(*m_config))
7071 m_imex_modes_ctrl->load_from_config(*m_config);
7072 }
7073
7074 // Belt printer: auto-sync build_plate_tilt_{x,y} (which drives support gravity tilt)
7075 // from the belt slicing rotation, the single source of truth for the physical tilt.
7076 // Tilt about X drives tilt_x, tilt about Y drives tilt_y.
7077 //
7078 // R8: value-guessing (zeroing any tilt matching the dormant belt-derived tilt) wiped a
7079 // legitimate manual build_plate_tilt on a non-belt tilted-bed printer, because the belt
7080 // defaults (rotation=X, angle=45) make a manual tilt of 45 look belt-derived. Instead we
7081 // track the belt->non-belt transition and the exact values belt-sync wrote, and clear the
7082 // tilt only on a genuine in-place belt-off toggle, and only if the value is still what
7083 // belt-sync last wrote. Preset switches reset the tracking in on_preset_loaded(), so they
7084 // never trip the reset.
7085 if (m_config->opt_bool("belt_printer")) {
7086 auto rot_axis = m_config->option<ConfigOptionEnum<BeltRotationAxis>>("belt_slice_rotation")->value;
7087 const auto tilt = BeltTransformPipeline::physical_tilt(
7088 rot_axis, m_config->opt_float("belt_slice_rotation_angle"));
7089 if (m_config->opt_float("build_plate_tilt_x") != tilt.tilt_x_deg)
7090 m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(tilt.tilt_x_deg));
7091 if (m_config->opt_float("build_plate_tilt_y") != tilt.tilt_y_deg)
7092 m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(tilt.tilt_y_deg));
7093 // Remember exactly what belt-sync wrote, so an in-place belt-off toggle can distinguish
7094 // a still-belt-derived tilt (safe to clear) from a since-edited manual one (keep).
7095 m_belt_synced_tilt_x = tilt.tilt_x_deg;
7096 m_belt_synced_tilt_y = tilt.tilt_y_deg;
7097 } else if (m_was_belt_printer) {
7098 // Genuine in-place belt->off toggle on the same preset (on_preset_loaded() was not called
7099 // since the last update, so m_was_belt_printer still reflects belt mode). Clear each axis
7100 // only if it still holds the value belt-sync last wrote; a manual override is preserved.
7101 if (m_config->opt_float("build_plate_tilt_x") == m_belt_synced_tilt_x)
7102 m_config->set_key_value("build_plate_tilt_x", new ConfigOptionFloat(0.));
7103 if (m_config->opt_float("build_plate_tilt_y") == m_belt_synced_tilt_y)
7104 m_config->set_key_value("build_plate_tilt_y", new ConfigOptionFloat(0.));
7105 }
7106 m_was_belt_printer = m_config->opt_bool("belt_printer");
7107
7109}
static PhysicalTilt physical_tilt(BeltRotationAxis axis, double angle_deg)
Definition BeltTransform.hpp:73
void toggle_options() override
Definition Tab.cpp:6649
zaa_minimize_perimeter_height ConfigOptionFloat
Definition PrintConfig.hpp:1954

References Slic3r::ConfigOptionFloat, Slic3r::GUI::imex_grid_shape(), m_belt_synced_tilt_x, m_belt_synced_tilt_y, Slic3r::GUI::Tab::m_config, m_imex_modes_ctrl, m_was_belt_printer, Slic3r::BeltTransformPipeline::physical_tilt(), toggle_options(), and update_fff().

Referenced by update(), and update_fff().

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

◆ update_frequently_changed_parameters()

void Slic3r::GUI::Tab::update_frequently_changed_parameters ( )
protectedinherited
2958{
2959 const bool is_fff = supports_printer_technology(ptFFF);
2960 auto og_freq_chng_params = wxGetApp().sidebar().og_freq_chng_params(is_fff);
2961 if (!og_freq_chng_params) return;
2962
2963 og_freq_chng_params->set_value("support", support_combo_value_for_config(*m_config, is_fff));
2964 if (! is_fff)
2965 og_freq_chng_params->set_value("pad", pad_combo_value_for_config(*m_config));
2966
2967 const std::string updated_value_key = is_fff ? "sparse_infill_density" : "pad_enable";
2968
2969 const boost::any val = og_freq_chng_params->get_config_value(*m_config, updated_value_key);
2970 og_freq_chng_params->set_value(updated_value_key, val);
2971
2972 if (is_fff)
2973 {
2974 og_freq_chng_params->set_value("brim", bool(m_config->opt_float("brim_width") > 0.0));
2976 }
2977}
void update_wiping_button_visibility()
Definition Tab.cpp:2645
virtual bool supports_printer_technology(const PrinterTechnology tech) const =0
static wxString support_combo_value_for_config(const DynamicPrintConfig &config, bool is_fff)
Definition Tab.cpp:2032
static wxString pad_combo_value_for_config(const DynamicPrintConfig &config)
Definition Tab.cpp:2055

References m_config, Slic3r::GUI::pad_combo_value_for_config(), Slic3r::ptFFF, Slic3r::GUI::support_combo_value_for_config(), supports_printer_technology(), update_frequently_changed_parameters(), and update_wiping_button_visibility().

Referenced by load_current_preset(), and update_frequently_changed_parameters().

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

◆ update_input_shaper_menu()

void Slic3r::GUI::TabPrinter::update_input_shaper_menu ( GCodeFlavor flavor)
private
6580{
6581 if (m_presets->get_edited_preset().printer_technology() != ptFFF)
6582 return;
6583
6584 const std::vector<InputShaperType> allowed = input_shaper_types_for_flavor(flavor);
6585 if (allowed.empty())
6586 return;
6587
6588 const InputShaperType current = m_config->opt_enum<InputShaperType>("input_shaping_type");
6589 const bool needs_reset = std::find(allowed.begin(), allowed.end(), current) == allowed.end();
6590 const InputShaperType desired = needs_reset ? allowed.front() : current;
6591
6592 if (needs_reset && current != desired) {
6593 DynamicPrintConfig new_conf = *m_config;
6594 new_conf.set_key_value("input_shaping_type", new ConfigOptionEnum<InputShaperType>(desired));
6595 m_config_manipulation.apply(m_config, &new_conf);
6596 }
6597
6598 Page* owning_page = nullptr;
6599 Field* field = get_field("input_shaping_type", &owning_page);
6600 if (field == nullptr)
6601 return;
6602
6603 auto choice_field = dynamic_cast<Choice*>(field);
6604 if (choice_field == nullptr)
6605 return;
6606
6607 auto combo = dynamic_cast<ComboBox*>(choice_field->getWindow());
6608 if (combo == nullptr)
6609 return;
6610
6611 const ConfigOptionDef* def = m_config->def()->get("input_shaping_type");
6612 if (def == nullptr)
6613 return;
6614
6615 const auto& labels = def->enum_labels;
6616 const auto& values = def->enum_values;
6617
6618 wxWindowUpdateLocker locker(combo);
6619 combo->Clear();
6620
6621 for (InputShaperType type : allowed) {
6622 const size_t idx = static_cast<size_t>(type);
6623 wxString label;
6624 if (idx < labels.size() && !labels[idx].empty())
6625 label = _(labels[idx]);
6626 else if (idx < values.size())
6627 label = wxString::FromUTF8(values[idx].c_str());
6628 else
6629 label = wxString::Format("%d", static_cast<int>(type));
6630
6631 combo->Append(label, wxNullBitmap,
6632 reinterpret_cast<void*>(static_cast<uintptr_t>(static_cast<int>(type))));
6633 }
6634
6635 if (combo->GetCount() == 0)
6636 return;
6637
6638 choice_field->set_value(static_cast<int>(desired), false);
6639}
std::vector< InputShaperType > input_shaper_types_for_flavor(GCodeFlavor flavor)
Definition Tab.cpp:6540
InputShaperType
Definition PrintConfig.hpp:565

References _, Slic3r::ConfigOptionDef::enum_labels, Slic3r::ConfigOptionDef::enum_values, Slic3r::GUI::Tab::get_field(), Slic3r::GUI::input_shaper_types_for_flavor(), Slic3r::GUI::Tab::m_config, Slic3r::GUI::Tab::m_config_manipulation, Slic3r::GUI::Tab::m_presets, Slic3r::ptFFF, Slic3r::DynamicConfig::set_key_value(), Slic3r::GUI::Tab::type(), and update_input_shaper_menu().

Referenced by on_gcode_flavor_changed(), toggle_options(), and update_input_shaper_menu().

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

◆ update_label_colours()

void Slic3r::GUI::Tab::update_label_colours ( )
inherited
918{
919 m_default_text_clr = wxGetApp().get_label_clr_default();
920 if (m_sys_label_clr == wxGetApp().get_label_clr_sys() && m_modified_label_clr == wxGetApp().get_label_clr_modified())
921 return;
922 m_sys_label_clr = wxGetApp().get_label_clr_sys();
923 m_modified_label_clr = wxGetApp().get_label_clr_modified();
924
925 //update options "decoration"
926 for (const auto& opt : m_options_list)
927 {
928 const wxColour *color = &m_sys_label_clr;
929
930 // value isn't equal to system value
931 if ((opt.second & osSystemValue) == 0) {
932 // value is equal to last saved
933 if ((opt.second & osInitValue) != 0)
934 color = &m_default_text_clr;
935 // value is modified
936 else
937 color = &m_modified_label_clr;
938 }
939 if (opt.first == "printable_area" ||
940 opt.first == "compatible_prints" || opt.first == "compatible_printers" ) {
941 if (Line* line = get_line(opt.first))
942 line->set_label_colour(color);
943 continue;
944 }
945
946 Field* field = get_field(opt.first);
947 if (field == nullptr) continue;
948 field->set_label_colour(color);
949 }
950
951 auto cur_item = m_tabctrl->GetFirstVisibleItem();
952 if (cur_item < 0 || !m_tabctrl->IsVisible(cur_item))
953 return;
954 while (cur_item >= 0) {
955 auto title = m_tabctrl->GetItemText(cur_item);
956 for (auto page : m_pages)
957 {
958 if (translate_category(page->title(), m_type) != title)
959 continue;
960
961 const wxColor *clr = !page->m_is_nonsys_values ? &m_sys_label_clr :
962 page->m_is_modified_values ? &m_modified_label_clr :
964
965 m_tabctrl->SetItemTextColour(cur_item, clr == &m_modified_label_clr ? *clr : StateColor(
966 std::make_pair(0x6B6B6C, (int) StateColor::NotChecked),
967 std::make_pair(*clr, (int) StateColor::Normal)));
968 break;
969 }
970 cur_item = m_tabctrl->GetNextVisible(cur_item);
971 }
972
973 decorate();
974}

References decorate(), get_field(), get_line(), m_default_text_clr, m_modified_label_clr, m_options_list, m_pages, m_sys_label_clr, m_tabctrl, m_type, StateColor::Normal, StateColor::NotChecked, osInitValue, osSystemValue, Slic3r::GUI::UndoValueUIManager::set_label_colour(), title(), translate_category(), and Slic3r::Preset::TYPE_COUNT.

Referenced by sys_color_changed().

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

◆ update_mode()

void Slic3r::GUI::Tab::update_mode ( )
inherited
1792{
1793 m_mode = wxGetApp().get_mode();
1794
1795 // toggle_options reads m_mode to gate Lines whose contents are mode-mixed
1796 // (e.g., a multi-option row where some options are Advanced and some Expert):
1797 // when all of a Line's options would be hidden, we hide the Line itself.
1798 // Without refreshing here, the toggle_visible state stays stale across mode
1799 // switches and Lines stay hidden.
1801
1803
1805}

References m_mode, toggle_options(), update_changed_tree_ui(), update_mode(), and update_visibility().

Referenced by update_mode().

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

◆ update_pages()

void Slic3r::GUI::TabPrinter::update_pages ( )
6463{
6464 // update m_pages ONLY if printer technology is changed
6465 const PrinterTechnology new_printer_technology = m_presets->get_edited_preset().printer_technology();
6466 if (new_printer_technology == m_printer_technology)
6467 return;
6468
6469 //clear all active pages before switching
6470 clear_pages();
6471
6472 // set m_pages to m_pages_(technology before changing)
6474
6475 // build Tab according to the technology, if it's not exist jet OR
6476 // set m_pages_(technology after changing) to m_pages
6477 // m_printer_technology will be set by Tab::load_current_preset()
6478 if (new_printer_technology == ptFFF)
6479 {
6480 if (m_pages_fff.empty())
6481 {
6482 build_fff();
6483 if (m_extruders_count > 1)
6484 {
6485 m_preset_bundle->update_multi_material_filament_presets();
6486 on_value_change("extruders_count", m_extruders_count);
6487 }
6488 }
6489 else
6490 m_pages.swap(m_pages_fff);
6491
6492 wxGetApp().obj_list()->update_objects_list_filament_column(m_extruders_count);
6493 }
6494 else
6495 m_pages_sla.empty() ? build_sla() : m_pages.swap(m_pages_sla);
6496
6498}
std::vector< PageShp > m_pages_sla
Definition Tab.hpp:731
std::vector< PageShp > m_pages_fff
Definition Tab.hpp:730
void clear_pages() override
Definition Tab.cpp:6533

References build_fff(), build_sla(), clear_pages(), m_extruders_count, Slic3r::GUI::Tab::m_pages, m_pages_fff, m_pages_sla, Slic3r::GUI::Tab::m_preset_bundle, Slic3r::GUI::Tab::m_presets, m_printer_technology, on_value_change(), Slic3r::ptFFF, Slic3r::GUI::Tab::rebuild_page_tree(), and update_pages().

Referenced by update_pages().

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

◆ update_pages_with_multi_variant()

void Slic3r::GUI::Tab::update_pages_with_multi_variant ( )
inherited
5354{
5355 if (!m_active_page) {
5356 return;
5357 }
5358 // TODO: Orca: support multi variant field
5359 //for (auto optgroup : m_active_page->m_optgroups) {
5360 // Field *multi_variant_field = nullptr;
5361 // std::string opt_key;
5362
5363 // for (const auto& opt : multi_variant_text_ctrl_options) {
5364 // Field* field = optgroup->get_fieldc(opt, 0);
5365 // if (field) {
5366 // auto *multi_variant = dynamic_cast<MultiVariantTextCtrl *>(field);
5367 // if (multi_variant) {;
5368 // multi_variant_field = field;
5369 // opt_key = opt;
5370 // }
5371 // break;
5372 // }
5373 // }
5374 // if (multi_variant_field) {
5375 // auto * multi_variant_ctrl = dynamic_cast<MultiVariantTextCtrl*>(multi_variant_field);
5376 // multi_variant_ctrl->refresh_text_ctrls_layout(optgroup->ctrl_parent());
5377 // if (optgroup->custom_ctrl) {
5378 // optgroup->custom_ctrl->update_line_height_for_field(opt_key);
5379 // }
5380 // }
5381 // m_page_view->GetParent()->Layout();
5382 // m_parent->Layout();
5383 //}
5385}

References m_active_page, update_changed_ui(), and update_pages_with_multi_variant().

Referenced by update_extruder_variants(), and update_pages_with_multi_variant().

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

◆ update_preset_choice()

void Slic3r::GUI::Tab::update_preset_choice ( )
inherited
7378{
7379 if (m_presets_choice)
7380 m_presets_choice->update();
7382}

References m_presets_choice, update_btns_enabling(), and update_preset_choice().

Referenced by update_preset_choice().

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

◆ update_preset_description_line()

void Slic3r::GUI::Tab::update_preset_description_line ( )
protectedinherited
2874{
2875 const Preset* parent = m_presets->get_selected_preset_parent();
2876 const Preset& preset = m_presets->get_edited_preset();
2877
2878 wxString description_line;
2879
2880 if (preset.is_default) {
2881 description_line = _(L("This is a default preset."));
2882 } else if (preset.is_system) {
2883 description_line = _(L("This is a system preset."));
2884 } else if (parent == nullptr) {
2885 description_line = _(L("Current preset is inherited from the default preset."));
2886 } else {
2887 std::string name = parent->name;
2888 boost::replace_all(name, "&", "&&");
2889 description_line = _(L("Current preset is inherited from")) + ":\n\t" + from_u8(name);
2890 }
2891
2892 if (preset.is_default || preset.is_system)
2893 description_line += "\n\t" + _(L("It can't be deleted or modified.")) +
2894 "\n\t" + _(L("Any modifications should be saved as a new preset inherited from this one.")) +
2895 "\n\t" + _(L("To do that please specify a new name for the preset."));
2896
2897 if (parent && parent->vendor)
2898 {
2899 description_line += "\n\n" + _(L("Additional information:")) + "\n";
2900 description_line += "\t" + _(L("vendor")) + ": " + (m_type == Slic3r::Preset::TYPE_PRINTER ? "\n\t\t" : "") + parent->vendor->name +
2901 // TRN Short for "version"
2902 ", " + _L("ver") + ": " + parent->vendor->config_version.to_string();
2904 const std::string &printer_model = preset.config.opt_string("printer_model");
2905 if (! printer_model.empty())
2906 description_line += "\n\n\t" + _(L("printer model")) + ": \n\t\t" + printer_model;
2907 switch (preset.printer_technology()) {
2908 case ptFFF:
2909 {
2910 //FIXME add prefered_sla_material_profile for SLA
2911 const std::string &default_print_profile = preset.config.opt_string("default_print_profile");
2912 const std::vector<std::string> &default_filament_profiles = preset.config.option<ConfigOptionStrings>("default_filament_profile")->values;
2913 if (!default_print_profile.empty())
2914 description_line += "\n\n\t" + _(L("default print profile")) + ": \n\t\t" + default_print_profile;
2915 if (!default_filament_profiles.empty())
2916 {
2917 description_line += "\n\n\t" + _(L("default filament profile")) + ": \n\t\t";
2918 for (auto& profile : default_filament_profiles) {
2919 if (&profile != &*default_filament_profiles.begin())
2920 description_line += ", ";
2921 description_line += profile;
2922 }
2923 }
2924 break;
2925 }
2926 case ptSLA:
2927 {
2928 //FIXME add prefered_sla_material_profile for SLA
2929 const std::string &default_sla_material_profile = preset.config.opt_string("default_sla_material_profile");
2930 if (!default_sla_material_profile.empty())
2931 description_line += "\n\n\t" + _(L("default SLA material profile")) + ": \n\t\t" + default_sla_material_profile;
2932
2933 const std::string &default_sla_print_profile = preset.config.opt_string("default_sla_print_profile");
2934 if (!default_sla_print_profile.empty())
2935 description_line += "\n\n\t" + _(L("default SLA print profile")) + ": \n\t\t" + default_sla_print_profile;
2936 break;
2937 }
2938 default: break;
2939 }
2940 }
2941 else if (!preset.alias.empty())
2942 {
2943 description_line += "\n\n\t" + _(L("full profile name")) + ": \n\t\t" + preset.name;
2944 description_line += "\n\t" + _(L("symbolic profile name")) + ": \n\t\t" + preset.alias;
2945 }
2946 }
2947
2948 m_parent_preset_description_line->SetText(description_line, false);
2949
2951 m_detach_preset_btn->Show(parent && parent->is_system && !preset.is_default);
2952 //BBS: GUI refactor
2953 //Layout();
2954 m_parent->Layout();
2955}

References _, _L, Slic3r::Preset::alias, Slic3r::Preset::config, Slic3r::from_u8(), Slic3r::Preset::is_default, Slic3r::Preset::is_system, L, m_detach_preset_btn, m_parent, m_parent_preset_description_line, m_presets, m_type, name(), Slic3r::Preset::name, Slic3r::DynamicConfig::opt_string(), Slic3r::ConfigBase::option(), parent(), Slic3r::Preset::printer_technology(), Slic3r::ptFFF, Slic3r::ptSLA, Slic3r::Preset::TYPE_PRINTER, and update_preset_description_line().

Referenced by update_description_lines(), and update_preset_description_line().

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

◆ update_printer_agent_if_needed()

void Slic3r::GUI::Tab::update_printer_agent_if_needed ( )
protectedinherited

◆ update_saved_preset_from_current_preset()

void Slic3r::GUI::Tab::update_saved_preset_from_current_preset ( )
inherited
5388{ m_presets->update_saved_preset_from_current_preset(); }

References m_presets, and update_saved_preset_from_current_preset().

Referenced by update_saved_preset_from_current_preset().

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

◆ update_show_hide_incompatible_button()

void Slic3r::GUI::Tab::update_show_hide_incompatible_button ( )
inherited
8397{
8398 //BBS: GUI refactor
8399 /*m_btn_hide_incompatible_presets->SetBitmap_(m_show_incompatible_presets ?
8400 m_bmp_show_incompatible_presets : m_bmp_hide_incompatible_presets);
8401 m_btn_hide_incompatible_presets->SetToolTip(m_show_incompatible_presets ?
8402 "Both compatible an incompatible presets are shown. Click to hide presets not compatible with the current printer." :
8403 "Only compatible presets are shown. Click to show both the presets compatible and not compatible with the current printer.");*/
8404}

References update_show_hide_incompatible_button().

Referenced by toggle_show_hide_incompatible(), update_show_hide_incompatible_button(), and update_ui_from_settings().

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

◆ update_sla()

void Slic3r::GUI::TabPrinter::update_sla ( )
7112{ ; }

References update_sla().

Referenced by update(), and update_sla().

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

◆ update_tab_ui()

void Slic3r::GUI::Tab::update_tab_ui ( bool update_plater_presets = false)
inherited
1625{
1626 if (m_presets_choice) {
1627 m_presets_choice->update();
1628 if (update_plater_presets)
1630 }
1631}

References m_presets_choice, on_presets_changed(), and update_tab_ui().

Referenced by load_current_preset(), Slic3r::GUI::TabFilament::on_value_change(), Slic3r::GUI::TabPrinter::on_value_change(), save_preset(), select_preset(), toggle_show_hide_incompatible(), update_tab_ui(), and update_ui_from_settings().

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

◆ update_ui_from_settings()

void Slic3r::GUI::Tab::update_ui_from_settings ( )
inherited
8407{
8408 // Show the 'show / hide presets' button only for the print and filament tabs, and only if enabled
8409 // in application preferences.
8412 //BBS: GUI refactor
8413 //Layout();
8414 m_parent->Layout();
8415 //show ? m_btn_hide_incompatible_presets->Show() : m_btn_hide_incompatible_presets->Hide();
8416 // If the 'show / hide presets' button is hidden, hide the incompatible presets.
8417 if (show) {
8419 }
8420 else {
8423 update_tab_ui();
8424 }
8425 }
8426}
bool m_show_btn_incompatible_presets
Definition Tab.hpp:312

References m_parent, m_show_btn_incompatible_presets, m_show_incompatible_presets, m_type, Slic3r::Preset::TYPE_PRINTER, update_show_hide_incompatible_button(), update_tab_ui(), and update_ui_from_settings().

Referenced by update_ui_from_settings().

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

◆ update_ui_items_related_on_parent_preset()

void Slic3r::GUI::Tab::update_ui_items_related_on_parent_preset ( const Preset * selected_preset_parent)
inherited
7115{
7116 m_is_default_preset = selected_preset_parent != nullptr && selected_preset_parent->is_default;
7117
7118 m_bmp_non_system = selected_preset_parent ? &m_bmp_value_unlock : &m_bmp_white_bullet;
7119 m_ttg_non_system = selected_preset_parent ? &m_ttg_value_unlock : &m_ttg_white_bullet_ns;
7120 m_tt_non_system = selected_preset_parent ? &m_tt_value_unlock : &m_ttg_white_bullet_ns;
7121}

References Slic3r::Preset::is_default, m_bmp_non_system, m_bmp_value_unlock, m_bmp_white_bullet, m_is_default_preset, m_tt_non_system, m_tt_value_unlock, m_ttg_non_system, m_ttg_value_unlock, m_ttg_white_bullet_ns, and update_ui_items_related_on_parent_preset().

Referenced by load_current_preset(), save_preset(), and update_ui_items_related_on_parent_preset().

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

◆ update_undo_buttons()

void Slic3r::GUI::Tab::update_undo_buttons ( )
inherited
1519{
1520 // BBS: restore all pages in preset
1521 m_undo_btn-> SetBitmap_(m_presets->get_edited_preset().is_dirty ? m_bmp_value_revert: m_bmp_white_bullet);
1522 //m_undo_to_sys_btn-> SetBitmap_(m_is_nonsys_values ? *m_bmp_non_system : m_bmp_value_lock);
1523
1524 m_undo_btn->SetToolTip(m_presets->get_edited_preset().is_dirty ? _L("Click to reset all settings to the last saved preset.") : m_ttg_white_bullet);
1525 //m_undo_to_sys_btn->SetToolTip(m_is_nonsys_values ? *m_ttg_non_system : m_ttg_value_lock);
1526}
wxString m_ttg_white_bullet
Definition Tab.hpp:248

References _L, m_bmp_value_revert, m_bmp_white_bullet, m_presets, m_ttg_white_bullet, m_undo_btn, and update_undo_buttons().

Referenced by update_changed_ui(), update_current_page_in_background(), and update_undo_buttons().

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

◆ update_variant_sizer_visibility()

void Slic3r::GUI::Tab::update_variant_sizer_visibility ( )
inherited
9163{
9164 if (!m_variant_sizer)
9165 return;
9166 const bool show = variant_switch_active() && m_active_page && !m_active_page->m_opt_id_map.empty();
9167 m_main_sizer->Show(m_variant_sizer, show);
9168 if (m_extruder_sync) {
9169 m_extruder_sync->Show(show);
9170 // Orca: copying between extruders is offered only between nozzle variants, and not on the Extruder page.
9173 }
9174 GetParent()->Layout();
9175}

References get_current_active_extruder(), get_extruder_sync_enable_state(), is_printer_extruder_page(), m_active_page, m_extruder_switch_variants, m_extruder_sync, m_main_sizer, m_variant_sizer, update_variant_sizer_visibility(), and variant_switch_active().

Referenced by tree_sel_change_delayed(), update_extruder_variants(), and update_variant_sizer_visibility().

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

◆ update_visibility()

void Slic3r::GUI::Tab::update_visibility ( )
inherited
1808{
1809 Freeze(); // There is needed Freeze/Thaw to avoid a flashing after Show/Layout
1810
1811 for (auto page : m_pages)
1812 page->update_visibility(m_mode, page.get() == m_active_page);
1814
1817
1818 //BBS: GUI refactor
1819 //Layout();
1820 m_parent->Layout();
1821 Thaw();
1822}

References m_active_page, m_mode, m_pages, m_parent, m_type, rebuild_page_tree(), Slic3r::Preset::TYPE_SLA_PRINT, update_description_lines(), and update_visibility().

Referenced by load_current_preset(), update_mode(), and update_visibility().

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

◆ update_wiping_button_visibility()

void Slic3r::GUI::Tab::update_wiping_button_visibility ( )
inherited
2645 {
2646 if (m_preset_bundle->printers.get_selected_preset().printer_technology() == ptSLA)
2647 return; // ys_FIXME
2648 // Orca: it's not used
2649 //
2650 // bool wipe_tower_enabled = dynamic_cast<ConfigOptionBool*>( (m_preset_bundle->prints.get_edited_preset().config ).option("enable_prime_tower"))->value;
2651 // bool multiple_extruders = dynamic_cast<ConfigOptionFloats*>((m_preset_bundle->printers.get_edited_preset().config).option("nozzle_diameter"))->values.size() > 1;
2652 // auto wiping_dialog_button = wxGetApp().sidebar().get_wiping_dialog_button();
2653 // if (wiping_dialog_button) {
2654 // wiping_dialog_button->Show(wipe_tower_enabled && multiple_extruders);
2655 // wiping_dialog_button->GetParent()->Layout();
2656 // }
2657
2658}

References m_preset_bundle, Slic3r::ptSLA, and update_wiping_button_visibility().

Referenced by on_value_change(), update_frequently_changed_parameters(), and update_wiping_button_visibility().

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

◆ validate_custom_gcode()

bool Slic3r::GUI::Tab::validate_custom_gcode ( const wxString & title,
const std::string & gcode )
staticinherited
4334{
4335 std::vector<std::string> tags;
4336 bool invalid = GCodeProcessor::contains_reserved_tags(gcode, 5, tags, wxGetApp().preset_bundle->is_bbl_vendor());
4337 if (invalid) {
4338 std::string lines = ":\n";
4339 for (const std::string& keyword : tags)
4340 lines += ";" + keyword + "\n";
4341 wxString reports = format_wxstr(
4342 _L_PLURAL("Following line %s contains reserved keywords.\nPlease remove it, or G-code visualization and print time estimation will be broken.",
4343 "Following lines %s contain reserved keywords.\nPlease remove them, or G-code visualization and print time estimation will be broken.",
4344 tags.size()),
4345 lines);
4346 //wxMessageDialog dialog(wxGetApp().mainframe, reports, _L("Found reserved keywords in") + " " + _(title), wxICON_WARNING | wxOK);
4347 // TRN %1% is the name of the custom G-code setting, e.g. "Machine start G-code".
4348 MessageDialog dialog(wxGetApp().mainframe, reports, format_wxstr(_L("Reserved keywords found in %1%"), _(title)), wxICON_WARNING | wxOK);
4349 dialog.ShowModal();
4350 }
4351 return !invalid;
4352}
static bool contains_reserved_tags(const std::string &gcode, unsigned int max_count, std::vector< std::string > &found_tag, bool is_bbl_printer)
Definition GCodeProcessor.cpp:2789
static std::string gcode(Type type)
Definition IMSlider.cpp:111

References _, _L, _L_PLURAL, Slic3r::GCodeProcessor::contains_reserved_tags(), Slic3r::GUI::format_wxstr(), Slic3r::GUI::gcode(), Slic3r::GUI::DPIAware< P >::ShowModal(), and title().

Referenced by edit_custom_gcode(), Slic3r::GUI::validate_custom_gcode_cb(), Slic3r::GUI::validate_custom_gcode_cb(), and validate_custom_gcodes().

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

◆ validate_custom_gcodes()

bool Slic3r::GUI::Tab::validate_custom_gcodes ( )
inherited
8691{
8693 (m_type != Preset::TYPE_PRINTER || static_cast<TabPrinter*>(this)->m_printer_technology != ptFFF))
8694 return true;
8695 if (m_active_page->title() != L("Custom G-code"))
8696 return true;
8697
8698 // When we switch Settings tab after editing of the custom g-code, then warning message could ba already shown after KillFocus event
8699 // and then it's no need to show it again
8702 return true;
8703 }
8704
8705 bool valid = true;
8706 for (auto opt_group : m_active_page->m_optgroups) {
8707 assert(opt_group->opt_map().size() == 1);
8708 if (!opt_group->is_activated())
8709 break;
8710 std::string key = opt_group->opt_map().begin()->first;
8711 valid &= validate_custom_gcode(opt_group->title, boost::any_cast<std::string>(opt_group->get_value(key)));
8712 if (!valid)
8713 break;
8714 }
8715 return valid;
8716}

References L, m_active_page, m_type, Slic3r::ptFFF, Slic3r::Preset::TYPE_FILAMENT, Slic3r::Preset::TYPE_PRINTER, validate_custom_gcode(), validate_custom_gcodes(), and validate_custom_gcodes_was_shown.

Referenced by validate_custom_gcodes().

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

◆ validate_filament_temperature_pairs()

bool Slic3r::GUI::Tab::validate_filament_temperature_pairs ( )
inherited
8723{
8724 if (m_type != Preset::TYPE_FILAMENT || m_presets == nullptr)
8725 return true;
8726
8727 // Warn only for newly edited state, not for unchanged presets.
8728 if (!m_presets->current_is_dirty())
8729 return true;
8730
8731 Preset& edited_preset = m_presets->get_edited_preset();
8732 DynamicPrintConfig& config = edited_preset.config;
8733 const std::string suppress_key = edited_preset.name;
8734 // User opted out for this preset during current app session.
8735 if (!suppress_key.empty() && s_filament_temp_pair_warning_suppressed_for_session.count(suppress_key) > 0)
8736 return true;
8737
8738 struct TempPairRule
8739 {
8740 wxString label;
8741 std::string first_layer_key;
8742 std::string other_layer_key;
8743 int max_delta;
8744 };
8745
8746 std::vector<TempPairRule> temp_pair_rules;
8747 temp_pair_rules.push_back({_L("Nozzle"), "nozzle_temperature_initial_layer", "nozzle_temperature", 30});
8748
8749 // Derive bed labels/keys from curr_bed_type metadata (BedType order excludes btDefault).
8750 if (const ConfigOptionDef* bed_type_def = print_config_def.get("curr_bed_type");
8751 bed_type_def != nullptr) {
8752 for (int bt = static_cast<int>(btPC); bt < static_cast<int>(btCount); ++bt) {
8753 const BedType bed_type = static_cast<BedType>(bt);
8754 const size_t label_idx = static_cast<size_t>(bt - static_cast<int>(btPC));
8755 const std::string first_key = get_bed_temp_1st_layer_key(bed_type);
8756 const std::string other_key = get_bed_temp_key(bed_type);
8757 if (first_key.empty() || other_key.empty())
8758 continue;
8759
8760 wxString label = _(bed_type_def->enum_labels[label_idx]);
8761 temp_pair_rules.push_back({label, first_key, other_key, 15});
8762 }
8763 }
8764
8765 wxString invalid_pairs;
8766 int invalid_count = 0;
8767
8768 for (const TempPairRule& rule : temp_pair_rules) {
8769 if (!config.has(rule.first_layer_key) || !config.has(rule.other_layer_key))
8770 continue;
8771
8772 const ConfigOptionInts* first_opt = config.option<ConfigOptionInts>(rule.first_layer_key);
8773 const ConfigOptionInts* other_opt = config.option<ConfigOptionInts>(rule.other_layer_key);
8774 if (first_opt == nullptr || other_opt == nullptr || first_opt->values.empty() || other_opt->values.empty())
8775 continue;
8776
8777 const int first_temp = first_opt->get_at(0);
8778 const int other_temp = other_opt->get_at(0);
8779
8780 // Keep existing semantics: 0 means unsupported/off for these temperatures.
8781 if (first_temp <= 0 || other_temp <= 0)
8782 continue;
8783
8784 const int delta = std::abs(first_temp - other_temp);
8785 if (delta <= rule.max_delta)
8786 continue;
8787
8788 const wxString deg_c = wxString::FromUTF8(u8"\u2103" /* °C */);
8789 const wxString bullet = wxString::FromUTF8("•");
8790 invalid_pairs += wxString::Format(_L(" - %s:\n %s first layer %d %s, other layers %d %s\n %s max delta %d %s, current delta %d %s\n"),
8791 rule.label, bullet, first_temp, deg_c, other_temp, deg_c, bullet, rule.max_delta, deg_c, delta, deg_c);
8792 ++invalid_count;
8793 }
8794
8795 if (invalid_count == 0)
8796 return true;
8797
8798 wxString msg_text = _L("Some first-layer and other-layer temperature pairs exceed safety limits.\n");
8799 msg_text += _L("\nInvalid pairs:\n");
8800 msg_text += invalid_pairs;
8801 msg_text += _L("\nYou can go back to edit values, or continue if this is intentional.");
8802 msg_text += _L("\n\nContinue anyway?");
8803
8804 RichMessageDialog dialog(parent(), msg_text, _L("Temperature Safety Check"), wxYES | wxNO | wxICON_WARNING);
8805 dialog.SetButtonLabel(wxID_YES, _L("Continue"), true);
8806 dialog.SetButtonLabel(wxID_NO, _L_CONTEXT("Back", "Navigation"));
8807 dialog.ShowCheckBox(_L("Don't warn again for this preset"));
8808 const int answer = dialog.ShowModal();
8809 // Session-only suppression (does not modify/save filament preset data).
8810 if (dialog.IsCheckBoxChecked() && !suppress_key.empty())
8812
8813 return answer == wxID_YES;
8814}
const ConfigOptionDef * get(const t_config_option_key &opt_key) const
Definition Config.hpp:2662
static std::unordered_set< std::string > s_filament_temp_pair_warning_suppressed_for_session
Definition Tab.cpp:8719
static std::string get_bed_temp_key(const BedType type)
Definition PrintConfig.hpp:732
BedType
Definition PrintConfig.hpp:507
@ btPC
Definition PrintConfig.hpp:509
@ btCount
Definition PrintConfig.hpp:515
const PrintConfigDef print_config_def
Definition PrintConfig.cpp:10099
ConfigOptionIntsTempl< false > ConfigOptionInts
Definition Config.hpp:1154
static std::string get_bed_temp_1st_layer_key(const BedType type)
Definition PrintConfig.hpp:755
#define _L_CONTEXT(s, ctx)
Definition I18N.hpp:15

References _, _L, _L_CONTEXT, Slic3r::btCount, Slic3r::btPC, Slic3r::Preset::config, Slic3r::ConfigOptionVector< int >::get_at(), Slic3r::get_bed_temp_1st_layer_key(), Slic3r::get_bed_temp_key(), Slic3r::ConfigOptionResolver::has(), Slic3r::GUI::RichMessageDialog::IsCheckBoxChecked(), m_presets, m_type, Slic3r::Preset::name, Slic3r::ConfigBase::option(), parent(), Slic3r::print_config_def, Slic3r::GUI::s_filament_temp_pair_warning_suppressed_for_session, Slic3r::GUI::MsgDialog::SetButtonLabel(), Slic3r::GUI::RichMessageDialog::ShowCheckBox(), Slic3r::GUI::RichMessageDialog::ShowModal(), Slic3r::Preset::TYPE_FILAMENT, validate_filament_temperature_pairs(), and Slic3r::ConfigOptionVector< int >::values.

Referenced by save_preset(), and validate_filament_temperature_pairs().

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

◆ variant_switch_active()

bool Slic3r::GUI::Tab::variant_switch_active ( ) const
inherited
9156{
9158 return m_extruder_switch->IsThisEnabled();
9159 return m_variant_combo && m_variant_combo->IsThisEnabled();
9160}

References m_extruder_switch, m_variant_combo, and variant_switch_active().

Referenced by switch_excluder(), update_variant_sizer_visibility(), and variant_switch_active().

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

Member Data Documentation

◆ m_active_page

◆ m_actual_nozzle_volumes

std::vector<NozzleVolumeType> Slic3r::GUI::Tab::m_actual_nozzle_volumes
inherited

◆ m_all_extruder_options_status

std::map<std::string, int> Slic3r::GUI::Tab::m_all_extruder_options_status
protectedinherited

◆ m_base_preset_name

std::string Slic3r::GUI::TabPrinter::m_base_preset_name

◆ m_belt_synced_tilt_x

double Slic3r::GUI::TabPrinter::m_belt_synced_tilt_x = 0.
private

Referenced by on_preset_loaded(), and update_fff().

◆ m_belt_synced_tilt_y

double Slic3r::GUI::TabPrinter::m_belt_synced_tilt_y = 0.
private

Referenced by on_preset_loaded(), and update_fff().

◆ m_bmp_edit_value

ScalableBitmap Slic3r::GUI::Tab::m_bmp_edit_value
protectedinherited

Referenced by create_preset_tab(), and decorate().

◆ m_bmp_hide_incompatible_presets

ScalableBitmap Slic3r::GUI::Tab::m_bmp_hide_incompatible_presets
protectedinherited

Referenced by create_preset_tab().

◆ m_bmp_non_system

ScalableBitmap* Slic3r::GUI::Tab::m_bmp_non_system
protectedinherited

◆ m_bmp_show_incompatible_presets

ScalableBitmap Slic3r::GUI::Tab::m_bmp_show_incompatible_presets
protectedinherited

Referenced by create_preset_tab().

◆ m_bmp_value_lock

ScalableBitmap Slic3r::GUI::Tab::m_bmp_value_lock
protectedinherited

Referenced by create_preset_tab(), and decorate().

◆ m_bmp_value_revert

ScalableBitmap Slic3r::GUI::Tab::m_bmp_value_revert
protectedinherited

◆ m_bmp_value_unlock

ScalableBitmap Slic3r::GUI::Tab::m_bmp_value_unlock
protectedinherited

◆ m_bmp_white_bullet

◆ m_btn_compare_preset

ScalableButton* Slic3r::GUI::Tab::m_btn_compare_preset
protectedinherited

◆ m_btn_delete_preset

ScalableButton* Slic3r::GUI::Tab::m_btn_delete_preset
protectedinherited

◆ m_btn_save_preset

ScalableButton* Slic3r::GUI::Tab::m_btn_save_preset
protectedinherited

Referenced by create_preset_tab().

◆ m_btn_search

ScalableButton* Slic3r::GUI::Tab::m_btn_search
protectedinherited

Referenced by create_preset_tab().

◆ m_cache_config

DynamicPrintConfig Slic3r::GUI::Tab::m_cache_config
protectedinherited

◆ m_cache_extruder_count

size_t Slic3r::GUI::TabPrinter::m_cache_extruder_count = 0

◆ m_cache_options

std::vector<std::string> Slic3r::GUI::Tab::m_cache_options
protectedinherited

◆ m_category_icon

std::map<wxString, std::string> Slic3r::GUI::Tab::m_category_icon
protectedinherited

◆ m_colored_Label_colors

std::map<std::string, wxColour> Slic3r::GUI::Tab::m_colored_Label_colors
inherited

◆ m_compatible_printers

◆ m_compatible_prints

◆ m_completed

bool Slic3r::GUI::Tab::m_completed { false }
protectedinherited
283{ false };

Referenced by completed(), and create_preset_tab().

◆ m_config

DynamicPrintConfig* Slic3r::GUI::Tab::m_config
inherited

Referenced by Slic3r::GUI::TabFilament::add_filament_overrides_page(), add_options_page(), apply_preset_config_values(), apply_searcher(), Slic3r::GUI::TabPrinter::build(), Slic3r::GUI::TabPrintPlate::build(), Slic3r::GUI::TabPrinter::build_fff(), Slic3r::GUI::TabPrinter::build_unregular_pages(), check_extruder_options_status(), compatible_widget_create(), compatible_widget_reload(), Slic3r::GUI::TabPrinter::create_bed_shape_widget(), Slic3r::GUI::TabPrinter::extruder_variant_index(), generate_extruder_options(), get_config(), get_custom_gcode(), Slic3r::GUI::TabFilament::get_custom_gcode(), get_sys_and_mod_flags(), init_options_list(), Slic3r::GUI::TabFilament::init_options_list(), load_config(), load_current_preset(), load_initial_data(), load_key_value(), Slic3r::GUI::TabPrinter::on_gcode_flavor_changed(), Slic3r::GUI::TabPrinter::on_preset_loaded(), on_roll_back_value(), on_value_change(), Slic3r::GUI::TabFilament::on_value_change(), Slic3r::GUI::TabPrinter::on_value_change(), Slic3r::GUI::TabPrintModel::on_value_change(), Slic3r::GUI::TabPrintPlate::on_value_change(), options_list_storage_key(), reload_config(), Slic3r::GUI::TabPrinter::reload_config(), Slic3r::GUI::TabPrintModel::reload_config(), Slic3r::GUI::TabPrintModel::reset_model_config(), Slic3r::GUI::TabPrintPlate::reset_model_config(), save_preset(), set_custom_gcode(), Slic3r::GUI::TabFilament::set_custom_gcode(), switch_excluder(), sync_excluder(), Slic3r::GUI::TabPrinter::sync_extruders_count(), Slic3r::GUI::TabFilament::toggle_options(), Slic3r::GUI::TabPrint::toggle_options(), Slic3r::GUI::TabPrinter::toggle_options(), Slic3r::GUI::TabSLAPrint::toggle_options(), Slic3r::GUI::TabFilament::update(), Slic3r::GUI::TabPrint::update(), Slic3r::GUI::TabPrinter::update(), Slic3r::GUI::TabSLAMaterial::update(), Slic3r::GUI::TabSLAPrint::update(), update_all_extruder_options_status(), Slic3r::GUI::TabPrinter::update_custom_dirty(), Slic3r::GUI::TabPrintPlate::update_custom_dirty(), Slic3r::GUI::TabPrinter::update_fff(), Slic3r::GUI::TabFilament::update_filament_overrides_page(), update_frequently_changed_parameters(), Slic3r::GUI::TabPrinter::update_input_shaper_menu(), and Slic3r::GUI::TabPrintModel::update_model_config().

◆ m_config_manipulation

◆ m_default_text_clr

wxColour Slic3r::GUI::Tab::m_default_text_clr
protectedinherited

◆ m_dependent_tabs

std::vector<Preset::Type> Slic3r::GUI::Tab::m_dependent_tabs
protectedinherited

◆ m_detach_preset_btn

◆ m_disable_tree_sel_changed_event

bool Slic3r::GUI::Tab::m_disable_tree_sel_changed_event {false}
protectedinherited
265{false};

Referenced by create_preset_tab(), and rebuild_page_tree().

◆ m_em_unit

int Slic3r::GUI::Tab::m_em_unit
protectedinherited

Referenced by Tab(), create_preset_tab(), and msw_rescale().

◆ m_extruder_switch

◆ m_extruder_switch_variants

bool Slic3r::GUI::Tab::m_extruder_switch_variants = false
inherited

◆ m_extruder_sync

◆ m_extruder_sync_box

wxPanel* Slic3r::GUI::Tab::m_extruder_sync_box = nullptr
inherited

Referenced by create_preset_tab().

◆ m_extruder_variant_list

std::vector<std::string> Slic3r::GUI::TabPrinter::m_extruder_variant_list

Referenced by build_fff(), and on_preset_loaded().

◆ m_extruders_count

◆ m_extruders_count_old

size_t Slic3r::GUI::TabPrinter::m_extruders_count_old = 0

Referenced by build(), and build_unregular_pages().

◆ m_highlighter

struct Slic3r::GUI::Tab::Highlighter Slic3r::GUI::Tab::m_highlighter
protectedinherited

◆ m_icon_count

int Slic3r::GUI::Tab::m_icon_count
protectedinherited

◆ m_icon_index

std::map<std::string, size_t> Slic3r::GUI::Tab::m_icon_index
protectedinherited

Referenced by add_options_page().

◆ m_icons

wxImageList* Slic3r::GUI::Tab::m_icons
protectedinherited

◆ m_imex_modes_ctrl

IMEXModesCtrl* Slic3r::GUI::TabPrinter::m_imex_modes_ctrl {nullptr}
private

◆ m_initial_extruders_count

size_t Slic3r::GUI::TabPrinter::m_initial_extruders_count

◆ m_is_default_preset

bool Slic3r::GUI::Tab::m_is_default_preset {false}
protectedinherited

◆ m_is_modified_values

bool Slic3r::GUI::Tab::m_is_modified_values { false }
protectedinherited

◆ m_is_nonsys_values

bool Slic3r::GUI::Tab::m_is_nonsys_values { true }
protectedinherited

◆ m_is_timelapse_wipe_tower_already_prompted

bool Slic3r::GUI::Tab::m_is_timelapse_wipe_tower_already_prompted = false
protectedinherited

◆ m_just_edit

bool Slic3r::GUI::Tab::m_just_edit {false}
protectedinherited
208{false};

Referenced by save_preset(), and set_just_edit().

◆ m_last_select_item

int Slic3r::GUI::Tab::m_last_select_item = -1
protectedinherited

◆ m_last_sparse_infill_rotate_template_value

std::string Slic3r::GUI::Tab::m_last_sparse_infill_rotate_template_value
protectedinherited

Referenced by on_value_change(), and reload_config().

◆ m_main_sizer

wxBoxSizer* Slic3r::GUI::Tab::m_main_sizer
protectedinherited

◆ m_mode

◆ m_mode_icon

ScalableButton* Slic3r::GUI::Tab::m_mode_icon = nullptr
inherited

Referenced by create_preset_tab().

◆ m_mode_view

ModeSwitchButton* Slic3r::GUI::Tab::m_mode_view = nullptr
inherited

Referenced by create_preset_tab(), and msw_rescale().

◆ m_modified_label_clr

wxColour Slic3r::GUI::Tab::m_modified_label_clr
protectedinherited

◆ m_name

std::string Slic3r::GUI::Tab::m_name
protectedinherited

Referenced by set_type().

◆ m_opt_status_value

◆ m_options_list

◆ m_page_switch_planned

bool Slic3r::GUI::Tab::m_page_switch_planned = false
protectedinherited

◆ m_page_switch_running

bool Slic3r::GUI::Tab::m_page_switch_running = false
protectedinherited

Referenced by create_preset_tab().

◆ m_page_view

◆ m_pages

◆ m_pages_fff

std::vector<PageShp> Slic3r::GUI::TabPrinter::m_pages_fff
private

Referenced by update_pages().

◆ m_pages_sla

std::vector<PageShp> Slic3r::GUI::TabPrinter::m_pages_sla
private

Referenced by update_pages().

◆ m_parent

◆ m_parent_preset_description_line

ogStaticText* Slic3r::GUI::Tab::m_parent_preset_description_line = nullptr
inherited

◆ m_postpone_update_ui

◆ m_preset_bundle

PresetBundle* Slic3r::GUI::Tab::m_preset_bundle
inherited

Referenced by Slic3r::GUI::TabFilament::add_filament_overrides_page(), apply_preset_config_values(), Slic3r::GUI::TabFilament::build(), Slic3r::GUI::TabPrint::build(), Slic3r::GUI::TabPrinter::build(), Slic3r::GUI::TabPrintPlate::build(), Slic3r::GUI::TabSLAMaterial::build(), Slic3r::GUI::TabSLAPrint::build(), Slic3r::GUI::TabPrinter::build_unregular_pages(), calculate_selection_index_for_extruder(), check_extruder_options_status(), compatible_widget_create(), Slic3r::GUI::TabPrinter::create_bed_shape_widget(), create_preset_tab(), delete_preset(), Slic3r::GUI::TabPrinter::extruders_count_changed(), generate_extruder_options(), get_actual_nozzle_volume_type(), get_extruder_sync_enable_state(), load_key_value(), may_discard_current_dirty_preset(), Slic3r::GUI::TabPrinter::on_preset_loaded(), on_presets_changed(), on_value_change(), Slic3r::GUI::TabFilament::on_value_change(), parse_extruder_selection(), Slic3r::GUI::TabFilament::reload_config(), save_preset(), select_preset(), Slic3r::GUI::TabPrinter::set_extruder_volume_type(), switch_excluder(), sync_excluder(), Slic3r::GUI::TabFilament::toggle_options(), Slic3r::GUI::TabPrint::toggle_options(), Slic3r::GUI::TabPrinter::toggle_options(), Slic3r::GUI::TabSLAMaterial::toggle_options(), Slic3r::GUI::TabFilament::update(), Slic3r::GUI::TabPrint::update(), Slic3r::GUI::TabSLAMaterial::update(), Slic3r::GUI::TabSLAPrint::update(), update_all_extruder_options_status(), update_btns_enabling(), Slic3r::GUI::TabPrintPlate::update_custom_dirty(), Slic3r::GUI::TabPrint::update_description_lines(), update_extruder_variants(), Slic3r::GUI::TabFilament::update_filament_overrides_page(), Slic3r::GUI::TabPrintPlate::update_mixed_filament_seq_state(), Slic3r::GUI::TabPrintModel::update_model_config(), Slic3r::GUI::TabPrinter::update_pages(), and update_wiping_button_visibility().

◆ m_presets

PresetCollection* Slic3r::GUI::Tab::m_presets = nullptr
inherited

◆ m_presets_choice

◆ m_printer_technology

◆ m_reset_to_filament_color

ScalableButton* Slic3r::GUI::TabPrinter::m_reset_to_filament_color = nullptr

Referenced by clear_pages(), and msw_rescale().

◆ m_scaled_bitmaps

std::vector<ScalableBitmap*> Slic3r::GUI::Tab::m_scaled_bitmaps = {}
protectedinherited

◆ m_scaled_buttons

std::vector<ScalableButton*> Slic3r::GUI::Tab::m_scaled_buttons = {}
protectedinherited

◆ m_scaled_icons_list

std::vector<ScalableBitmap> Slic3r::GUI::Tab::m_scaled_icons_list = {}
protectedinherited

◆ m_search_input

TextInput* Slic3r::GUI::Tab::m_search_input
protectedinherited

Referenced by create_preset_tab().

◆ m_search_item

StaticBox* Slic3r::GUI::Tab::m_search_item
protectedinherited

Referenced by create_preset_tab().

◆ m_select_sizer

wxBoxSizer* Slic3r::GUI::Tab::m_select_sizer
protectedinherited

◆ m_show_btn_incompatible_presets

bool Slic3r::GUI::Tab::m_show_btn_incompatible_presets = false
inherited

Referenced by update_ui_from_settings().

◆ m_show_incompatible_presets

bool Slic3r::GUI::Tab::m_show_incompatible_presets
protectedinherited

◆ m_sys_extruders_count

size_t Slic3r::GUI::TabPrinter::m_sys_extruders_count

◆ m_sys_label_clr

wxColour Slic3r::GUI::Tab::m_sys_label_clr
protectedinherited

◆ m_tabctrl

◆ m_title

const wxString Slic3r::GUI::Tab::m_title
protectedinherited

Referenced by Tab(), create_preset_tab(), and title().

◆ m_top_left_sizer

wxBoxSizer* Slic3r::GUI::Tab::m_top_left_sizer
protectedinherited

◆ m_top_panel

wxPanel* Slic3r::GUI::Tab::m_top_panel
protectedinherited

Referenced by create_preset_tab().

◆ m_top_right_sizer

wxGridSizer* Slic3r::GUI::Tab::m_top_right_sizer
protectedinherited

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::Tab::m_top_sizer
protectedinherited

Referenced by create_preset_tab(), and msw_rescale().

◆ m_tree_sizer

wxBoxSizer* Slic3r::GUI::Tab::m_tree_sizer
protectedinherited

◆ m_tt_non_system

wxString* Slic3r::GUI::Tab::m_tt_non_system
protectedinherited

◆ m_tt_value_lock

wxString Slic3r::GUI::Tab::m_tt_value_lock
protectedinherited

Referenced by decorate().

◆ m_tt_value_revert

wxString Slic3r::GUI::Tab::m_tt_value_revert
protectedinherited

Referenced by decorate(), and set_tooltips_text().

◆ m_tt_value_unlock

wxString Slic3r::GUI::Tab::m_tt_value_unlock
protectedinherited

◆ m_tt_white_bullet

wxString Slic3r::GUI::Tab::m_tt_white_bullet
protectedinherited

◆ m_ttg_non_system

wxString* Slic3r::GUI::Tab::m_ttg_non_system
protectedinherited

◆ m_ttg_value_lock

wxString Slic3r::GUI::Tab::m_ttg_value_lock
protectedinherited

◆ m_ttg_value_revert

wxString Slic3r::GUI::Tab::m_ttg_value_revert
protectedinherited

◆ m_ttg_value_unlock

wxString Slic3r::GUI::Tab::m_ttg_value_unlock
protectedinherited

◆ m_ttg_white_bullet

wxString Slic3r::GUI::Tab::m_ttg_white_bullet
protectedinherited

Referenced by update_undo_buttons().

◆ m_ttg_white_bullet_ns

wxString Slic3r::GUI::Tab::m_ttg_white_bullet_ns
protectedinherited

◆ m_type

◆ m_undo_btn

ScalableButton* Slic3r::GUI::Tab::m_undo_btn
protectedinherited

◆ m_undo_to_sys_btn

ScalableButton* Slic3r::GUI::Tab::m_undo_to_sys_btn
protectedinherited

Referenced by create_preset_tab().

◆ m_update_cnt

◆ m_variant_combo

◆ m_variant_sizer

wxSizer* Slic3r::GUI::Tab::m_variant_sizer = nullptr
inherited

◆ m_was_belt_printer

bool Slic3r::GUI::TabPrinter::m_was_belt_printer = false
private

Referenced by on_preset_loaded(), and update_fff().

◆ validate_custom_gcodes_was_shown

bool Slic3r::GUI::Tab::validate_custom_gcodes_was_shown { false }
inherited

The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Tab.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Tab.cpp