mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -06:00
ENH: support to config printer arch
Change-Id: Ib3e0cdfa10ae19c3f5543328e211bce7ff20693a Signed-off-by: Stone Li <stone.li@bambulab.com> (cherry picked from commit 24e513a89f2346e9187853cd02f8e5d73eeb8075)
This commit is contained in:
parent
957159d383
commit
3595310b09
3 changed files with 43 additions and 3 deletions
|
@ -67,6 +67,7 @@
|
|||
"FUNC_CHAMBER_FAN": false,
|
||||
"FUNC_SEND_TO_SDCARD": false
|
||||
},
|
||||
"printer_arch" : "i3",
|
||||
"camera_resolution": [ "720p" ],
|
||||
"bed_temperature_limit": 100,
|
||||
"model_id": "N1",
|
||||
|
|
|
@ -139,6 +139,18 @@ void split_string(std::string s, std::vector<std::string>& v) {
|
|||
v.push_back(t);
|
||||
}
|
||||
|
||||
PrinterArch get_printer_arch_by_str(std::string arch_str)
|
||||
{
|
||||
if (arch_str == "i3") {
|
||||
return PrinterArch::ARCH_I3;
|
||||
}
|
||||
else if (arch_str == "core_xy") {
|
||||
return PrinterArch::ARCH_CORE_XY;
|
||||
}
|
||||
|
||||
return PrinterArch::ARCH_CORE_XY;
|
||||
}
|
||||
|
||||
void AmsTray::update_color_from_str(std::string color)
|
||||
{
|
||||
if (color.empty()) return;
|
||||
|
@ -428,6 +440,11 @@ PrinterSeries MachineObject::get_printer_series() const
|
|||
return PrinterSeries::SERIES_P1P;
|
||||
}
|
||||
|
||||
PrinterArch MachineObject::get_printer_arch() const
|
||||
{
|
||||
return DeviceManager::get_printer_arch(printer_type);
|
||||
}
|
||||
|
||||
MachineObject::MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip)
|
||||
:dev_name(name),
|
||||
dev_id(id),
|
||||
|
@ -2426,9 +2443,9 @@ bool MachineObject::is_printing_finished()
|
|||
|
||||
bool MachineObject::is_core_xy()
|
||||
{
|
||||
if (printer_type == "N1")
|
||||
return false;
|
||||
if (get_printer_arch() == PrinterArch::ARCH_CORE_XY)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void MachineObject::reset_update_time()
|
||||
|
@ -5094,6 +5111,21 @@ std::string DeviceManager::get_ftp_folder(std::string type_str)
|
|||
return "";
|
||||
}
|
||||
|
||||
PrinterArch DeviceManager::get_printer_arch(std::string type_str)
|
||||
{
|
||||
PrinterArch arch = PrinterArch::ARCH_CORE_XY;
|
||||
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_arch")) {
|
||||
return get_printer_arch_by_str(printer["printer_arch"].get<std::string>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return arch;
|
||||
}
|
||||
|
||||
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||
{
|
||||
if (DeviceManager::function_table.contains("printers")) {
|
||||
|
|
|
@ -52,6 +52,11 @@ using namespace nlohmann;
|
|||
namespace Slic3r {
|
||||
|
||||
|
||||
enum PrinterArch {
|
||||
ARCH_CORE_XY,
|
||||
ARCH_I3,
|
||||
};
|
||||
|
||||
enum PrinterSeries {
|
||||
SERIES_X1 = 0,
|
||||
SERIES_P1P,
|
||||
|
@ -446,6 +451,7 @@ public:
|
|||
//PRINTER_TYPE printer_type = PRINTER_3DPrinter_UKNOWN;
|
||||
std::string printer_type; /* model_id */
|
||||
PrinterSeries get_printer_series() const;
|
||||
PrinterArch get_printer_arch() const;
|
||||
|
||||
std::string printer_thumbnail_img;
|
||||
std::string monitor_upgrade_printer_img;
|
||||
|
@ -946,6 +952,7 @@ public:
|
|||
static std::string parse_printer_type(std::string type_str);
|
||||
static std::string get_printer_display_name(std::string type_str);
|
||||
static std::string get_printer_thumbnail_img(std::string type_str);
|
||||
static PrinterArch get_printer_arch(std::string type_str);
|
||||
static std::string get_ftp_folder(std::string type_str);
|
||||
static bool is_function_supported(std::string type_str, std::string function_name);
|
||||
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue