FIX: use actual printer_type when connecting with ip&access_code

jira: [STUDIO-13841]
Change-Id: Iff594cd1f6dcd5c6485ab0aa67c98f422a75fd6c
(cherry picked from commit f8d0f62a1b3f3379de40a3b845c06fe61d907d82)
This commit is contained in:
haolin.tian
2025-08-05 20:05:16 +08:00
committed by Noisyfox
parent cae1fe4dd4
commit e68daa36c9
3 changed files with 13 additions and 4 deletions

View File

@@ -314,7 +314,9 @@ namespace Slic3r
}
}
MachineObject* DeviceManager::insert_local_device(const BBLocalMachine& machine, std::string connection_type, std::string bind_state, std::string version, std::string access_code)
MachineObject* DeviceManager::insert_local_device(const BBLocalMachine& machine,
std::string connection_type, std::string bind_state,
std::string version, std::string access_code)
{
MachineObject* obj;
auto it = localMachineList.find(machine.dev_id);
@@ -324,7 +326,10 @@ namespace Slic3r
obj = new MachineObject(this, m_agent, machine.dev_name, machine.dev_id, machine.dev_ip);
localMachineList.insert(std::make_pair(machine.dev_id, obj));
}
obj->printer_type = _parse_printer_type(machine.printer_type);
if (machine.printer_type.empty())
obj->printer_type = _parse_printer_type("C11");
else
obj->printer_type = _parse_printer_type(machine.printer_type);
obj->dev_connection_type = connection_type == "farm" ? "lan":connection_type;
obj->bind_state = connection_type == "farm" ? "free":bind_state;
obj->bind_sec_link = "secure";