mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-10-19 23:01:22 -06:00
NEW:added sending gcode file to sdcard
Change-Id: I60654676a3001c59b8202581576fbfcd5f8388eb (cherry picked from commit 930b8e034aaa55743aa02fc6e3961fdc388ce53c)
This commit is contained in:
parent
631dd00038
commit
29e19cb32e
14 changed files with 1613 additions and 10 deletions
|
@ -72,6 +72,7 @@ func_get_user_selected_machine NetworkAgent::get_user_selected_machine_ptr
|
|||
func_set_user_selected_machine NetworkAgent::set_user_selected_machine_ptr = nullptr;
|
||||
func_start_print NetworkAgent::start_print_ptr = nullptr;
|
||||
func_start_local_print_with_record NetworkAgent::start_local_print_with_record_ptr = nullptr;
|
||||
func_start_send_gcode_to_sdcard NetworkAgent::start_send_gcode_to_sdcard_ptr = nullptr;
|
||||
func_start_local_print NetworkAgent::start_local_print_ptr = nullptr;
|
||||
func_get_user_presets NetworkAgent::get_user_presets_ptr = nullptr;
|
||||
func_request_setting_id NetworkAgent::request_setting_id_ptr = nullptr;
|
||||
|
@ -208,6 +209,7 @@ int NetworkAgent::initialize_network_module(bool using_backup)
|
|||
set_user_selected_machine_ptr = reinterpret_cast<func_set_user_selected_machine>(get_network_function("bambu_network_set_user_selected_machine"));
|
||||
start_print_ptr = reinterpret_cast<func_start_print>(get_network_function("bambu_network_start_print"));
|
||||
start_local_print_with_record_ptr = reinterpret_cast<func_start_local_print_with_record>(get_network_function("bambu_network_start_local_print_with_record"));
|
||||
start_send_gcode_to_sdcard_ptr = reinterpret_cast<func_start_send_gcode_to_sdcard>(get_network_function("bambu_network_start_send_gcode_to_sdcard"));
|
||||
start_local_print_ptr = reinterpret_cast<func_start_local_print>(get_network_function("bambu_network_start_local_print"));
|
||||
get_user_presets_ptr = reinterpret_cast<func_get_user_presets>(get_network_function("bambu_network_get_user_presets"));
|
||||
request_setting_id_ptr = reinterpret_cast<func_request_setting_id>(get_network_function("bambu_network_request_setting_id"));
|
||||
|
@ -298,6 +300,7 @@ int NetworkAgent::unload_network_module()
|
|||
set_user_selected_machine_ptr = nullptr;
|
||||
start_print_ptr = nullptr;
|
||||
start_local_print_with_record_ptr = nullptr;
|
||||
start_send_gcode_to_sdcard_ptr = nullptr;
|
||||
start_local_print_ptr = nullptr;
|
||||
get_user_presets_ptr = nullptr;
|
||||
request_setting_id_ptr = nullptr;
|
||||
|
@ -841,6 +844,17 @@ int NetworkAgent::start_local_print_with_record(PrintParams params, OnUpdateStat
|
|||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
if (network_agent && start_send_gcode_to_sdcard_ptr) {
|
||||
ret = start_send_gcode_to_sdcard_ptr(network_agent, params, update_fn, cancel_fn);
|
||||
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << boost::format(" : network_agent=%1%, ret=%2%, dev_id=%3%, task_name=%4%, project_name=%5%")
|
||||
% network_agent % ret % params.dev_id % params.task_name % params.project_name;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int NetworkAgent::start_local_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn)
|
||||
{
|
||||
int ret = 0;
|
||||
|
|
|
@ -51,6 +51,7 @@ typedef std::string (*func_get_user_selected_machine)(void *agent);
|
|||
typedef int (*func_set_user_selected_machine)(void *agent, std::string dev_id);
|
||||
typedef int (*func_start_print)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_local_print_with_record)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_send_gcode_to_sdcard)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_start_local_print)(void *agent, PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
typedef int (*func_get_user_presets)(void *agent, std::map<std::string, std::map<std::string, std::string>>* user_presets);
|
||||
typedef std::string (*func_request_setting_id)(void *agent, std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
|
@ -130,6 +131,7 @@ public:
|
|||
int set_user_selected_machine(std::string dev_id);
|
||||
int start_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_local_print_with_record(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_send_gcode_to_sdcard(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int start_local_print(PrintParams params, OnUpdateStatusFn update_fn, WasCancelledFn cancel_fn);
|
||||
int get_user_presets(std::map<std::string, std::map<std::string, std::string>>* user_presets);
|
||||
std::string request_setting_id(std::string name, std::map<std::string, std::string>* values_map, unsigned int* http_code);
|
||||
|
@ -198,6 +200,7 @@ private:
|
|||
static func_set_user_selected_machine set_user_selected_machine_ptr;
|
||||
static func_start_print start_print_ptr;
|
||||
static func_start_local_print_with_record start_local_print_with_record_ptr;
|
||||
static func_start_send_gcode_to_sdcard start_send_gcode_to_sdcard_ptr;
|
||||
static func_start_local_print start_local_print_ptr;
|
||||
static func_get_user_presets get_user_presets_ptr;
|
||||
static func_request_setting_id request_setting_id_ptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue