mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user