OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
anonymous_namespace{DevManager.cpp} Namespace Reference

Functions

std::string get_access_code_with_legacy_fallback (Slic3r::AppConfig *config, const std::string &dev_id, const std::string &agent_id)

Function Documentation

◆ get_access_code_with_legacy_fallback()

std::string anonymous_namespace{DevManager.cpp}::get_access_code_with_legacy_fallback ( Slic3r::AppConfig * config,
const std::string & dev_id,
const std::string & agent_id )
50 {
51 const auto& machines = config->get_local_machines();
52 auto it = machines.find(dev_id);
53 if (it != machines.end() && it->second.printer_agent_id == agent_id && !it->second.access_code.empty())
54 return it->second.access_code;
55
56 if (agent_id == Slic3r::BBL_PRINTER_AGENT_ID || agent_id.empty()) {
57 std::string code = config->get("access_code", dev_id);
58 if (code.empty())
59 code = config->get("user_access_code", dev_id);
60 return code;
61 }
62 return "";
63 }
bool get(const std::string &section, const std::string &key, std::string &value) const
Definition AppConfig.hpp:147
const std::map< std::string, BBLocalMachine > & get_local_machines() const
Definition AppConfig.hpp:283
static constexpr char BBL_PRINTER_AGENT_ID[]
Definition NetworkAgentFactory.hpp:20

References Slic3r::BBL_PRINTER_AGENT_ID, Slic3r::AppConfig::get(), and Slic3r::AppConfig::get_local_machines().

Here is the call graph for this function: