mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 10:02:12 +00:00
clean up
This commit is contained in:
@@ -114,16 +114,10 @@ NetworkAgent::NetworkAgent(std::string log_dir)
|
||||
plugin.create_agent(log_dir);
|
||||
}
|
||||
|
||||
// Create BBL sub-agents that will use the singleton
|
||||
m_cloud_agent = std::make_shared<BBLCloudServiceAgent>();
|
||||
m_printer_agent = std::make_shared<BBLPrinterAgent>();
|
||||
m_printer_agent->set_cloud_agent(m_cloud_agent);
|
||||
m_printer_agent_id = m_printer_agent->get_agent_info().id;
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", this %1%, agent=%2%, log_dir=%3%")
|
||||
% this % plugin.get_agent() % log_dir;
|
||||
} else {
|
||||
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": BBL network plugin not loaded";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -132,17 +126,12 @@ NetworkAgent::NetworkAgent(std::shared_ptr<ICloudServiceAgent> cloud_agent,
|
||||
: m_cloud_agent(std::move(cloud_agent))
|
||||
, m_printer_agent(std::move(printer_agent))
|
||||
{
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(
|
||||
", sub-agent composition mode: cloud=%1%, printer=%2%")
|
||||
% (m_cloud_agent ? "yes" : "no")
|
||||
% (m_printer_agent ? "yes" : "no (will be set when printer selected)");
|
||||
}
|
||||
|
||||
NetworkAgent::~NetworkAgent()
|
||||
{
|
||||
// Note: We don't destroy the agent here anymore since it's managed by BBLNetworkPlugin singleton
|
||||
// The singleton manages the agent lifecycle
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(", this %1%") % this;
|
||||
}
|
||||
|
||||
void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agent)
|
||||
@@ -158,7 +147,6 @@ void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agen
|
||||
std::lock_guard<std::mutex> lock(m_agent_mutex);
|
||||
|
||||
if (!printer_agent) {
|
||||
BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": null printer agent provided";
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -180,8 +168,6 @@ void NetworkAgent::set_printer_agent(std::shared_ptr<IPrinterAgent> printer_agen
|
||||
// critical section duration. The local shared_ptr copy ensures the agent
|
||||
// cannot be destroyed while we're using it.
|
||||
apply_printer_callbacks(new_printer_agent, callbacks);
|
||||
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": agent switched successfully";
|
||||
}
|
||||
|
||||
void* NetworkAgent::get_network_agent()
|
||||
|
||||
Reference in New Issue
Block a user