mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
ENH: add some log for traverse
jira: [STUDIO-13728] Change-Id: Ie4419ecd809bd4392035ad063849f271e687b0f0 (cherry picked from commit 7aa1916fe8491ca1653acc55ee3ac527415b6113)
This commit is contained in:
@@ -110,8 +110,12 @@ std::string DevPrinterConfigUtil::get_fan_text(const std::string& type_str, cons
|
|||||||
|
|
||||||
std::map<std::string, std::vector<std::string>> DevPrinterConfigUtil::get_all_subseries(std::string type_str)
|
std::map<std::string, std::vector<std::string>> DevPrinterConfigUtil::get_all_subseries(std::string type_str)
|
||||||
{
|
{
|
||||||
std::map<std::string, std::vector<std::string>> subseries;
|
|
||||||
std::vector<wxString> m_files;
|
std::vector<wxString> m_files;
|
||||||
|
std::map<std::string, std::vector<std::string>> subseries;
|
||||||
|
|
||||||
|
#if !BBL_RELEASE_TO_PUBLIC
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": path= " << m_resource_file_path + "/printers/";
|
||||||
|
#endif
|
||||||
|
|
||||||
wxDir dir(m_resource_file_path + "/printers/");
|
wxDir dir(m_resource_file_path + "/printers/");
|
||||||
if (!dir.IsOpened()) { return subseries; }
|
if (!dir.IsOpened()) { return subseries; }
|
||||||
@@ -137,7 +141,6 @@ std::map<std::string, std::vector<std::string>> DevPrinterConfigUtil::get_all_su
|
|||||||
json_file >> jj;
|
json_file >> jj;
|
||||||
if (jj.contains("00.00.00.00"))
|
if (jj.contains("00.00.00.00"))
|
||||||
{
|
{
|
||||||
|
|
||||||
json const& printer = jj["00.00.00.00"];
|
json const& printer = jj["00.00.00.00"];
|
||||||
if (printer.contains("subseries"))
|
if (printer.contains("subseries"))
|
||||||
{
|
{
|
||||||
@@ -153,12 +156,36 @@ std::map<std::string, std::vector<std::string>> DevPrinterConfigUtil::get_all_su
|
|||||||
}
|
}
|
||||||
subseries.insert(make_pair(model_id, subs));
|
subseries.insert(make_pair(model_id, subs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (...) {}
|
catch (...)
|
||||||
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to load " << file;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !BBL_RELEASE_TO_PUBLIC
|
||||||
|
wxString result_str;
|
||||||
|
for (auto item : subseries)
|
||||||
|
{
|
||||||
|
wxString item_str = item.first;
|
||||||
|
item_str += ": ";
|
||||||
|
for (auto to_item : item.second)
|
||||||
|
{
|
||||||
|
item_str += to_item;
|
||||||
|
item_str += " ";
|
||||||
|
}
|
||||||
|
|
||||||
|
result_str += item_str + ", ";
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": result= " << result_str;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
if (subseries.empty())
|
||||||
|
{
|
||||||
|
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": result= " << "empty";
|
||||||
}
|
}
|
||||||
|
|
||||||
return subseries;
|
return subseries;
|
||||||
|
|||||||
Reference in New Issue
Block a user