mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-23 14:44:19 -06:00
Added prototype for "Kinematics" Page
+ Added enum_labels to localizations + Added bold font for the name of Options Groups
This commit is contained in:
parent
86b02224ae
commit
fd4feb689e
7 changed files with 129 additions and 31 deletions
|
@ -1627,6 +1627,16 @@ void TabPrinter::build()
|
|||
|
||||
optgroup = page->new_optgroup(_(L("Firmware")));
|
||||
optgroup->append_single_option_line("gcode_flavor");
|
||||
optgroup->append_single_option_line("silent_mode");
|
||||
|
||||
optgroup->m_on_change = [this, optgroup](t_config_option_key opt_key, boost::any value){
|
||||
wxTheApp->CallAfter([this, opt_key, value](){
|
||||
if (opt_key.compare("gcode_flavor") == 0)
|
||||
build_extruder_pages();
|
||||
update_dirty();
|
||||
on_value_change(opt_key, value);
|
||||
});
|
||||
};
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Advanced")));
|
||||
optgroup->append_single_option_line("use_relative_e_distances");
|
||||
|
@ -1708,8 +1718,57 @@ void TabPrinter::extruders_count_changed(size_t extruders_count){
|
|||
on_value_change("extruders_count", extruders_count);
|
||||
}
|
||||
|
||||
void TabPrinter::build_extruder_pages(){
|
||||
PageShp TabPrinter::create_kinematics_page()
|
||||
{
|
||||
auto page = add_options_page(_(L("Kinematics")), "cog.png", true);
|
||||
auto optgroup = page->new_optgroup(_(L("Maximum accelerations")));
|
||||
// optgroup->append_single_option_line("max_acceleration_x");
|
||||
// optgroup->append_single_option_line("max_acceleration_y");
|
||||
// optgroup->append_single_option_line("max_acceleration_z");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Maximum feedrates")));
|
||||
// optgroup->append_single_option_line("max_feedrate_x");
|
||||
// optgroup->append_single_option_line("max_feedrate_y");
|
||||
// optgroup->append_single_option_line("max_feedrate_z");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Starting Acceleration")));
|
||||
// optgroup->append_single_option_line("start_acceleration");
|
||||
// optgroup->append_single_option_line("start_retract_acceleration");
|
||||
|
||||
optgroup = page->new_optgroup(_(L("Advanced")));
|
||||
// optgroup->append_single_option_line("min_feedrate_for_print_moves");
|
||||
// optgroup->append_single_option_line("min_feedrate_for_travel_moves");
|
||||
// optgroup->append_single_option_line("max_jerk_x");
|
||||
// optgroup->append_single_option_line("max_jerk_y");
|
||||
// optgroup->append_single_option_line("max_jerk_z");
|
||||
|
||||
return page;
|
||||
}
|
||||
|
||||
|
||||
void TabPrinter::build_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;
|
||||
|
||||
// Add/delete Kinematics page according to is_marlin_flavor
|
||||
size_t existed_page = 0;
|
||||
for (int i = n_before_extruders; i < m_pages.size(); ++i) // first make sure it's not there already
|
||||
if (m_pages[i]->title().find(_(L("Kinematics"))) != std::string::npos) {
|
||||
if (!is_marlin_flavor)
|
||||
m_pages.erase(m_pages.begin() + i);
|
||||
else
|
||||
existed_page = i;
|
||||
break;
|
||||
}
|
||||
|
||||
if (existed_page < n_before_extruders && is_marlin_flavor){
|
||||
auto page = create_kinematics_page();
|
||||
m_pages.insert(m_pages.begin() + n_before_extruders, page);
|
||||
}
|
||||
|
||||
if (is_marlin_flavor)
|
||||
n_before_extruders++;
|
||||
size_t n_after_single_extruder_MM = 2; // Count of pages after single_extruder_multi_material page
|
||||
|
||||
if (m_extruders_count_old == m_extruders_count ||
|
||||
|
@ -1818,6 +1877,9 @@ void TabPrinter::update(){
|
|||
get_field("toolchange_gcode")->toggle(have_multiple_extruders);
|
||||
get_field("single_extruder_multi_material")->toggle(have_multiple_extruders);
|
||||
|
||||
bool is_marlin_flavor = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfMarlin;
|
||||
get_field("silent_mode")->toggle(is_marlin_flavor);
|
||||
|
||||
for (size_t i = 0; i < m_extruders_count; ++i) {
|
||||
bool have_retract_length = m_config->opt_float("retract_length", i) > 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue