Some QoL tweaks (#12700)

* 1. Calculate `FilamentTempType` based on `filament_info.json`, with a fallback to the temperature range.
2. Clean up some strings.

* Update src/slic3r/GUI/ObjColorDialog.cpp

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
SoftFever
2026-03-09 20:52:12 +08:00
committed by GitHub
parent d7ea6daae2
commit db7507b84e
4 changed files with 15 additions and 21 deletions

View File

@@ -2756,14 +2756,6 @@ Vec2d Print::translate_to_print_space(const Point &point) const {
FilamentTempType Print::get_filament_temp_type(const std::string& filament_type)
{
// FilamentTempType Temperature-based logic
int min_temp, max_temp;
if (MaterialType::get_temperature_range(filament_type, min_temp, max_temp)) {
if (max_temp <= 250) return FilamentTempType::LowTemp;
else if (max_temp < 280) return FilamentTempType::HighLowCompatible;
else return FilamentTempType::HighTemp;
}
const static std::string HighTempFilamentStr = "high_temp_filament";
const static std::string LowTempFilamentStr = "low_temp_filament";
const static std::string HighLowCompatibleFilamentStr = "high_low_compatible_filament";
@@ -2798,6 +2790,19 @@ FilamentTempType Print::get_filament_temp_type(const std::string& filament_type)
return HighTemp;
if (filament_temp_type_map[LowTempFilamentStr].find(filament_type) != filament_temp_type_map[LowTempFilamentStr].end())
return LowTemp;
// Orca: prefer explicit definition from JSON, if the filament type is not defined in json, fallback to temperature-based logic to determine the filament temp type.
// FilamentTempType Temperature-based logic
int min_temp, max_temp;
if (MaterialType::get_temperature_range(filament_type, min_temp, max_temp)) {
if (max_temp <= 250)
return FilamentTempType::LowTemp;
else if (max_temp < 280)
return FilamentTempType::HighLowCompatible;
else
return FilamentTempType::HighTemp;
}
return Undefine;
}