mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-16 11:17:51 -06:00
Fix of #1216
This commit is contained in:
parent
144b9e1e9d
commit
4a20fd7f7e
2 changed files with 32 additions and 13 deletions
|
@ -1881,7 +1881,7 @@ void TabPrinter::build_fff()
|
||||||
m_use_silent_mode = val;
|
m_use_silent_mode = val;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
build_extruder_pages();
|
build_unregular_pages();
|
||||||
update_dirty();
|
update_dirty();
|
||||||
on_value_change(opt_key, value);
|
on_value_change(opt_key, value);
|
||||||
});
|
});
|
||||||
|
@ -1948,7 +1948,7 @@ void TabPrinter::build_fff()
|
||||||
};
|
};
|
||||||
optgroup->append_line(line);
|
optgroup->append_line(line);
|
||||||
|
|
||||||
build_extruder_pages();
|
build_unregular_pages();
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
if (!m_no_controller)
|
if (!m_no_controller)
|
||||||
|
@ -2051,13 +2051,24 @@ void TabPrinter::update_serial_ports()
|
||||||
|
|
||||||
void TabPrinter::extruders_count_changed(size_t extruders_count)
|
void TabPrinter::extruders_count_changed(size_t extruders_count)
|
||||||
{
|
{
|
||||||
m_extruders_count = extruders_count;
|
bool is_count_changed = false;
|
||||||
m_preset_bundle->printers.get_edited_preset().set_num_extruders(extruders_count);
|
if (m_extruders_count != extruders_count) {
|
||||||
m_preset_bundle->update_multi_material_filament_presets();
|
m_extruders_count = extruders_count;
|
||||||
build_extruder_pages();
|
m_preset_bundle->printers.get_edited_preset().set_num_extruders(extruders_count);
|
||||||
reload_config();
|
m_preset_bundle->update_multi_material_filament_presets();
|
||||||
on_value_change("extruders_count", extruders_count);
|
is_count_changed = true;
|
||||||
wxGetApp().sidebar().update_objects_list_extruder_column(extruders_count);
|
}
|
||||||
|
|
||||||
|
/* This function should be call in any case because of correct updating/rebuilding
|
||||||
|
* of unregular pages of a Printer Settings
|
||||||
|
*/
|
||||||
|
build_unregular_pages();
|
||||||
|
// reload_config(); // #ys_FIXME_delete_after_testing : This function is called from build_extruder_pages() now
|
||||||
|
|
||||||
|
if (is_count_changed) {
|
||||||
|
on_value_change("extruders_count", extruders_count);
|
||||||
|
wxGetApp().sidebar().update_objects_list_extruder_column(extruders_count);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabPrinter::append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key)
|
void TabPrinter::append_option_line(ConfigOptionsGroupShp optgroup, const std::string opt_key)
|
||||||
|
@ -2125,8 +2136,13 @@ PageShp TabPrinter::build_kinematics_page()
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Previous name build_extruder_pages().
|
||||||
void TabPrinter::build_extruder_pages()
|
*
|
||||||
|
* This function was renamed because of now it implements not just an extruder pages building,
|
||||||
|
* but "Machine limits" and "Single extruder MM setup" too
|
||||||
|
* (These pages can changes according to the another values of a current preset)
|
||||||
|
* */
|
||||||
|
void TabPrinter::build_unregular_pages()
|
||||||
{
|
{
|
||||||
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
size_t n_before_extruders = 2; // Count of pages before Extruder pages
|
||||||
bool is_marlin_flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlin;
|
bool is_marlin_flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlin;
|
||||||
|
@ -2175,7 +2191,7 @@ void TabPrinter::build_extruder_pages()
|
||||||
m_has_single_extruder_MM_page = true;
|
m_has_single_extruder_MM_page = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Build missed extruder pages
|
||||||
for (auto extruder_idx = m_extruders_count_old; extruder_idx < m_extruders_count; ++extruder_idx) {
|
for (auto extruder_idx = m_extruders_count_old; extruder_idx < m_extruders_count; ++extruder_idx) {
|
||||||
//# build page
|
//# build page
|
||||||
char buf[512];
|
char buf[512];
|
||||||
|
@ -2225,6 +2241,9 @@ void TabPrinter::build_extruder_pages()
|
||||||
|
|
||||||
m_extruders_count_old = m_extruders_count;
|
m_extruders_count_old = m_extruders_count;
|
||||||
rebuild_page_tree();
|
rebuild_page_tree();
|
||||||
|
|
||||||
|
// Reload preset pages with current configuration values
|
||||||
|
reload_config();
|
||||||
}
|
}
|
||||||
|
|
||||||
// this gets executed after preset is loaded and before GUI fields are updated
|
// this gets executed after preset is loaded and before GUI fields are updated
|
||||||
|
|
|
@ -368,7 +368,7 @@ public:
|
||||||
void update_serial_ports();
|
void update_serial_ports();
|
||||||
void extruders_count_changed(size_t extruders_count);
|
void extruders_count_changed(size_t extruders_count);
|
||||||
PageShp build_kinematics_page();
|
PageShp build_kinematics_page();
|
||||||
void build_extruder_pages();
|
void build_unregular_pages();
|
||||||
void on_preset_loaded() override;
|
void on_preset_loaded() override;
|
||||||
void init_options_list() override;
|
void init_options_list() override;
|
||||||
bool supports_printer_technology(const PrinterTechnology /* tech */) override { return true; }
|
bool supports_printer_technology(const PrinterTechnology /* tech */) override { return true; }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue