mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-09 07:56:24 -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
|
@ -24,6 +24,7 @@
|
|||
"bed_temperature_limit": 100,
|
||||
"model_id": "C11",
|
||||
"printer_type": "C11",
|
||||
"ftp_folder" : "sdcard/",
|
||||
"printer_thumbnail_image": "printer_thumbnail_p1p"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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")) {
|
||||
|
|
|
@ -405,6 +405,8 @@ public:
|
|||
std::string connection_type() { return dev_connection_type; }
|
||||
void set_dev_ip(std::string ip) {dev_ip = ip;};
|
||||
bool has_access_right() { return !get_access_code().empty(); }
|
||||
std::string get_ftp_folder();
|
||||
void set_access_code(std::string code);
|
||||
std::string get_access_code();
|
||||
|
||||
void set_access_code(std::string code);
|
||||
|
@ -834,6 +836,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 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);
|
||||
|
||||
|
|
|
@ -177,6 +177,7 @@ void PrintJob::process()
|
|||
}
|
||||
|
||||
params.dev_id = m_dev_id;
|
||||
params.ftp_folder = m_ftp_folder;
|
||||
//params.project_name = project_name;
|
||||
params.project_name = m_project_name;
|
||||
params.preset_name = wxGetApp().preset_bundle->prints.get_selected_preset_name();
|
||||
|
|
|
@ -42,6 +42,7 @@ public:
|
|||
|
||||
std::string m_project_name;
|
||||
std::string m_dev_ip;
|
||||
std::string m_ftp_folder;
|
||||
bool m_local_use_ssl { true };
|
||||
std::string m_access_code;
|
||||
std::string task_bed_type;
|
||||
|
|
|
@ -2180,6 +2180,7 @@ void SelectMachineDialog::on_ok()
|
|||
|
||||
m_print_job = std::make_shared<PrintJob>(m_status_bar, m_plater, m_printer_last_select);
|
||||
m_print_job->m_dev_ip = obj_->dev_ip;
|
||||
m_print_job->m_ftp_folder = obj_->get_ftp_folder();
|
||||
m_print_job->m_access_code = obj_->get_access_code();
|
||||
m_print_job->m_local_use_ssl = obj_->local_use_ssl;
|
||||
m_print_job->connection_type = obj_->connection_type();
|
||||
|
|
|
@ -120,6 +120,7 @@ struct PrintParams {
|
|||
std::string filename;
|
||||
std::string config_filename;
|
||||
int plate_index;
|
||||
std::string ftp_folder;
|
||||
std::string ftp_file;
|
||||
std::string ftp_file_md5;
|
||||
std::string ams_mapping;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue