mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-08-02 15:52:14 +00:00
Restore the extruder name fallback and fix the loading-busy check
This commit is contained in:
@@ -374,15 +374,19 @@ std::string DevPrinterConfigUtil::get_toolhead_display_name(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fallback: all dual-extruder printers should have tool_head_display_names configured.
|
// Orca: models that ship no tool_head_display_names (e.g. H2D/H2S) must still get distinct
|
||||||
// This is a safety net only — return a generic name.
|
// per-extruder labels, so fall back to the previous programmatic Left/Right construction.
|
||||||
|
// Engages only when the config lookup above yields nothing, so models that ship the key
|
||||||
|
// behave exactly like the reference.
|
||||||
if (result.empty()) {
|
if (result.empty()) {
|
||||||
static const std::map<ToolHeadComponent, std::string> fallback_names = {
|
const std::string side = ext_id == DEPUTY_EXTRUDER_ID ? "Left" : "Right";
|
||||||
{ ToolHeadComponent::Extruder, "Extruder" },
|
const std::string component_name = component == ToolHeadComponent::Extruder ? "Extruder" :
|
||||||
{ ToolHeadComponent::Nozzle, "Nozzle" },
|
component == ToolHeadComponent::Hotend ? "Hotend" : "Nozzle";
|
||||||
{ ToolHeadComponent::Hotend, "Hotend" }
|
result = side + " " + component_name;
|
||||||
};
|
if (name_case == ToolHeadNameCase::SentenceCase && result.size() > side.size() + 1)
|
||||||
result = fallback_names.at(component);
|
result[side.size() + 1] = static_cast<char>(std::tolower(static_cast<unsigned char>(result[side.size() + 1])));
|
||||||
|
else if (name_case == ToolHeadNameCase::LowerCase)
|
||||||
|
std::transform(result.begin(), result.end(), result.begin(), [](unsigned char c) { return static_cast<char>(std::tolower(c)); });
|
||||||
}
|
}
|
||||||
|
|
||||||
// short_name: return only the role prefix (e.g. "Main" from "Main Nozzle")
|
// short_name: return only the role prefix (e.g. "Main" from "Main Nozzle")
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ namespace Slic3r
|
|||||||
system->m_current_loading_extder_id = INVALID_EXTRUDER_ID;
|
system->m_current_loading_extder_id = INVALID_EXTRUDER_ID;
|
||||||
if (!system->m_extders[MAIN_EXTRUDER_ID].m_star.ams_id.empty())
|
if (!system->m_extders[MAIN_EXTRUDER_ID].m_star.ams_id.empty())
|
||||||
{
|
{
|
||||||
system->m_current_busy_for_loading = (system->m_extders[MAIN_EXTRUDER_ID].m_snow == system->m_extders[MAIN_EXTRUDER_ID].m_star);
|
system->m_current_busy_for_loading = (system->m_extders[MAIN_EXTRUDER_ID].m_snow != system->m_extders[MAIN_EXTRUDER_ID].m_star);
|
||||||
if (system->m_current_busy_for_loading)
|
if (system->m_current_busy_for_loading)
|
||||||
{
|
{
|
||||||
system->m_current_loading_extder_id = MAIN_EXTRUDER_ID;
|
system->m_current_loading_extder_id = MAIN_EXTRUDER_ID;
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ struct DevAmsSlotInfo
|
|||||||
std::string slot_id;
|
std::string slot_id;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
bool operator!=(const DevAmsSlotInfo& other) const { return !(*this == other); }
|
||||||
bool operator==(const DevAmsSlotInfo& other) const { return ams_id == other.ams_id && slot_id == other.slot_id;}
|
bool operator==(const DevAmsSlotInfo& other) const { return ams_id == other.ams_id && slot_id == other.slot_id;}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user