mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-17 11:35:52 +08:00
#440 RepRap firmware: feedrate in mm/min
This commit is contained in:
parent
e7ee5516a2
commit
56f0e37b48
@ -48,8 +48,19 @@ enum WipeAlgo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum GCodeFlavor : uint8_t {
|
enum GCodeFlavor : uint8_t {
|
||||||
gcfRepRap, gcfRepetier, gcfTeacup, gcfMakerWare, gcfMarlin, gcfKlipper, gcfSailfish, gcfMach3, gcfMachinekit,
|
gcfRepRap,
|
||||||
gcfSmoothie, gcfSprinter, gcfNoExtrusion, gcfLerdge,
|
gcfRepetier,
|
||||||
|
gcfTeacup,
|
||||||
|
gcfMakerWare,
|
||||||
|
gcfMarlin,
|
||||||
|
gcfKlipper,
|
||||||
|
gcfSailfish,
|
||||||
|
gcfMach3,
|
||||||
|
gcfMachinekit,
|
||||||
|
gcfSmoothie,
|
||||||
|
gcfSprinter,
|
||||||
|
gcfNoExtrusion,
|
||||||
|
gcfLerdge,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum PrintHostType {
|
enum PrintHostType {
|
||||||
|
@ -1313,13 +1313,7 @@ bool Tab::create_pages(std::string setting_type_name, int idx_page)
|
|||||||
TabPrinter* tab = nullptr;
|
TabPrinter* tab = nullptr;
|
||||||
if ((tab = dynamic_cast<TabPrinter*>(this)) == nullptr) continue;
|
if ((tab = dynamic_cast<TabPrinter*>(this)) == nullptr) continue;
|
||||||
current_group->m_on_change = set_or_add(current_group->m_on_change, [this, tab](t_config_option_key opt_key, boost::any value) {
|
current_group->m_on_change = set_or_add(current_group->m_on_change, [this, tab](t_config_option_key opt_key, boost::any value) {
|
||||||
if (opt_key == "silent_mode") {
|
tab->update_fff(); //check for kinematic rebuild
|
||||||
bool val = boost::any_cast<bool>(value);
|
|
||||||
if (tab->m_use_silent_mode != val) {
|
|
||||||
tab->m_rebuild_kinematics_page = true;
|
|
||||||
tab->m_use_silent_mode = val;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
tab->build_unregular_pages();
|
tab->build_unregular_pages();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2166,14 +2160,18 @@ void TabPrinter::milling_count_changed(size_t milling_count)
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabPrinter::append_option_line_kinematics(ConfigOptionsGroupShp optgroup, const std::string opt_key)
|
void TabPrinter::append_option_line_kinematics(ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string override_sidetext)
|
||||||
{
|
{
|
||||||
Option option = optgroup->get_option(opt_key, 0);
|
Option option = optgroup->get_option(opt_key, 0);
|
||||||
|
if (!override_sidetext.empty())
|
||||||
|
option.opt.sidetext = override_sidetext;
|
||||||
Line line = Line{ _(option.opt.full_label), "" };
|
Line line = Line{ _(option.opt.full_label), "" };
|
||||||
option.opt.width = 10;
|
option.opt.width = 10;
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
if (m_use_silent_mode) {
|
if (m_use_silent_mode) {
|
||||||
option = optgroup->get_option(opt_key, 1);
|
option = optgroup->get_option(opt_key, 1);
|
||||||
|
if (!override_sidetext.empty())
|
||||||
|
option.opt.sidetext = override_sidetext;
|
||||||
option.opt.width = 10;
|
option.opt.width = 10;
|
||||||
line.append_option(option);
|
line.append_option(option);
|
||||||
}
|
}
|
||||||
@ -2231,6 +2229,9 @@ PageShp TabPrinter::build_kinematics_page()
|
|||||||
std::vector<std::string> axes{ "x", "y", "z", "e" };
|
std::vector<std::string> axes{ "x", "y", "z", "e" };
|
||||||
optgroup = page->new_optgroup(_(L("Maximum feedrates")));
|
optgroup = page->new_optgroup(_(L("Maximum feedrates")));
|
||||||
for (const std::string& axis : axes) {
|
for (const std::string& axis : axes) {
|
||||||
|
if (m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfRepRap)
|
||||||
|
append_option_line_kinematics(optgroup, "machine_max_feedrate_" + axis, "mm/min");
|
||||||
|
else
|
||||||
append_option_line_kinematics(optgroup, "machine_max_feedrate_" + axis);
|
append_option_line_kinematics(optgroup, "machine_max_feedrate_" + axis);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2248,9 +2249,13 @@ PageShp TabPrinter::build_kinematics_page()
|
|||||||
}
|
}
|
||||||
|
|
||||||
optgroup = page->new_optgroup(_(L("Minimum feedrates")));
|
optgroup = page->new_optgroup(_(L("Minimum feedrates")));
|
||||||
|
if (m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value == gcfRepRap){
|
||||||
|
append_option_line_kinematics(optgroup, "machine_min_extruding_rate", "mm/min");
|
||||||
|
append_option_line_kinematics(optgroup, "machine_min_travel_rate", "mm/min");
|
||||||
|
} else {
|
||||||
append_option_line_kinematics(optgroup, "machine_min_extruding_rate");
|
append_option_line_kinematics(optgroup, "machine_min_extruding_rate");
|
||||||
append_option_line_kinematics(optgroup, "machine_min_travel_rate");
|
append_option_line_kinematics(optgroup, "machine_min_travel_rate");
|
||||||
|
}
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2503,8 +2508,8 @@ void TabPrinter::update_fff()
|
|||||||
else
|
else
|
||||||
GCodeWriter::PausePrintCode = "M601";
|
GCodeWriter::PausePrintCode = "M601";
|
||||||
|
|
||||||
if (m_is_marlin != is_marlin_flavor) {
|
if (m_last_gcode_flavor != uint8_t(m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value)) {
|
||||||
m_is_marlin = is_marlin_flavor;
|
m_last_gcode_flavor = uint8_t(m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value);
|
||||||
m_rebuild_kinematics_page = true;
|
m_rebuild_kinematics_page = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -384,9 +384,9 @@ public:
|
|||||||
void build_printhost(ConfigOptionsGroup *optgroup);
|
void build_printhost(ConfigOptionsGroup *optgroup);
|
||||||
|
|
||||||
bool m_has_single_extruder_MM_page = false;
|
bool m_has_single_extruder_MM_page = false;
|
||||||
bool m_is_marlin = false;
|
uint8_t m_last_gcode_flavor = uint8_t(255);
|
||||||
bool m_use_silent_mode = false;
|
bool m_use_silent_mode = false;
|
||||||
void append_option_line_kinematics(ConfigOptionsGroupShp optgroup, const std::string opt_key);
|
void append_option_line_kinematics(ConfigOptionsGroupShp optgroup, const std::string opt_key, const std::string override_units = "");
|
||||||
bool m_rebuild_kinematics_page = false;
|
bool m_rebuild_kinematics_page = false;
|
||||||
|
|
||||||
wxButton* m_serial_test_btn = nullptr;
|
wxButton* m_serial_test_btn = nullptr;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user