Resync the DeviceCore state models

This commit is contained in:
SoftFever
2026-07-17 00:49:04 +08:00
parent 550ab5d438
commit 4bca7b3008
23 changed files with 529 additions and 200 deletions

View File

@@ -9,19 +9,6 @@ namespace Slic3r {
DevFilaSwitch::DevFilaSwitch(MachineObject *owner) { m_owner = owner; }
bool DevFilaSwitch::IsReady() const
{
if (!m_is_installed) { return false; }
const auto& ams_list = m_owner->GetFilaSystem()->GetAmsList();
for (const auto& ams_item : ams_list) {
if (ams_item.second->GetBindedExtruderSet().empty()) { return false; }
if (!ams_item.second->GetSwitcherPos().has_value()) { return false; }
}
return true;
}
void DevFilaSwitch::Reset()
{
m_is_installed = false;
@@ -34,6 +21,24 @@ void DevFilaSwitch::Reset()
m_cali_status = CaliStatus::CALI_IDLE;
}
bool DevFilaSwitch::IsReady() const
{
if (!m_is_installed) {
BOOST_LOG_TRIVIAL(debug) << "[FilaSwitch] IsReady: not installed";
return false;
}
const auto& ams_list = m_owner->GetFilaSystem()->GetAmsList();
for (const auto& ams_item : ams_list) {
if (ams_item.second->GetBindedExtruderSet().size() == 0) { return false; }
if (!ams_item.second->GetSwitcherPos().has_value()) {
return false;
}
}
return true;
}
std::optional<DevAmsTray> DevFilaSwitch::GetInA_Slot() const
{
auto ams_id_opt = GetInA_SlotId();
@@ -128,4 +133,4 @@ void DevFilaSwitch::ParseFilaSwitchInfo(const nlohmann::json &print_jj)
}
}
}; // namespace Slic3r
}; // namespace Slic3r