ENH: remove the dulicate warning msg of temp

Signed-off-by: qing.zhang <qing.zhang@bambulab.com>
Change-Id: I978f2de34e277c6747adc783cb91c341f159a67e
This commit is contained in:
qing.zhang 2022-11-01 09:45:09 +08:00 committed by Lane.Wei
parent 8df60acc61
commit eae71a5184

View file

@ -3983,18 +3983,21 @@ void GCodeProcessor::update_slice_warnings()
auto used_extruders = get_used_extruders();
assert(!used_extruders.empty());
GCodeProcessorResult::SliceWarning warning;
warning.level = 1;
if (m_highest_bed_temp != 0) {
for (size_t i = 0; i < used_extruders.size(); i++) {
int temperature = get_filament_vitrification_temperature(used_extruders[i]);
if (temperature != 0 && m_highest_bed_temp > temperature) {
GCodeProcessorResult::SliceWarning warning;
warning.level = 1;
warning.msg = BED_TEMP_TOO_HIGH_THAN_FILAMENT;
m_result.warnings.emplace_back(std::move(warning));
}
if (temperature != 0 && m_highest_bed_temp > temperature)
warning.params.push_back(std::to_string(used_extruders[i]));
}
}
if (!warning.params.empty()) {
warning.msg = BED_TEMP_TOO_HIGH_THAN_FILAMENT;
m_result.warnings.push_back(warning);
}
m_result.warnings.shrink_to_fit();
}