Resync the AMS control and item widgets

This commit is contained in:
SoftFever
2026-07-17 04:30:45 +08:00
parent db51d8ab9b
commit 7265a2fbfe
4 changed files with 58 additions and 23 deletions

View File

@@ -64,6 +64,7 @@ bool AMSinfo::parse_ams_info(MachineObject *obj, DevAms *ams, bool remain_flag,
this->ams_type = AMSModel(ams->GetAmsType());
nozzle_id = ams->GetExtruderId();
switch_pos = ams->GetSwitcherPos(); // Orca: carry the switch inlet for inlet-aware panel placement
cans.clear();
for (int i = 0; i < ams->GetTrays().size(); i++) {
auto it = ams->GetTrays().find(std::to_string(i));
@@ -234,6 +235,19 @@ int AMSinfo::get_humidity_display_idx() const
return 1;
}
// Orca: inlet-aware panel routing. REF placed AMS by switch inlet (POS_IN_A/B) via a tray-level binding
// that Orca's pull-mode fila model does not carry; the AMS-level DevAms::GetSwitcherPos() does, and it is
// stashed in switch_pos. When a Filament Track Switch is installed the device pins nozzle_id to MAIN for
// command consumers, so placement follows the inlet here instead (POS_IN_B -> main/right, POS_IN_A ->
// deputy/left). switch_pos is empty on switch-less machines and for ext spools (no tray-level inlet in the
// kept model), so this reduces to the original nozzle_id == MAIN_EXTRUDER_ID test — identical behavior.
bool AMSinfo::routes_to_main_extruder() const
{
if (switch_pos.has_value())
return switch_pos.value() == DevFilaSwitch::SwitchPos::POS_IN_B;
return nozzle_id == MAIN_EXTRUDER_ID;
}
/*************************************************
Description:AMSExtText
**************************************************/