mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
NEW: support to config ftp_folder for printer [P1P]
Change-Id: I6a3b2a67d2950e2c1c5267bb7c65d5594924caec Signed-off-by: Stone Li <stone.li@bambulab.com> (cherry picked from commit 176e505bcf5f48971302d9aff14e74b118eeafbe)
This commit is contained in:
parent
6674aced8f
commit
fbc4de136f
7 changed files with 27 additions and 0 deletions
|
@ -302,6 +302,11 @@ std::string MachineObject::get_printer_thumbnail_img_str()
|
|||
return "printer_thumbnail";
|
||||
}
|
||||
|
||||
std::string MachineObject::get_ftp_folder()
|
||||
{
|
||||
return DeviceManager::get_ftp_folder(printer_type);
|
||||
}
|
||||
|
||||
void MachineObject::set_access_code(std::string code)
|
||||
{
|
||||
this->access_code = code;
|
||||
|
@ -4039,6 +4044,20 @@ std::string DeviceManager::get_printer_display_name(std::string type_str)
|
|||
return "";
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_ftp_folder(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
for (auto printer : DeviceManager::function_table["printers"]) {
|
||||
if (printer.contains("model_id") && printer["model_id"].get<std::string>() == type_str) {
|
||||
if (printer.contains("ftp_folder")) {
|
||||
return printer["ftp_folder"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue