mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
Feature/mmu toolchange time (#6426)
* Revert "Fix #3311: filament Load / Unload time was not used in time estimation (#3706)"
This reverts commit 252788419b
.
* revamp tool/filament change time
* tweak message
This commit is contained in:
parent
7bbffaa996
commit
a16a1e9307
6 changed files with 53 additions and 110 deletions
|
@ -392,8 +392,10 @@ void GCodeProcessor::TimeProcessor::reset()
|
|||
extruder_unloaded = true;
|
||||
machine_envelope_processing_enabled = false;
|
||||
machine_limits = MachineEnvelopeConfig();
|
||||
filament_load_times = std::vector<float>();
|
||||
filament_unload_times = std::vector<float>();
|
||||
filament_load_times = 0.0f;
|
||||
filament_unload_times = 0.0f;
|
||||
machine_tool_change_time = 0.0f;
|
||||
|
||||
|
||||
for (size_t i = 0; i < static_cast<size_t>(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<float>(config.machine_load_filament_time.value);
|
||||
m_time_processor.filament_unload_times.resize(1);
|
||||
m_time_processor.filament_unload_times[0] = static_cast<float>(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<float>(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<float>(config.filament_unload_time.values[i]);
|
||||
}
|
||||
}
|
||||
m_time_processor.filament_load_times = static_cast<float>(config.machine_load_filament_time.value);
|
||||
m_time_processor.filament_unload_times = static_cast<float>(config.machine_unload_filament_time.value);
|
||||
m_time_processor.machine_tool_change_time = static_cast<float>(config.machine_tool_change_time.value);
|
||||
|
||||
for (size_t i = 0; i < static_cast<size_t>(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<ConfigOptionFloat>("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<float>(machine_load_filament_time->value);
|
||||
}
|
||||
const ConfigOptionFloat* machine_load_filament_time = config.option<ConfigOptionFloat>("machine_load_filament_time");
|
||||
if (machine_load_filament_time != nullptr)
|
||||
m_time_processor.filament_load_times = static_cast<float>(machine_load_filament_time->value);
|
||||
|
||||
const ConfigOptionFloat* machine_unload_filament_time = config.option<ConfigOptionFloat>("machine_unload_filament_time");
|
||||
if (machine_unload_filament_time != nullptr)
|
||||
m_time_processor.filament_unload_times = static_cast<float>(machine_unload_filament_time->value);
|
||||
|
||||
const ConfigOptionFloat* machine_tool_change_time = config.option<ConfigOptionFloat>("machine_tool_change_time");
|
||||
if (machine_tool_change_time != nullptr)
|
||||
m_time_processor.machine_tool_change_time = static_cast<float>(machine_tool_change_time->value);
|
||||
|
||||
const ConfigOptionFloat* machine_unload_filament_time = config.option<ConfigOptionFloat>("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<float>(machine_unload_filament_time->value);
|
||||
}
|
||||
} else {
|
||||
// non-BBL printers use filament_load_time and filament_unload_time
|
||||
const ConfigOptionFloats* filament_load_time = config.option<ConfigOptionFloats>("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<float>(filament_load_time->values[i]);
|
||||
}
|
||||
}
|
||||
const ConfigOptionFloats* filament_unload_time = config.option<ConfigOptionFloats>("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<float>(filament_unload_time->values[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) {
|
||||
const ConfigOptionFloats* machine_max_acceleration_x = config.option<ConfigOptionFloats>("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<size_t>(m_last_extruder_id));
|
||||
m_time_processor.extruder_unloaded = false;
|
||||
extra_time += get_filament_load_time(static_cast<size_t>(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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue