OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::SendJob Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/SendJob.hpp>

Inheritance diagram for Slic3r::GUI::SendJob:
Collaboration diagram for Slic3r::GUI::SendJob:

Public Types

enum  JobPrepareState { PREPARE_STATE_DEFAULT = 0 , PREPARE_STATE_MENU = 1 }

Public Member Functions

void prepare ()
 SendJob (std::string dev_id="")
int status_range () const
wxString get_http_error_msg (unsigned int status, std::string body)
void set_check_mode ()
void check_and_continue ()
bool is_finished ()
void process (Ctl &ctl) override
void on_success (std::function< void()> success)
void on_check_ip_address_fail (std::function< void(int)> func)
void on_check_ip_address_success (std::function< void()> func)
void finalize (bool canceled, std::exception_ptr &) override
void set_project_name (std::string name)

Public Attributes

std::string m_project_name
std::string m_dev_ip
std::string m_access_code
std::string task_bed_type
std::string task_ams_mapping
std::string connection_type
bool m_local_use_ssl_for_ftp {true}
bool m_local_use_ssl {true}
bool cloud_print_only { false }
bool has_sdcard { false }
bool task_use_ams { true }
DevStorage::SdcardState sdcard_state = DevStorage::SdcardState::NO_SDCARD
wxWindow * m_parent {nullptr}

Private Attributes

PrintPrepareData job_data
std::string m_dev_id
bool m_job_finished { false }
bool m_lifecycle_started { false }
bool m_lifecycle_finished { false }
int m_print_job_completed_id = 0
bool m_is_check_mode {false}
bool m_check_and_continue {false}
std::function< void()> m_success_fun {nullptr}
std::function< void(int)> m_enter_ip_address_fun_fail {nullptr}
std::function< void()> m_enter_ip_address_fun_success {nullptr}
Plater * m_plater

Detailed Description

Member Enumeration Documentation

◆ JobPrepareState

Enumerator
PREPARE_STATE_DEFAULT 
PREPARE_STATE_MENU 
22 {
25 };
@ PREPARE_STATE_MENU
Definition Job.hpp:24
@ PREPARE_STATE_DEFAULT
Definition Job.hpp:23

Constructor & Destructor Documentation

◆ SendJob()

Slic3r::GUI::SendJob::SendJob ( std::string dev_id = "")
50: m_plater{wxGetApp().plater()},
51 m_dev_id(dev_id)
52{
53 m_print_job_completed_id = m_plater->get_send_finished_event();
54}
std::string m_dev_id
Definition SendJob.hpp:25
int m_print_job_completed_id
Definition SendJob.hpp:29
Plater * m_plater
Definition SendJob.hpp:35

References m_dev_id, m_plater, m_print_job_completed_id, and Slic3r::GUI::plater().

Here is the call graph for this function:

Member Function Documentation

◆ check_and_continue()

void Slic3r::GUI::SendJob::check_and_continue ( )
inline
65{m_check_and_continue = true;};
bool m_check_and_continue
Definition SendJob.hpp:31

References m_check_and_continue.

◆ finalize()

void Slic3r::GUI::SendJob::finalize ( bool canceled,
std::exception_ptr & eptr )
overridevirtual

Reimplemented from Slic3r::GUI::Job.

441{
442 try {
443 if (eptr)
444 std::rethrow_exception(eptr);
445 eptr = nullptr;
446 } catch (...) {
447 eptr = std::current_exception();
448 }
449
451 LifecycleEventContext finish_ctx;
452 finish_ctx.name = m_project_name;
453 finish_ctx.device_id = m_dev_id;
454 finish_ctx.source = "send_job";
455 finish_ctx.code = canceled ? LifecycleEvtCode::Warn :
457 finish_ctx.msg = canceled ? "cancelled" : (eptr ? "exception" :
458 (m_job_finished ? "" : "failed"));
461 }
462
463 if (canceled || eptr)
464 return;
465}
std::string m_project_name
Definition SendJob.hpp:41
bool m_lifecycle_started
Definition SendJob.hpp:27
bool m_lifecycle_finished
Definition SendJob.hpp:28
bool m_job_finished
Definition SendJob.hpp:26
@ SendJobFinished
Definition LifecycleEvents.hpp:63
@ Warn
Definition LifecycleEvents.hpp:68
@ Error
Definition LifecycleEvents.hpp:68
@ Ok
Definition LifecycleEvents.hpp:68
void fire_lifecycle_event(LifecycleEvent event, const LifecycleEventContext &ctx)
Definition LifecycleEvents.hpp:234

References Slic3r::LifecycleEventContext::code, Slic3r::LifecycleEventContext::device_id, Slic3r::Error, Slic3r::fire_lifecycle_event(), m_dev_id, m_job_finished, m_lifecycle_finished, m_lifecycle_started, m_project_name, Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, Slic3r::Ok, Slic3r::SendJobFinished, Slic3r::LifecycleEventContext::source, and Slic3r::Warn.

Here is the call graph for this function:

◆ get_http_error_msg()

wxString Slic3r::GUI::SendJob::get_http_error_msg ( unsigned int status,
std::string body )
66{
67 int code = 0;
68 std::string error;
69 std::string message;
70 wxString result;
71 if (status >= 400 && status < 500)
72 try {
73 json j = json::parse(body);
74 if (j.contains("code")) {
75 if (!j["code"].is_null())
76 code = j["code"].get<int>();
77 }
78 if (j.contains("error")) {
79 if (!j["error"].is_null())
80 error = j["error"].get<std::string>();
81 }
82 if (j.contains("message")) {
83 if (!j["message"].is_null())
84 message = j["message"].get<std::string>();
85 }
86 }
87 catch (...) {
88 ;
89 }
90 else if (status == 503) {
91 return _L("Service Unavailable");
92 }
93 else {
94 wxString unkown_text = _L("Unknown Error.");
95 unkown_text += wxString::Format("status=%u, body=%s", status, body);
96 return unkown_text;
97 }
98
99 BOOST_LOG_TRIVIAL(error) << "http_error: status=" << status << ", code=" << code << ", error=" << error;
100
101 result = wxString::Format("code=%u, error=%s", code, from_u8(error));
102 return result;
103}
#define _L(s)
Definition OBJ.cpp:34
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
nlohmann::json json
Definition AssembleList.cpp:42

References _L, and Slic3r::GUI::from_u8().

Here is the call graph for this function:

◆ is_finished()

bool Slic3r::GUI::SendJob::is_finished ( )
inline
66{ return m_job_finished; }

References m_job_finished.

◆ on_check_ip_address_fail()

void Slic3r::GUI::SendJob::on_check_ip_address_fail ( std::function< void(int)> func)
430{
432}
std::function< void(int)> m_enter_ip_address_fun_fail
Definition SendJob.hpp:33

References m_enter_ip_address_fun_fail.

◆ on_check_ip_address_success()

void Slic3r::GUI::SendJob::on_check_ip_address_success ( std::function< void()> func)
435{
437}
std::function< void()> m_enter_ip_address_fun_success
Definition SendJob.hpp:34

References m_enter_ip_address_fun_success.

◆ on_success()

void Slic3r::GUI::SendJob::on_success ( std::function< void()> success)
425{
426 m_success_fun = success;
427}
std::function< void()> m_success_fun
Definition SendJob.hpp:32

References m_success_fun.

◆ prepare()

void Slic3r::GUI::SendJob::prepare ( )
57{
58 m_plater->get_print_job_data(&job_data);
59 std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
60 auto check_access_code_path = temp_file.c_str();
61 BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
62 job_data._temp_path = fs::path(check_access_code_path);
63}
PrintPrepareData job_data
Definition SendJob.hpp:24
void trace(unsigned int level, const char *message)
Definition utils.cpp:247
const std::string & resources_dir()
Definition utils.cpp:296

References job_data, m_plater, Slic3r::resources_dir(), and Slic3r::trace().

Referenced by process().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ process()

void Slic3r::GUI::SendJob::process ( Ctl & ctl)
overridevirtual

Implements Slic3r::GUI::Job.

120{
121 PrintParams params;
122 std::string msg;
123 int curr_percent = 10;
124 NetworkAgent* agent = wxGetApp().getAgent();
125 AppConfig* config = wxGetApp().app_config;
126 int result = -1;
127 std::string http_body;
128
129 if (this->connection_type == "lan") {
130 msg = _u8L("Sending print job over LAN");
131 }
132 else {
133 msg = _u8L("Sending print job through cloud service");
134 }
135
136 ctl.call_on_main_thread([this] { prepare(); }).wait();
137 ctl.update_status(0, msg);
138
139 // In check mode (InputIpAddressDialog / lan-mode send) verify the connection with a dummy
140 // "verify_job" upload and fire the caller's success/fail callback; when not continuing, stop
141 // here. Cloud sends skip this.
142 if (m_is_check_mode) {
143 PrintParams verify_params;
144 verify_params.dev_ip = m_dev_ip;
145 verify_params.username = agent->default_lan_username();
146 verify_params.password = m_access_code;
147 verify_params.use_ssl_for_ftp = m_local_use_ssl_for_ftp;
148 verify_params.use_ssl_for_mqtt = m_local_use_ssl;
149 verify_params.dev_id = m_dev_id;
150 verify_params.project_name = "verify_job";
151 verify_params.filename = job_data._temp_path.string();
152 verify_params.connection_type = this->connection_type;
153
154 int verify_result = agent->start_send_gcode_to_sdcard(verify_params, nullptr, nullptr, nullptr);
155 if (verify_result != 0) {
156 BOOST_LOG_TRIVIAL(error) << "send_job: access code / ip verification failed, result = " << verify_result;
158 m_job_finished = true;
159 return;
160 } else if (!m_check_and_continue) {
162 m_job_finished = true;
163 return;
164 }
165 }
166
167 LifecycleEventContext start_ctx;
168 start_ctx.name = m_project_name;
169 start_ctx.device_id = m_dev_id;
170 start_ctx.source = "send_job";
172 m_lifecycle_started = true;
173
174 int total_plate_num = m_plater->get_partplate_list().get_plate_count();
175
176 PartPlate* plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx);
177 if (plate == nullptr) {
178 if (job_data.plate_idx == PLATE_ALL_IDX) {
179 //all plate
180 for (int index = 0; index < total_plate_num; index++)
181 {
182 PartPlate* plate_n = m_plater->get_partplate_list().get_plate(index);
183 if (plate_n && plate_n->is_valid_gcode_file())
184 {
185 plate = plate_n;
186 break;
187 }
188 }
189 }
190 else {
191 plate = m_plater->get_partplate_list().get_curr_plate();
192 }
193 if (plate == nullptr) {
194 BOOST_LOG_TRIVIAL(error) << "can not find plate with valid gcode file when sending to print, plate_index="<< job_data.plate_idx;
195 ctl.update_status(curr_percent, check_gcode_failed_str);
196 return;
197 }
198 }
199
200 /* check gcode is valid */
201 if (!plate->is_valid_gcode_file()) {
202 ctl.update_status(curr_percent, check_gcode_failed_str);
203 return;
204 }
205
206 if (ctl.was_canceled()) {
207 ctl.update_status(curr_percent, printjob_cancel_str);
208 return;
209 }
210
211 std::string project_name = wxGetApp().plater()->get_project_name().ToUTF8().data();
212 int curr_plate_idx = 0;
213 if (job_data.plate_idx >= 0)
214 curr_plate_idx = job_data.plate_idx + 1;
215 else if (job_data.plate_idx == PLATE_CURRENT_IDX)
216 curr_plate_idx = m_plater->get_partplate_list().get_curr_plate_index() + 1;
217
218 params.dev_id = m_dev_id;
219 params.project_name = m_project_name + ".gcode.3mf";
220 params.preset_name = wxGetApp().preset_bundle->prints.get_selected_preset_name();
221
222 if (wxGetApp().plater()->using_exported_file())
223 params.filename = wxGetApp().plater()->get_3mf_filename();
224 else
225 params.filename = job_data._3mf_path.string();
226
227
228 params.config_filename = job_data._3mf_config_path.string();
229
230 params.plate_index = curr_plate_idx;
231 params.ams_mapping = this->task_ams_mapping;
232 params.connection_type = this->connection_type;
233 params.task_use_ams = this->task_use_ams;
234
235 // local print access
236 params.dev_ip = m_dev_ip;
237 params.username = agent->default_lan_username();
238 params.password = m_access_code;
239 params.use_ssl_for_ftp = m_local_use_ssl_for_ftp;
240 params.use_ssl_for_mqtt = m_local_use_ssl;
241 std::string msg_text;
242
243 const int StagePercentPoint[(int)PrintingStageFinished + 1] = {
244 20, // PrintingStageCreate
245 30, // PrintingStageUpload
246 99, // PrintingStageWaiting
247 99, // PrintingStageRecord
248 99, // PrintingStageSending
249 100, // PrintingStageFinished
250 100 // PrintingStageFinished
251 };
252
253 auto update_fn = [this, &ctl,
254 &msg, &curr_percent, StagePercentPoint](int stage, int code, std::string info) {
256 if (this->connection_type == "lan") {
257 msg = _u8L("Sending G-code file over LAN");
258 } else {
259 msg = _u8L("Sending G-code file to SD card");
260 }
261 }
263 if (code >= 0 && code <= 100 && !info.empty()) {
264 if (this->connection_type == "lan") {
265 msg = _u8L("Sending G-code file over LAN");
266 }
267 else {
268 msg = _u8L("Sending G-code file to SD card");
269 }
270 if (!info.empty()) {
271 msg += format("(%s)", info);
272 }
273 }
274 }
276 msg = format(_u8L("Successfully sent. Close current page in %s s"), info);
277 }
278 else {
279 if (this->connection_type == "lan") {
280 msg = _u8L("Sending G-code file over LAN");
281 }
282 else {
283 msg = _u8L("Sending G-code file over LAN");
284 }
285 }
286
287 // update current percnet
288 if (stage >= 0 && stage <= (int) PrintingStageFinished) {
289 curr_percent = StagePercentPoint[stage];
291 (code > 0 && code <= 100)) {
292 curr_percent = (StagePercentPoint[stage + 1] - StagePercentPoint[stage]) * code / 100 + StagePercentPoint[stage];
293 }
294 }
295
296 //get errors
297 if (code > 100 || code < 0 || stage == SendingPrintJobStage::PrintingStageERROR) {
299 m_plater->update_print_error_info(code, desc_file_too_large, info);
300 }
302 m_plater->update_print_error_info(code, desc_fail_not_exist, info);
303 }
305 m_plater->update_print_error_info(code, desc_upload_ftp_failed, info);
306 }
307 else {
308 m_plater->update_print_error_info(code, desc_network_error, info);
309 }
310 }
311 else {
312 ctl.update_status(curr_percent, msg);
313 }
314 };
315
316 auto cancel_fn = [&ctl]() {
317 return ctl.was_canceled();
318 };
319
320
321 if (params.connection_type != "lan") {
322 if (params.dev_ip.empty())
323 params.comments = "no_ip";
324 else if (this->cloud_print_only)
325 params.comments = "low_version";
326 else if (!this->has_sdcard)
327 params.comments = "no_sdcard";
328 else if (params.password.empty())
329 params.comments = "no_password";
330
331 if (!params.password.empty()
332 && !params.dev_ip.empty()
333 && this->has_sdcard) {
334 // try to send local with record
335 BOOST_LOG_TRIVIAL(info) << "send_job: try to send gcode to printer";
336 ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
337 result = agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
339 params.comments = "upload_failed";
340 } else {
341 params.comments = (boost::format("failed(%1%)") % result).str();
342 }
343 if (result < 0) {
344 // try to send with cloud
345 BOOST_LOG_TRIVIAL(info) << "send_job: try to send gcode file to printer";
346 ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
347 }
348 } else {
349 BOOST_LOG_TRIVIAL(info) << "send_job: try to send gcode file to printer";
350 ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
351 }
352 } else {
353 switch(this->sdcard_state) {
355 ctl.update_status(curr_percent, _u8L("Storage needs to be inserted before sending to printer."));
356 return;
358 if(this->has_sdcard) {
359 // means the sdcard is abnormal but can be used option is enabled
360 ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this."));
361 result = agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
362 break;
363 }
364 ctl.update_status(curr_percent, _u8L("The Storage in the printer is abnormal. Please replace it with a normal Storage before sending to printer."));
365 return;
367 ctl.update_status(curr_percent, _u8L("The Storage in the printer is read-only. Please replace it with a normal Storage before sending to printer."));
368 return;
370 ctl.update_status(curr_percent, _u8L("Sending G-code file over LAN"));
371 result = agent->start_send_gcode_to_sdcard(params, update_fn, cancel_fn, nullptr);
372 break;
373 default:
374 ctl.update_status(curr_percent, _u8L("Encountered an unknown error with the Storage status. Please try again."));
375 return;
376 }
377 }
378
379 if (ctl.was_canceled()) {
380 ctl.update_status(curr_percent, printjob_cancel_str);
381 return;
382 }
383
384 if (result < 0) {
385 curr_percent = -1;
386
388 msg_text = file_is_not_exists_str;
389 }
391 msg_text = file_over_size_str;
392 }
395 }
397 msg_text = timeout_to_upload_str;
398 }
400 msg_text = upload_ftp_failed_str;
401 }
402 else if (result == BAMBU_NETWORK_ERR_CANCELED) {
403 msg_text = print_canceled_str;
404 }
405 else {
406 msg_text = send_print_failed_str;
407 }
408
409 if (result != BAMBU_NETWORK_ERR_CANCELED) {
410 ctl.show_error_info(msg_text, 0, "", "");
411 }
412 BOOST_LOG_TRIVIAL(error) << "send_job: failed, result = " << result;
413
414 }
415 else {
416 BOOST_LOG_TRIVIAL(error) << "send_job: send ok.";
417 wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
418 evt->SetString(from_u8(params.project_name));
419 wxQueueEvent(m_plater, evt);
420 m_job_finished = true;
421 }
422}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
#define PLATE_CURRENT_IDX
Definition PartPlate.hpp:56
#define BAMBU_NETWORK_ERR_PRINT_LP_UPLOAD_FTP_FAILED
Definition bambu_networking.hpp:89
#define BAMBU_NETWORK_ERR_PRINT_SP_GET_NOTIFICATION_TIMEOUT
Definition bambu_networking.hpp:76
#define BAMBU_NETWORK_ERR_FTP_UPLOAD_FAILED
Definition bambu_networking.hpp:36
#define BAMBU_NETWORK_ERR_CANCELED
Definition bambu_networking.hpp:34
#define BAMBU_NETWORK_ERR_PRINT_SP_FILE_OVER_SIZE
Definition bambu_networking.hpp:80
#define BAMBU_NETWORK_ERR_PRINT_SP_CHECK_MD5_FAILED
Definition bambu_networking.hpp:73
#define BAMBU_NETWORK_ERR_PRINT_SG_UPLOAD_FTP_FAILED
Definition bambu_networking.hpp:93
#define BAMBU_NETWORK_ERR_PRINT_WR_FILE_NOT_EXIST
Definition bambu_networking.hpp:65
#define BAMBU_NETWORK_ERR_PRINT_WR_GET_NOTIFICATION_TIMEOUT
Definition bambu_networking.hpp:61
#define BAMBU_NETWORK_ERR_PRINT_SP_FILE_NOT_EXIST
Definition bambu_networking.hpp:78
#define BAMBU_NETWORK_ERR_PRINT_WR_FILE_OVER_SIZE
Definition bambu_networking.hpp:59
#define BAMBU_NETWORK_ERR_PRINT_WR_CHECK_MD5_FAILED
Definition bambu_networking.hpp:57
@ HAS_SDCARD_NORMAL
Definition DevStorage.h:19
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
@ HAS_SDCARD_READONLY
Definition DevStorage.h:21
@ NO_SDCARD
Definition DevStorage.h:18
bool m_local_use_ssl
Definition SendJob.hpp:49
bool task_use_ams
Definition SendJob.hpp:52
std::string m_dev_ip
Definition SendJob.hpp:42
bool has_sdcard
Definition SendJob.hpp:51
void prepare()
Definition SendJob.cpp:56
DevStorage::SdcardState sdcard_state
Definition SendJob.hpp:54
bool m_is_check_mode
Definition SendJob.hpp:30
std::string task_ams_mapping
Definition SendJob.hpp:45
bool cloud_print_only
Definition SendJob.hpp:50
std::string m_access_code
Definition SendJob.hpp:43
std::string connection_type
Definition SendJob.hpp:46
bool m_local_use_ssl_for_ftp
Definition SendJob.hpp:48
static auto upload_ftp_failed_str
Definition PrintJob.cpp:55
static auto desc_file_too_large
Definition PrintJob.cpp:58
static Plater * plater()
Definition GUI_Factories.cpp:400
static auto desc_fail_not_exist
Definition PrintJob.cpp:59
static auto printjob_cancel_str
Definition PrintJob.cpp:48
std::string format(const char *fmt, TArgs &&... args)
Definition format.hpp:36
static auto file_over_size_str
Definition PrintJob.cpp:52
static auto desc_network_error
Definition PrintJob.cpp:57
static auto print_canceled_str
Definition PrintJob.cpp:53
static auto failed_in_cloud_service_str
Definition PrintJob.cpp:50
static auto timeout_to_upload_str
Definition PrintJob.cpp:49
static auto file_is_not_exists_str
Definition PrintJob.cpp:51
static auto desc_upload_ftp_failed
Definition PrintJob.cpp:61
static auto check_gcode_failed_str
Definition PrintJob.cpp:47
static auto send_print_failed_str
Definition PrintJob.cpp:54
@ PrintingStageCreate
Definition bambu_networking.hpp:148
@ PrintingStageFinished
Definition bambu_networking.hpp:154
@ PrintingStageUpload
Definition bambu_networking.hpp:149
@ PrintingStageERROR
Definition bambu_networking.hpp:155
@ SendJobStarted
Definition LifecycleEvents.hpp:62
#define _u8L(s)
Definition I18N.hpp:11

References _u8L, Slic3r::PrintParams::ams_mapping, BAMBU_NETWORK_ERR_CANCELED, BAMBU_NETWORK_ERR_FTP_UPLOAD_FAILED, BAMBU_NETWORK_ERR_PRINT_LP_UPLOAD_FTP_FAILED, BAMBU_NETWORK_ERR_PRINT_SG_UPLOAD_FTP_FAILED, BAMBU_NETWORK_ERR_PRINT_SP_CHECK_MD5_FAILED, BAMBU_NETWORK_ERR_PRINT_SP_FILE_NOT_EXIST, BAMBU_NETWORK_ERR_PRINT_SP_FILE_OVER_SIZE, BAMBU_NETWORK_ERR_PRINT_SP_GET_NOTIFICATION_TIMEOUT, BAMBU_NETWORK_ERR_PRINT_WR_CHECK_MD5_FAILED, BAMBU_NETWORK_ERR_PRINT_WR_FILE_NOT_EXIST, BAMBU_NETWORK_ERR_PRINT_WR_FILE_OVER_SIZE, BAMBU_NETWORK_ERR_PRINT_WR_GET_NOTIFICATION_TIMEOUT, Slic3r::GUI::Job::Ctl::call_on_main_thread(), Slic3r::GUI::check_gcode_failed_str, cloud_print_only, Slic3r::PrintParams::comments, Slic3r::PrintParams::config_filename, connection_type, Slic3r::PrintParams::connection_type, Slic3r::NetworkAgent::default_lan_username(), Slic3r::GUI::desc_fail_not_exist, Slic3r::GUI::desc_file_too_large, Slic3r::GUI::desc_network_error, Slic3r::GUI::desc_upload_ftp_failed, Slic3r::PrintParams::dev_id, Slic3r::PrintParams::dev_ip, Slic3r::LifecycleEventContext::device_id, Slic3r::GUI::failed_in_cloud_service_str, Slic3r::GUI::file_is_not_exists_str, Slic3r::GUI::file_over_size_str, Slic3r::PrintParams::filename, Slic3r::fire_lifecycle_event(), Slic3r::GUI::format(), Slic3r::GUI::from_u8(), has_sdcard, Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_NORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, Slic3r::GUI::PartPlate::is_valid_gcode_file(), job_data, m_access_code, m_check_and_continue, m_dev_id, m_dev_ip, m_enter_ip_address_fun_fail, m_enter_ip_address_fun_success, m_is_check_mode, m_job_finished, m_lifecycle_started, m_local_use_ssl, m_local_use_ssl_for_ftp, m_plater, m_print_job_completed_id, m_project_name, Slic3r::LifecycleEventContext::name, Slic3r::DevStorage::NO_SDCARD, Slic3r::PrintParams::password, PLATE_ALL_IDX, PLATE_CURRENT_IDX, Slic3r::PrintParams::plate_index, Slic3r::GUI::plater(), prepare(), Slic3r::PrintParams::preset_name, Slic3r::GUI::print_canceled_str, Slic3r::PrintingStageCreate, Slic3r::PrintingStageERROR, Slic3r::PrintingStageFinished, Slic3r::PrintingStageUpload, Slic3r::GUI::printjob_cancel_str, Slic3r::PrintParams::project_name, sdcard_state, Slic3r::GUI::send_print_failed_str, Slic3r::SendJobStarted, Slic3r::GUI::Job::Ctl::show_error_info(), Slic3r::LifecycleEventContext::source, Slic3r::NetworkAgent::start_send_gcode_to_sdcard(), task_ams_mapping, task_use_ams, Slic3r::PrintParams::task_use_ams, Slic3r::GUI::timeout_to_upload_str, Slic3r::GUI::Job::Ctl::update_status(), Slic3r::GUI::upload_ftp_failed_str, Slic3r::PrintParams::use_ssl_for_ftp, Slic3r::PrintParams::use_ssl_for_mqtt, Slic3r::PrintParams::username, and Slic3r::GUI::Job::Ctl::was_canceled().

