mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-13 09:47:58 -06:00
* Fix for #3311: The `config.filament_load_time.values` and `config.filament_unload_time.values` are completely ignored. This was working in PrusaSlicer and apparently BBS converted the `GCodeProcessor::TimeProcessor.filament_load_times` and `GCodeProcessor::TimeProcessor.filament_unload_times` from being `std::vector<float>` to just `float` and they were using the BBS specific and currently hidden `machine_load_filament_time` and `machine_unload_filament_time` config values. Reverted that change by copying those lines from PrusaSlicer. * Fix for #3311: Updated the previously fixed to code to keep compatibility with BBS printer . * Fix for #3311: Updated `GCodeProcessor::get_filament_unload_time()` to keep compatibility with BBS printers.
This commit is contained in:
parent
aac618dcb7
commit
252788419b
2 changed files with 72 additions and 17 deletions
|
@ -387,9 +387,8 @@ void GCodeProcessor::TimeProcessor::reset()
|
||||||
extruder_unloaded = true;
|
extruder_unloaded = true;
|
||||||
machine_envelope_processing_enabled = false;
|
machine_envelope_processing_enabled = false;
|
||||||
machine_limits = MachineEnvelopeConfig();
|
machine_limits = MachineEnvelopeConfig();
|
||||||
filament_load_times = 0.0f;
|
filament_load_times = std::vector<float>();
|
||||||
filament_unload_times = 0.0f;
|
filament_unload_times = std::vector<float>();
|
||||||
|
|
||||||
|
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
||||||
machines[i].reset();
|
machines[i].reset();
|
||||||
|
@ -1036,8 +1035,23 @@ 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.
|
// 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
|
// 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.
|
// are considered to be active for the single extruder multi-material printers only.
|
||||||
m_time_processor.filament_load_times = static_cast<float>(config.machine_load_filament_time.value);
|
if(s_IsBBLPrinter){
|
||||||
m_time_processor.filament_unload_times = static_cast<float>(config.machine_unload_filament_time.value);
|
// 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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (size_t i = 0; i < static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count); ++i) {
|
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);
|
float max_acceleration = get_option_value(m_time_processor.machine_limits.machine_max_acceleration_extruding, i);
|
||||||
|
@ -1245,13 +1259,36 @@ void GCodeProcessor::apply_config(const DynamicPrintConfig& config)
|
||||||
|
|
||||||
m_extruder_temps.resize(m_result.extruders_count);
|
m_extruder_temps.resize(m_result.extruders_count);
|
||||||
|
|
||||||
const ConfigOptionFloat* machine_load_filament_time = config.option<ConfigOptionFloat>("machine_load_filament_time");
|
if(s_IsBBLPrinter){
|
||||||
if (machine_load_filament_time != nullptr)
|
// BBL printers use machine_load_filament_time and machine_unload_filament_time
|
||||||
m_time_processor.filament_load_times = 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.resize(1);
|
||||||
|
m_time_processor.filament_load_times[0] = static_cast<float>(machine_load_filament_time->value);
|
||||||
|
}
|
||||||
|
|
||||||
const ConfigOptionFloat* machine_unload_filament_time = config.option<ConfigOptionFloat>("machine_unload_filament_time");
|
const ConfigOptionFloat* machine_unload_filament_time = config.option<ConfigOptionFloat>("machine_unload_filament_time");
|
||||||
if (machine_unload_filament_time != nullptr)
|
if (machine_unload_filament_time != nullptr){
|
||||||
m_time_processor.filament_unload_times = static_cast<float>(machine_unload_filament_time->value);
|
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) {
|
if (m_flavor == gcfMarlinLegacy || m_flavor == gcfMarlinFirmware || m_flavor == gcfKlipper) {
|
||||||
const ConfigOptionFloats* machine_max_acceleration_x = config.option<ConfigOptionFloats>("machine_max_acceleration_x");
|
const ConfigOptionFloats* machine_max_acceleration_x = config.option<ConfigOptionFloats>("machine_max_acceleration_x");
|
||||||
|
@ -4357,14 +4394,32 @@ void GCodeProcessor::set_travel_acceleration(PrintEstimatedStatistics::ETimeMode
|
||||||
|
|
||||||
float GCodeProcessor::get_filament_load_time(size_t extruder_id)
|
float GCodeProcessor::get_filament_load_time(size_t extruder_id)
|
||||||
{
|
{
|
||||||
//BBS: change load time to machine config and all extruder has same value
|
if (s_IsBBLPrinter) {
|
||||||
return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_load_times;
|
// 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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float GCodeProcessor::get_filament_unload_time(size_t extruder_id)
|
float GCodeProcessor::get_filament_unload_time(size_t extruder_id)
|
||||||
{
|
{
|
||||||
//BBS: change unload time to machine config and all extruder has same value
|
if (s_IsBBLPrinter) {
|
||||||
return m_time_processor.extruder_unloaded ? 0.0f : m_time_processor.filament_unload_times;
|
// 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
|
//BBS
|
||||||
|
|
|
@ -476,8 +476,8 @@ namespace Slic3r {
|
||||||
bool machine_envelope_processing_enabled;
|
bool machine_envelope_processing_enabled;
|
||||||
MachineEnvelopeConfig machine_limits;
|
MachineEnvelopeConfig machine_limits;
|
||||||
// Additional load / unload times for a filament exchange sequence.
|
// Additional load / unload times for a filament exchange sequence.
|
||||||
float filament_load_times;
|
std::vector<float> filament_load_times;
|
||||||
float filament_unload_times;
|
std::vector<float> filament_unload_times;
|
||||||
bool disable_m73;
|
bool disable_m73;
|
||||||
|
|
||||||
std::array<TimeMachine, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> machines;
|
std::array<TimeMachine, static_cast<size_t>(PrintEstimatedStatistics::ETimeMode::Count)> machines;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue