mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-05 19:27:57 -05:00
Connect the selected printer agent to a printer saved under the Orca agent (#17141)
A printer saved while its preset used the default Orca agent stayed tagged "orca" after the preset moved to another agent such as Moonraker. select_machine() reused that entry as is, but the new agent's machine list can't see it, so the printer never connected and filament sync did nothing.
select_machine() now re-inserts such an entry for the active agent, which retags it and replaces the placeholder access code with the preset's API key. Entries saved under any other agent are left alone, so a code entered for that agent is kept.
Fixes #17004
(cherry picked from commit a30aa7ba8d)
This commit is contained in:
1 parent
035a96e968
commit
bd15c1c8c1
1 file changed
+5
-3
@@ -4501,8 +4501,10 @@ void GUI_App::select_machine(const std::string& agent_id)
|
||||
}
|
||||
}
|
||||
|
||||
// If machine doesn't exist, create it first
|
||||
if (!existing) {
|
||||
// If machine doesn't exist, create it first. The Orca agent never connects, so an entry saved
|
||||
// under it holds no binding; re-insert it for the active agent, whose machine list can't see
|
||||
// it otherwise. Entries bound by any other agent stay with that agent.
|
||||
if (!existing || (existing->printer_agent_id == ORCA_PRINTER_AGENT_ID && agent_id != ORCA_PRINTER_AGENT_ID)) {
|
||||
BBLocalMachine machine;
|
||||
machine.dev_id = dev_id;
|
||||
// We use dev_id as dev_ip to store the address (host:port)
|
||||
@@ -4517,7 +4519,7 @@ void GUI_App::select_machine(const std::string& agent_id)
|
||||
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to create machine dev_id=" << dev_id;
|
||||
return;
|
||||
}
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created new machine dev_id=" << dev_id;
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created or adopted machine dev_id=" << dev_id;
|
||||
} else if (agent_id == MOONRAKER_PRINTER_AGENT_ID && existing->printer_agent_id == agent_id &&
|
||||
(!existing->has_access_right() || existing->get_access_code() != access_code)) {
|
||||
existing->set_access_code(access_code);
|
||||
|
||||
Reference in new issue
Block a user