Here is the call graph for this function:

◆ set_check_mode()

void Slic3r::GUI::SendJob::set_check_mode ( )
inline
64{m_is_check_mode = true;};

References m_is_check_mode.

◆ set_project_name()

void Slic3r::GUI::SendJob::set_project_name ( std::string name)
468{
469 m_project_name = name;
470}

References m_project_name.

◆ status_range()

int Slic3r::GUI::SendJob::status_range ( ) const
inline
59 {
60 return 100;
61 }

Member Data Documentation

◆ cloud_print_only

bool Slic3r::GUI::SendJob::cloud_print_only { false }
50{ false };

Referenced by process().

◆ connection_type

std::string Slic3r::GUI::SendJob::connection_type

Referenced by process().

◆ has_sdcard

bool Slic3r::GUI::SendJob::has_sdcard { false }
51{ false };

Referenced by process().

◆ job_data

PrintPrepareData Slic3r::GUI::SendJob::job_data
private

Referenced by prepare(), and process().

◆ m_access_code

std::string Slic3r::GUI::SendJob::m_access_code

Referenced by process().

◆ m_check_and_continue

bool Slic3r::GUI::SendJob::m_check_and_continue {false}
private
31{false};

Referenced by check_and_continue(), and process().

◆ m_dev_id

std::string Slic3r::GUI::SendJob::m_dev_id
private

