diff --git a/src/libslic3r/GCode/GCodeProcessor.cpp b/src/libslic3r/GCode/GCodeProcessor.cpp index c8d61bc488..fce17c75b4 100644 --- a/src/libslic3r/GCode/GCodeProcessor.cpp +++ b/src/libslic3r/GCode/GCodeProcessor.cpp @@ -392,8 +392,10 @@ void GCodeProcessor::TimeProcessor::reset() extruder_unloaded = true; machine_envelope_processing_enabled = false; machine_limits = MachineEnvelopeConfig(); - filament_load_times = std::vector(); - filament_unload_times = std::vector(); + filament_load_times = 0.0f; + filament_unload_times = 0.0f; + machine_tool_change_time = 0.0f; + for (size_t i = 0; i < static_cast(PrintEstimatedStatistics::ETimeMode::Count); ++i) { machines[i].reset(); @@ -1115,23 +1117,9 @@ void GCodeProcessor::apply_config(const PrintConfig& config) // Filament load / unload times are not specific to a firmware flavor. Let anybody use it if they find it useful. // As of now the fields are shown at the UI dialog in the same combo box as the ramming values, so they // are considered to be active for the single extruder multi-material printers only. - if(s_IsBBLPrinter){ - // BBL printers use machine_load_filament_time and machine_unload_filament_time - m_time_processor.filament_load_times.resize(1); - m_time_processor.filament_load_times[0] = static_cast(config.machine_load_filament_time.value); - m_time_processor.filament_unload_times.resize(1); - m_time_processor.filament_unload_times[0] = static_cast(config.machine_unload_filament_time.value); - } else { - // for non-BBL printers use the filament_load_time and filament_unload_time - m_time_processor.filament_load_times.resize(config.filament_load_time.values.size()); - for (size_t i = 0; i < config.filament_load_time.values.size(); ++i) { - m_time_processor.filament_load_times[i] = static_cast(config.filament_load_time.values[i]); - } - m_time_processor.filament_unload_times.resize(config.filament_unload_time.values.size()); - for (size_t i = 0; i < config.filament_unload_time.values.size(); ++i) { - m_time_processor.filament_unload_times[i] = static_cast(config.filament_unload_time.values[i]); - } - } + m_time_processor.filament_load_times = static_cast(config.machine_load_filament_time.value); + m_time_processor.filament_unload_times = static_cast(config.machine_unload_filament_time.value); + m_time_processor.machine_tool_change_time = static_cast(config.machine_tool_change_time.value); for (size_t i = 0; i < static_cast(PrintEstimatedStatistics::ETimeMode::Count); ++i) { float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i); @@ -1352,36 +1340,18 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config) m_extruder_temps.resize(m_result.extruders_count); - if(s_IsBBLPrinter){ - // BBL printers use machine_load_filament_time and machine_unload_filament_time - const ConfigOptionFloat* machine_load_filament_time = config.option("machine_load_filament_time"); - if (machine_load_filament_time != nullptr){ - m_time_processor.filament_load_times.resize(1); - m_time_processor.filament_load_times[0] = static_cast(machine_load_filament_time->value); - } + const ConfigOptionFloat* machine_load_filament_time = config.option("machine_load_filament_time"); + if (machine_load_filament_time != nullptr) + m_time_processor.filament_load_times = static_cast(machine_load_filament_time->value); + + const ConfigOptionFloat* machine_unload_filament_time = config.option("machine_unload_filament_time"); + if (machine_unload_filament_time != nullptr) + m_time_processor.filament_unload_times = static_cast(machine_unload_filament_time->value); + + const ConfigOptionFloat* machine_tool_change_time = config.option("machine_tool_change_time"); + if (machine_tool_change_time != nullptr) + m_time_processor.machine_tool_change_time = static_cast(machine_tool_change_time->value); - const ConfigOptionFloat* machine_unload_filament_time = config.option("machine_unload_filament_time"); - if (machine_unload_filament_time != nullptr){ - m_time_processor.filament_unload_times.resize(1); - m_time_processor.filament_unload_times[0] = static_cast(machine_unload_filament_time->value); - } - } else { - // non-BBL printers use filament_load_time and filament_unload_time - const ConfigOptionFloats* filament_load_time = config.option("filament_load_time"); - if (filament_load_time != nullptr) { - m_time_processor.filament_load_times.resize(filament_load_time->values.size()); - for (size_t i = 0; i < filament_load_time->values.size(); ++i) { - m_time_processor.filament_load_times[i] = static_cast(filament_load_time->values[i]); - } - } - const ConfigOptionFloats* filament_unload_time = config.option("filament_unload_time"); - if (filament_unload_time != nullptr) { - m_time_processor.filament_unload_times.resize(filament_unload_time->values.size()); - for (size_t i = 0; i < filament_unload_time->values.size(); ++i) { - m_time_processor.filament_unload_times[i] = static_cast(filament_unload_time->values[i]); - } - } - } if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) { const ConfigOptionFloats* machine_max_acceleration_x = config.option("machine_max_acceleration_x"); @@ -4373,6 +4343,7 @@ void GCodeProcessor::process_T(const std::string_view command) float extra_time = get_filament_unload_time(static_cast(m_last_extruder_id)); m_time_processor.extruder_unloaded = false; extra_time += get_filament_load_time(static_cast(m_extruder_id)); + extra_time += m_time_processor.machine_tool_change_time; simulate_st_synchronize(extra_time); } @@ -5277,32 +5248,14 @@ void GCodeProcessor::set_travel_acceleration(PrintEstimatedStatistics::ETimeMode float GCodeProcessor::get_filament_load_time(size_t extruder_id) { - if (s_IsBBLPrinter) { - // BBL printers - // BBS: change load time to machine config and all extruder has same value - return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_load_times[0]; - } else { - // non-BBL printers - return (m_time_processor.filament_load_times.empty() || m_time_processor.extruder_unloaded) ? - 0.0f : - ((extruder_id < m_time_processor.filament_load_times.size()) ? m_time_processor.filament_load_times[extruder_id] : - m_time_processor.filament_load_times.front()); - } + //BBS: change load time to machine config and all extruder has same value + return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_load_times; } float GCodeProcessor::get_filament_unload_time(size_t extruder_id) { - if (s_IsBBLPrinter) { - // BBL printers - // BBS: change unload time to machine config and all extruder has same value - return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_unload_times[0]; - } else { - // non-BBL printers - return (m_time_processor.filament_unload_times.empty() || m_time_processor.extruder_unloaded) ? - 0.0f : - ((extruder_id < m_time_processor.filament_unload_times.size()) ? m_time_processor.filament_unload_times[extruder_id] : - m_time_processor.filament_unload_times.front()); - } + //BBS: change unload time to machine config and all extruder has same value + return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_unload_times; } //BBS diff --git a/src/libslic3r/GCode/GCodeProcessor.hpp b/src/libslic3r/GCode/GCodeProcessor.hpp index 976f4541c5..da47cea688 100644 --- a/src/libslic3r/GCode/GCodeProcessor.hpp +++ b/src/libslic3r/GCode/GCodeProcessor.hpp @@ -492,8 +492,10 @@ class Print; bool machine_envelope_processing_enabled; MachineEnvelopeConfig machine_limits; // Additional load / unload times for a filament exchange sequence. - std::vector filament_load_times; - std::vector filament_unload_times; + float filament_load_times; + float filament_unload_times; + //Orca: time for tool change + float machine_tool_change_time; bool disable_m73; std::array(PrintEstimatedStatistics::ETimeMode::Count)> machines; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index dcbe87b9e9..9c4d533e6e 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -841,8 +841,8 @@ static std::vector s_Preset_filament_options { "nozzle_temperature_range_low", "nozzle_temperature_range_high", //SoftFever "enable_pressure_advance", "pressure_advance","adaptive_pressure_advance","adaptive_pressure_advance_model","adaptive_pressure_advance_overhangs", "adaptive_pressure_advance_bridges","chamber_temperature", "filament_shrink", "support_material_interface_fan_speed", "filament_notes" /*,"filament_seam_gap"*/, - "filament_loading_speed", "filament_loading_speed_start", "filament_load_time", - "filament_unloading_speed", "filament_unloading_speed_start", "filament_unload_time", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance", + "filament_loading_speed", "filament_loading_speed_start", + "filament_unloading_speed", "filament_unloading_speed_start", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow", "activate_chamber_temp_control", "filament_long_retractions_when_cut","filament_retraction_distances_when_cut", "idle_temperature" @@ -865,11 +865,9 @@ static std::vector s_Preset_printer_options { "nozzle_height", "default_print_profile", "inherits", "silent_mode", - // BBS - "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time","time_cost", "machine_pause_gcode", "template_custom_gcode", + "scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "machine_tool_change_time", "time_cost", "machine_pause_gcode", "template_custom_gcode", "nozzle_type", "nozzle_hrc","auxiliary_fan", "nozzle_volume","upward_compatible_machine", "z_hop_types", "travel_slope", "retract_lift_enforce","support_chamber_temp_control","support_air_filtration","printer_structure", "best_object_pos","head_wrap_detect_zone", - //SoftFever "host_type", "print_host", "printhost_apikey", "bbl_use_printhost", "print_host_webui", "printhost_cafile","printhost_port","printhost_authorization_type", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 089ca62c20..773966804f 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1822,7 +1822,7 @@ void PrintConfigDef::init_fff_params() def = this->add("machine_load_filament_time", coFloat); def->label = L("Filament load time"); - def->tooltip = L("Time to load new filament when switch filament. For statistics only"); + def->tooltip = L("Time to load new filament when switch filament. It's usually applicable for single-extruder multi-material machines. For tool changers or multi-tool machines, it's typically 0. For statistics only"); def->sidetext = L("s"); def->min = 0; def->mode = comAdvanced; @@ -1830,12 +1830,21 @@ void PrintConfigDef::init_fff_params() def = this->add("machine_unload_filament_time", coFloat); def->label = L("Filament unload time"); - def->tooltip = L("Time to unload old filament when switch filament. For statistics only"); + def->tooltip = L("Time to unload old filament when switch filament. It's usually applicable for single-extruder multi-material machines. For tool changers or multi-tool machines, it's typically 0. For statistics only"); def->sidetext = L("s"); def->min = 0; def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(0.0)); + def = this->add("machine_tool_change_time", coFloat); + def->label = L("Tool change time"); + def->tooltip = L("Time taken to switch tools. It's usually applicable for tool changers or multi-tool machines. For single-extruder multi-material machines, it's typically 0. For statistics only"); + def->sidetext = L("s"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat { 0. }); + + def = this->add("filament_diameter", coFloats); def->label = L("Diameter"); def->tooltip = L("Filament diameter is used to calculate extrusion in gcode, so it's important and should be accurate"); @@ -1982,14 +1991,6 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats { 3.4 }); - def = this->add("filament_load_time", coFloats); - def->label = L("Filament load time"); - def->tooltip = L("Time for the printer firmware (or the Multi Material Unit 2.0) to load a new filament during a tool change (when executing the T code). This time is added to the total print time by the G-code time estimator."); - def->sidetext = L("s"); - def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_ramming_parameters", coStrings); def->label = L("Ramming parameters"); def->tooltip = L("This string is edited by RammingDialog and contains ramming specific parameters."); @@ -1997,14 +1998,6 @@ void PrintConfigDef::init_fff_params() def->set_default_value(new ConfigOptionStrings { "120 100 6.6 6.8 7.2 7.6 7.9 8.2 8.7 9.4 9.9 10.0|" " 0.05 6.6 0.45 6.8 0.95 7.8 1.45 8.3 1.95 9.7 2.45 10 2.95 7.6 3.45 7.6 3.95 7.6 4.45 7.6 4.95 7.6" }); - def = this->add("filament_unload_time", coFloats); - def->label = L("Filament unload time"); - def->tooltip = L("Time for the printer firmware (or the Multi Material Unit 2.0) to unload a filament during a tool change (when executing the T code). This time is added to the total print time by the G-code time estimator."); - def->sidetext = L("s"); - def->min = 0; - def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloats { 0. }); - def = this->add("filament_multitool_ramming", coBools); def->label = L("Enable ramming for multitool setups"); def->tooltip = L("Perform ramming when using multitool printer (i.e. when the 'Single Extruder Multimaterial' in Printer Settings is unchecked). " @@ -6146,7 +6139,7 @@ void PrintConfigDef::handle_legacy(t_config_option_key &opt_key, std::string &va "z_hop_type", "z_lift_type", "bed_temperature_difference","long_retraction_when_cut", "retraction_distance_when_cut", "extruder_type", - "internal_bridge_support_thickness","extruder_clearance_max_radius", "top_area_threshold", "reduce_wall_solid_infill" + "internal_bridge_support_thickness","extruder_clearance_max_radius", "top_area_threshold", "reduce_wall_solid_infill","filament_load_time","filament_unload_time" }; if (ignore.find(opt_key) != ignore.end()) { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 000559b765..015befbd9f 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1119,15 +1119,13 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, parking_pos_retraction)) ((ConfigOptionFloat, extra_loading_move)) ((ConfigOptionFloat, machine_load_filament_time)) + ((ConfigOptionFloat, machine_tool_change_time)) ((ConfigOptionFloat, machine_unload_filament_time)) ((ConfigOptionFloats, filament_loading_speed)) ((ConfigOptionFloats, filament_loading_speed_start)) - ((ConfigOptionFloats, filament_load_time)) ((ConfigOptionFloats, filament_unloading_speed)) ((ConfigOptionFloats, filament_unloading_speed_start)) ((ConfigOptionFloats, filament_toolchange_delay)) - // Orca todo: consolidate with machine_load_filament_time - ((ConfigOptionFloats, filament_unload_time)) ((ConfigOptionInts, filament_cooling_moves)) ((ConfigOptionFloats, filament_cooling_initial_speed)) ((ConfigOptionFloats, filament_minimal_purge_on_wipe_tower)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3bcb4eda28..4672bc8aa6 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3437,8 +3437,6 @@ void TabFilament::build() optgroup->append_single_option_line("filament_loading_speed", "semm"); optgroup->append_single_option_line("filament_unloading_speed_start", "semm"); optgroup->append_single_option_line("filament_unloading_speed", "semm"); - optgroup->append_single_option_line("filament_load_time", "semm"); - optgroup->append_single_option_line("filament_unload_time", "semm"); optgroup->append_single_option_line("filament_toolchange_delay", "semm"); optgroup->append_single_option_line("filament_cooling_moves", "semm"); optgroup->append_single_option_line("filament_cooling_initial_speed", "semm"); @@ -3581,10 +3579,9 @@ void TabFilament::toggle_options() if (m_active_page->title() == L("Multimaterial")) { // Orca: hide specific settings for BBL printers - for (auto el : - {"filament_minimal_purge_on_wipe_tower", "filament_loading_speed_start", "filament_loading_speed", - "filament_unloading_speed_start", "filament_unloading_speed", "filament_load_time", "filament_unload_time", - "filament_toolchange_delay", "filament_cooling_moves", "filament_cooling_initial_speed", "filament_cooling_final_speed"}) + for (auto el : {"filament_minimal_purge_on_wipe_tower", "filament_loading_speed_start", "filament_loading_speed", + "filament_unloading_speed_start", "filament_unloading_speed", "filament_toolchange_delay", "filament_cooling_moves", + "filament_cooling_initial_speed", "filament_cooling_final_speed"}) toggle_option(el, !is_BBL_printer); } } @@ -3741,8 +3738,6 @@ void TabPrinter::build_fff() optgroup->append_single_option_line("use_relative_e_distances"); optgroup->append_single_option_line("use_firmware_retraction"); // optgroup->append_single_option_line("spaghetti_detector"); - optgroup->append_single_option_line("machine_load_filament_time"); - optgroup->append_single_option_line("machine_unload_filament_time"); optgroup->append_single_option_line("time_cost"); optgroup = page->new_optgroup(L("Cooling Fan"), "param_cooling_fan"); @@ -4197,6 +4192,11 @@ if (is_marlin_flavor) optgroup->append_single_option_line("parking_pos_retraction", "semm"); optgroup->append_single_option_line("extra_loading_move", "semm"); optgroup->append_single_option_line("high_current_on_filament_swap", "semm"); + + optgroup = page->new_optgroup(L("Advanced"), L"param_advanced"); + optgroup->append_single_option_line("machine_load_filament_time"); + optgroup->append_single_option_line("machine_unload_filament_time"); + optgroup->append_single_option_line("machine_tool_change_time"); m_pages.insert(m_pages.end() - n_after_single_extruder_MM, page); } @@ -4443,9 +4443,8 @@ void TabPrinter::toggle_options() if (m_active_page->title() == L("Basic information")) { // SoftFever: hide BBL specific settings - for (auto el : - {"scan_first_layer", "machine_load_filament_time", "machine_unload_filament_time", "bbl_calib_mark_logo", "bbl_use_printhost"}) - toggle_line(el, is_BBL_printer); + for (auto el : {"scan_first_layer", "bbl_calib_mark_logo", "bbl_use_printhost"}) + toggle_line(el, is_BBL_printer); // SoftFever: hide non-BBL settings for (auto el : {"use_firmware_retraction", "use_relative_e_distances", "support_multi_bed_types", "pellet_modded_printer"})