mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-07 06:57:36 -06:00
ENH:display different thumbnails according to the printer type
Change-Id: I1534594923fdcafb231661a1a7fa289221277449
This commit is contained in:
parent
5139edb876
commit
b5e38e02fe
14 changed files with 474 additions and 387 deletions
|
@ -279,6 +279,11 @@ std::string MachineObject::get_preset_printer_model_name(std::string printer_typ
|
|||
return DeviceManager::get_printer_display_name(printer_type);
|
||||
}
|
||||
|
||||
std::string MachineObject::get_preset_printer_thumbnail_img(std::string printer_type)
|
||||
{
|
||||
return DeviceManager::get_printer_thumbnail_img(printer_type);
|
||||
}
|
||||
|
||||
wxString MachineObject::get_printer_type_display_str()
|
||||
{
|
||||
std::string display_name = get_preset_printer_model_name(printer_type);
|
||||
|
@ -288,6 +293,15 @@ wxString MachineObject::get_printer_type_display_str()
|
|||
return _L("Unknown");
|
||||
}
|
||||
|
||||
std::string MachineObject::get_printer_thumbnail_img_str()
|
||||
{
|
||||
std::string img_str = get_preset_printer_thumbnail_img(printer_type);
|
||||
if (!img_str.empty())
|
||||
return img_str;
|
||||
else
|
||||
return "printer_thumbnail";
|
||||
}
|
||||
|
||||
void MachineObject::set_access_code(std::string code)
|
||||
{
|
||||
this->access_code = code;
|
||||
|
@ -3696,6 +3710,20 @@ std::string DeviceManager::get_printer_display_name(std::string type_str)
|
|||
return "";
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_thumbnail_img(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("printer_thumbnail_image")) {
|
||||
return printer["printer_thumbnail_image"].get<std::string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
bool DeviceManager::is_function_supported(std::string type_str, std::string function_name)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue