NEW:add printer arch type
Change-Id: I4fedd3df960648d4ad1df32111431ccf126ef120
This commit is contained in:
parent
1453d196d8
commit
11f0fb6016
|
@ -171,6 +171,18 @@ void split_string(std::string s, std::vector<std::string>& v) {
|
||||||
v.push_back(t);
|
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)
|
void AmsTray::update_color_from_str(std::string color)
|
||||||
{
|
{
|
||||||
if (color.empty()) return;
|
if (color.empty()) return;
|
||||||
|
@ -453,6 +465,11 @@ PrinterSeries MachineObject::get_printer_series() const
|
||||||
return PrinterSeries::SERIES_P1P;
|
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)
|
MachineObject::MachineObject(NetworkAgent* agent, std::string name, std::string id, std::string ip)
|
||||||
:dev_name(name),
|
:dev_name(name),
|
||||||
dev_id(id),
|
dev_id(id),
|
||||||
|
@ -2339,6 +2356,13 @@ bool MachineObject::is_printing_finished()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool MachineObject::is_core_xy()
|
||||||
|
{
|
||||||
|
if (get_printer_arch() == PrinterArch::ARCH_CORE_XY)
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void MachineObject::reset_update_time()
|
void MachineObject::reset_update_time()
|
||||||
{
|
{
|
||||||
BOOST_LOG_TRIVIAL(trace) << "reset reset_update_time, dev_id =" << dev_id;
|
BOOST_LOG_TRIVIAL(trace) << "reset reset_update_time, dev_id =" << dev_id;
|
||||||
|
@ -5092,7 +5116,10 @@ std::string DeviceManager::get_ftp_folder(std::string type_str)
|
||||||
{
|
{
|
||||||
return get_string_from_config(type_str, "ftp_folder");
|
return get_string_from_config(type_str, "ftp_folder");
|
||||||
}
|
}
|
||||||
|
PrinterArch DeviceManager::get_printer_arch(std::string type_str)
|
||||||
|
{
|
||||||
|
return get_printer_arch_by_str(get_string_from_config(type_str, "printer_arch"));
|
||||||
|
}
|
||||||
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
std::string DeviceManager::get_printer_thumbnail_img(std::string type_str)
|
||||||
{
|
{
|
||||||
return get_string_from_config(type_str, "printer_thumbnail_image");
|
return get_string_from_config(type_str, "printer_thumbnail_image");
|
||||||
|
|
|
@ -52,6 +52,11 @@ using namespace nlohmann;
|
||||||
namespace Slic3r {
|
namespace Slic3r {
|
||||||
|
|
||||||
|
|
||||||
|
enum PrinterArch {
|
||||||
|
ARCH_CORE_XY,
|
||||||
|
ARCH_I3,
|
||||||
|
};
|
||||||
|
|
||||||
enum PrinterSeries {
|
enum PrinterSeries {
|
||||||
SERIES_X1 = 0,
|
SERIES_X1 = 0,
|
||||||
SERIES_P1P,
|
SERIES_P1P,
|
||||||
|
@ -407,6 +412,7 @@ public:
|
||||||
//PRINTER_TYPE printer_type = PRINTER_3DPrinter_UKNOWN;
|
//PRINTER_TYPE printer_type = PRINTER_3DPrinter_UKNOWN;
|
||||||
std::string printer_type; /* model_id */
|
std::string printer_type; /* model_id */
|
||||||
PrinterSeries get_printer_series() const;
|
PrinterSeries get_printer_series() const;
|
||||||
|
PrinterArch get_printer_arch() const;
|
||||||
|
|
||||||
std::string printer_thumbnail_img;
|
std::string printer_thumbnail_img;
|
||||||
std::string monitor_upgrade_printer_img;
|
std::string monitor_upgrade_printer_img;
|
||||||
|
@ -841,6 +847,7 @@ public:
|
||||||
bool is_in_printing();
|
bool is_in_printing();
|
||||||
bool is_in_prepare();
|
bool is_in_prepare();
|
||||||
bool is_printing_finished();
|
bool is_printing_finished();
|
||||||
|
bool is_core_xy();
|
||||||
void reset_update_time();
|
void reset_update_time();
|
||||||
void reset();
|
void reset();
|
||||||
static bool is_in_printing_status(std::string status);
|
static bool is_in_printing_status(std::string status);
|
||||||
|
@ -933,6 +940,7 @@ public:
|
||||||
static std::string parse_printer_type(std::string type_str);
|
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_display_name(std::string type_str);
|
||||||
static std::string get_printer_thumbnail_img(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 std::string get_ftp_folder(std::string type_str);
|
||||||
static bool is_function_supported(std::string type_str, std::string function_name);
|
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);
|
static std::vector<std::string> get_resolution_supported(std::string type_str);
|
||||||
|
|
Loading…
Reference in New Issue