Support GIGA multi-printhead configuration options (#13901)

* Support GIGA multi-printhead configuration options

* Removed unused G-code comments.

* Added parallel_printheads_count option to configure parallel printhead count.

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
anjis
2026-06-01 00:11:07 +08:00
committed by GitHub
parent 3cce9b09ed
commit 4d05ba0d02
6 changed files with 61 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@@ -1318,7 +1318,7 @@ static std::vector<std::string> s_Preset_machine_limits_options {
static std::vector<std::string> s_Preset_printer_options {
"printer_technology",
"printable_area", "extruder_printable_area", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "gcode_flavor",
"printable_area", "extruder_printable_area", "support_parallel_printheads", "parallel_printheads_count", "parallel_printheads_bed_exclude_areas", "bed_exclude_area","bed_custom_texture", "bed_custom_model", "gcode_flavor",
"fan_kickstart", "part_cooling_fan_min_pwm", "fan_speedup_time", "fan_speedup_overhangs",
"single_extruder_multi_material", "manual_filament_change", "file_start_gcode", "machine_start_gcode", "machine_end_gcode", "before_layer_change_gcode", "printing_by_object_gcode", "layer_change_gcode", "time_lapse_gcode", "wrapping_detection_gcode", "change_filament_gcode", "change_extrusion_role_gcode",
"printer_model", "printer_variant", "printer_extruder_id", "printer_extruder_variant", "extruder_variant_list", "default_nozzle_volume_type",

View File

@@ -693,6 +693,26 @@ void PrintConfigDef::init_common_params()
def->gui_type = ConfigOptionDef::GUIType::one_string;
def->set_default_value(new ConfigOptionPointsGroups{});
def = this->add("support_parallel_printheads", coBool);
def->label = L("Support parallel printheads");
def->tooltip = L("Enable printer settings for machines that can use multiple printheads in parallel.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionBool{false});
def = this->add("parallel_printheads_count", coInt);
def->label = L("Parallel printheads count");
def->tooltip = L("Set the number of parallel printheads for machines like OrangeStorm Giga printer.");
def->mode = comAdvanced;
def->min = 1;
def->max = 4;
def->set_default_value(new ConfigOptionInt{1});
def = this->add("parallel_printheads_bed_exclude_areas", coStrings);
def->label = L("Parallel printheads bed exclude areas");
def->tooltip = L("Ordered list of bed exclude areas by parallel printhead count. Item 1 applies to one printhead, item 2 to two printheads, and so on. Leave an item empty for no excluded area.");
def->mode = comAdvanced;
def->set_default_value(new ConfigOptionStrings());
//BBS: add "bed_exclude_area"
def = this->add("bed_exclude_area", coPoints);
def->label = L("Bed exclude area");

View File

@@ -1480,6 +1480,9 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE(
((ConfigOptionFloatOrPercent, max_travel_detour_distance))
((ConfigOptionPoints, printable_area))
((ConfigOptionPointsGroups, extruder_printable_area))
((ConfigOptionBool, support_parallel_printheads))
((ConfigOptionInt, parallel_printheads_count))
((ConfigOptionStrings, parallel_printheads_bed_exclude_areas))
//BBS: add bed_exclude_area
((ConfigOptionPoints, bed_exclude_area))
((ConfigOptionPoints, head_wrap_detect_zone))

View File

@@ -190,6 +190,7 @@ public:
/// Call the attached m_fn_edit_value method.
void on_edit_value();
virtual void propagate_value(){}
public:
/// parent wx item, opportunity to refactor (probably not necessary - data duplication)
wxWindow* m_parent {nullptr};
@@ -317,7 +318,7 @@ public:
void BUILD() override;
bool value_was_changed();
// Propagate value from field to the OptionGroupe and Config after kill_focus/ENTER
void propagate_value();
virtual void propagate_value() override;
wxWindow* window {nullptr};
void set_value(const std::string& value, bool change_event = false) {

View File

@@ -1935,6 +1935,26 @@ void Tab::on_value_change(const std::string& opt_key, const boost::any& value)
}
}
if (opt_key == "parallel_printheads_count" || opt_key == "parallel_printheads_bed_exclude_areas") {
if (m_config->opt_bool("support_parallel_printheads")) {
const int count = opt_key == "parallel_printheads_count" ? boost::any_cast<int>(value) : m_config->opt_int("parallel_printheads_count");
if (auto *field = this->get_field("bed_exclude_area")) {
wxString exclude_area;
if (count > 0) {
if (const auto *areas = m_config->option<ConfigOptionStrings>("parallel_printheads_bed_exclude_areas");
areas != nullptr) {
const size_t index = static_cast<size_t>(count - 1);
if (index < areas->values.size())
exclude_area = wxString::FromUTF8(areas->values[index]);
}
}
field->set_value(exclude_area, true);
field->propagate_value();
}
}
}
if (m_postpone_update_ui) {
// It means that not all values are rolled to the system/last saved values jet.
// And call of the update() can causes a redundant check of the config values,
@@ -4429,6 +4449,7 @@ void TabPrinter::build_fff()
create_line_with_widget(optgroup.get(), "printable_area", "custom-svg-and-png-bed-textures_124612", [this](wxWindow* parent) {
return create_bed_shape_widget(parent);
});
optgroup->append_single_option_line("parallel_printheads_count");
Option option = optgroup->get_option("bed_exclude_area");
option.opt.full_width = true;
optgroup->append_single_option_line(option, "printer_basic_information_printable_space#excluded-bed-area");
@@ -5409,6 +5430,7 @@ void TabPrinter::toggle_options()
// toggle_option("change_filament_gcode", have_multiple_extruders);
//}
if (m_active_page->title() == L("Basic information")) {
const auto &printer_cfg = m_preset_bundle->printers.get_edited_preset().config;
// SoftFever: hide BBL specific settings
for (auto el : {"scan_first_layer", "bbl_calib_mark_logo", "bbl_use_printhost"})
@@ -5420,6 +5442,9 @@ void TabPrinter::toggle_options()
auto gcf = m_config->option<ConfigOptionEnum<GCodeFlavor>>("gcode_flavor")->value;
toggle_line("enable_power_loss_recovery", is_BBL_printer || gcf == gcfMarlinFirmware);
const bool support_parallel_printheads = printer_cfg.opt_bool("support_parallel_printheads");
toggle_line("parallel_printheads_count", support_parallel_printheads);
}