mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-07-25 03:42:05 +00:00
Machine Input Shaping (#11202)
* Base IS Machine * Toggle line * Rebase * Intento 1 * Wiki IS * Flavorized * Tooltips * Calibration using the same list * max * Reorder JD validation * Refactor set input shaping * Calibrations IS * Default values * Axis * Orca comments * Rename input_shaping_enable to input_shaping_emit Refactor all references of the input shaping configuration option from 'input_shaping_enable' to 'input_shaping_emit' across the codebase. This improves clarity by better reflecting the option's purpose of controlling whether input shaping commands are emitted in the generated G-code. Restore DONT EMIT FOR KLIPPER * Refactor input shaping option toggling logic Simplifies and consolidates the logic for toggling input shaping related options in TabPrinter::toggle_options(). Uses a loop to handle enabling/disabling lines based on GCode flavor compatibility, and refines the conditions for toggling individual options. * Improve input shaping option toggling logic in TabPrinter * GrayOut Emit to gcode limits for klipper * Typo Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Typo * Skip Y input-shaper when type is Disable If marlin2 and disabled it will be already disabled at X. * IS expert Co-Authored-By: SoftFever <softfeverever@gmail.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -13,6 +13,8 @@
|
||||
|
||||
namespace Slic3r { namespace GUI {
|
||||
|
||||
std::vector<InputShaperType> input_shaper_types_for_flavor(GCodeFlavor flavor);
|
||||
|
||||
namespace {
|
||||
|
||||
void ParseStringValues(std::string str, std::vector<double> &vec)
|
||||
@@ -36,18 +38,29 @@ std::vector<std::string> get_shaper_type_values()
|
||||
{
|
||||
if (auto* preset_bundle = wxGetApp().preset_bundle) {
|
||||
auto printer_config = &preset_bundle->printers.get_edited_preset().config;
|
||||
if (auto* gcode_flavor_option = printer_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")) {
|
||||
switch (gcode_flavor_option->value) {
|
||||
case GCodeFlavor::gcfKlipper:
|
||||
return {"Default", "ZV", "MZV", "ZVD", "EI", "2HUMP_EI", "3HUMP_EI"};
|
||||
case GCodeFlavor::gcfRepRapFirmware:
|
||||
return {"Default", "MZV", "ZVD", "ZVDD", "ZVDDD", "EI2", "EI3", "DAA"};
|
||||
case GCodeFlavor::gcfMarlinFirmware:
|
||||
return {"ZV"};
|
||||
default:
|
||||
break;
|
||||
const auto* gcode_flavor_option = printer_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor");
|
||||
const ConfigOptionDef* def = printer_config->def()->get("input_shaping_type");
|
||||
if (gcode_flavor_option) {
|
||||
auto types = input_shaper_types_for_flavor(gcode_flavor_option->value);
|
||||
if (!types.empty()) {
|
||||
std::vector<std::string> values;
|
||||
values.reserve(types.size());
|
||||
for (InputShaperType type : types) {
|
||||
if (type == InputShaperType::Disable)
|
||||
continue;
|
||||
const size_t idx = static_cast<size_t>(type);
|
||||
if (def && idx < def->enum_values.size())
|
||||
values.push_back(def->enum_values[idx]);
|
||||
else
|
||||
values.push_back(std::to_string(static_cast<int>(type)));
|
||||
}
|
||||
if (!values.empty())
|
||||
return values;
|
||||
}
|
||||
}
|
||||
|
||||
if (def && !def->enum_values.empty())
|
||||
return {def->enum_values.front()};
|
||||
}
|
||||
return {"Default"};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user