mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 02:22:17 +00:00
Implement manual printer setup
This commit is contained in:
@@ -5496,18 +5496,28 @@ void DeviceManager::on_machine_alive(std::string json_str)
|
||||
}
|
||||
}
|
||||
|
||||
MachineObject* DeviceManager::insert_local_device(std::string dev_name, std::string dev_id, std::string dev_ip, 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;
|
||||
obj = new MachineObject(m_agent, dev_name, dev_id, dev_ip);
|
||||
obj->printer_type = MachineObject::parse_printer_type("C11");
|
||||
auto it = localMachineList.find(machine.dev_id);
|
||||
if (it != localMachineList.end()) {
|
||||
obj = it->second;
|
||||
} else {
|
||||
obj = new MachineObject(m_agent, machine.dev_name, machine.dev_id, machine.dev_ip);
|
||||
localMachineList.insert(std::make_pair(machine.dev_id, obj));
|
||||
}
|
||||
obj->printer_type = MachineObject::parse_printer_type(machine.printer_type);
|
||||
obj->dev_connection_type = connection_type;
|
||||
obj->bind_state = bind_state;
|
||||
obj->bind_sec_link = "secure";
|
||||
obj->bind_ssdp_version = version;
|
||||
obj->m_is_online = true;
|
||||
obj->last_alive = Slic3r::Utils::get_current_time_utc();
|
||||
obj->set_access_code(access_code, false);
|
||||
obj->set_user_access_code(access_code, false);
|
||||
|
||||
update_local_machine(*obj);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user