Referenced by SendJob(), finalize(), and process().

◆ m_dev_ip

std::string Slic3r::GUI::SendJob::m_dev_ip

Referenced by process().

◆ m_enter_ip_address_fun_fail

std::function<void(int)> Slic3r::GUI::SendJob::m_enter_ip_address_fun_fail {nullptr}
private
33{nullptr};

Referenced by on_check_ip_address_fail(), and process().

◆ m_enter_ip_address_fun_success

std::function<void()> Slic3r::GUI::SendJob::m_enter_ip_address_fun_success {nullptr}
private
34{nullptr};

Referenced by on_check_ip_address_success(), and process().

◆ m_is_check_mode

bool Slic3r::GUI::SendJob::m_is_check_mode {false}
private
30{false};

Referenced by process(), and set_check_mode().

◆ m_job_finished

bool Slic3r::GUI::SendJob::m_job_finished { false }
private
26{ false };

Referenced by finalize(), is_finished(), and process().

◆ m_lifecycle_finished

bool Slic3r::GUI::SendJob::m_lifecycle_finished { false }
private
28{ false };

Referenced by finalize().

◆ m_lifecycle_started

bool Slic3r::GUI::SendJob::m_lifecycle_started { false }
private
27{ false };

Referenced by finalize(), and process().

◆ m_local_use_ssl

bool Slic3r::GUI::SendJob::m_local_use_ssl {true}
49{true};

Referenced by process().

◆ m_local_use_ssl_for_ftp

bool Slic3r::GUI::SendJob::m_local_use_ssl_for_ftp {true}
48{true};

Referenced by process().

◆ m_parent

wxWindow* Slic3r::GUI::SendJob::m_parent {nullptr}
56{nullptr};

◆ m_plater

Plater* Slic3r::GUI::SendJob::m_plater
private

Referenced by SendJob(), prepare(), and process().

◆ m_print_job_completed_id

int Slic3r::GUI::SendJob::m_print_job_completed_id = 0
private

Referenced by SendJob(), and process().

◆ m_project_name

std::string Slic3r::GUI::SendJob::m_project_name

Referenced by finalize(), process(), and set_project_name().

◆ m_success_fun

std::function<void()> Slic3r::GUI::SendJob::m_success_fun {nullptr}
private
32{nullptr};

Referenced by on_success().

◆ sdcard_state

DevStorage::SdcardState Slic3r::GUI::SendJob::sdcard_state = DevStorage::SdcardState::NO_SDCARD

Referenced by process().

◆ task_ams_mapping

std::string Slic3r::GUI::SendJob::task_ams_mapping

Referenced by process().

◆ task_bed_type

std::string Slic3r::GUI::SendJob::task_bed_type

◆ task_use_ams

bool Slic3r::GUI::SendJob::task_use_ams { true }
52{ true };

Referenced by process().


The documentation for this class was generated from the following files:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/SendJob.hpp
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/Jobs/SendJob.cpp