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

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

Inheritance diagram for Slic3r::GUI::PrintJob:
Collaboration diagram for Slic3r::GUI::PrintJob:

Public Types

enum  JobPrepareState { PREPARE_STATE_DEFAULT = 0 , PREPARE_STATE_MENU = 1 }

Public Member Functions

void prepare ()
 PrintJob (std::string dev_id="")
void set_print_config (std::string bed_type, bool bed_leveling, bool flow_cali, bool vabration_cali, bool record_timelapse, bool layer_inspect, bool ext_change_assist, int auto_bed_levelingt, int auto_flow_calit, int auto_offset_calit, int extruder_cali_manual_modet=-1)
int status_range () const
bool is_finished ()
void set_print_job_finished_event (int event_id, wxString evt_data=wxEmptyString)
void on_success (std::function< void()> success)
void process (Ctl &ctl) override
void finalize (bool canceled, std::exception_ptr &e) override
void set_project_name (std::string name)
void set_dst_name (std::string path)
void on_check_ip_address_fail (std::function< void()> func)
void on_check_ip_address_success (std::function< void()> func)
wxString get_http_error_msg (unsigned int status, std::string body)
std::string truncate_string (const std::string &str, size_t maxLength)
void set_calibration_task (bool is_calibration)

Public Attributes

PrintPrepareData job_data
PlateListData plate_data
std::string m_project_name
std::string m_dev_ip
std::string m_ftp_folder
std::string m_access_code
std::string task_bed_type
std::string task_nozzle_mapping
std::string task_ams_mapping
std::string task_ams_mapping2
std::string task_ams_mapping_info
std::string task_nozzles_info
std::string connection_type
std::string m_print_type
std::string m_dst_path
bool m_is_calibration_task = false
int m_print_from_sdc_plate_idx = 0
bool m_local_use_ssl { true }
bool m_local_use_ssl_for_ftp { true }
bool task_bed_leveling
bool task_flow_cali
bool task_vibration_cali
bool task_record_timelapse
bool task_timelapse_use_internal { false }
bool task_layer_inspect
bool cloud_print_only { false }
bool has_sdcard { false }
bool could_emmc_print { false }
bool task_use_ams { true }
DevStorage::SdcardState sdcard_state = DevStorage::SdcardState::NO_SDCARD
bool task_ext_change_assist { false }
int auto_bed_leveling {0}
int auto_flow_cali {0}
int auto_offset_cali {0}
int extruder_cali_manual_mode {-1}

Private Attributes

std::function< void()> m_success_fun {nullptr}
std::string m_dev_id
bool m_job_finished { false }
bool m_lifecycle_started { false }
bool m_lifecycle_finished { false }
bool m_lifecycle_success { false }
int m_print_job_completed_id = 0
wxString m_completed_evt_data
std::function< void()> 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

◆ PrintJob()

Slic3r::GUI::PrintJob::PrintJob ( std::string dev_id = "")
71: m_plater{wxGetApp().plater()},
72 m_dev_id(dev_id),
74{
75 m_print_job_completed_id = m_plater->get_print_finished_event();
76}
bool m_is_calibration_task
Definition PrintJob.hpp:79
Plater * m_plater
Definition PrintJob.hpp:56
std::string m_dev_id
Definition PrintJob.hpp:47
int m_print_job_completed_id
Definition PrintJob.hpp:52

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

Here is the call graph for this function:

Member Function Documentation

◆ finalize()

void Slic3r::GUI::PrintJob::finalize ( bool canceled,
std::exception_ptr & e )
overridevirtual

Reimplemented from Slic3r::GUI::Job.

737 {
738 try {
739 if (eptr)
740 std::rethrow_exception(eptr);
741 eptr = nullptr;
742 } catch (...) {
743 eptr = std::current_exception();
744 }
745
747 LifecycleEventContext finish_ctx;
748 finish_ctx.name = m_project_name;
749 finish_ctx.device_id = m_dev_id;
750 finish_ctx.source = "print_job";
751 finish_ctx.code = canceled ? LifecycleEvtCode::Warn :
753 finish_ctx.msg = canceled ? "cancelled" : (eptr ? "exception" :
754 (m_lifecycle_success ? "" : "failed"));
757 }
758
759 if (canceled || eptr)
760 return;
761}
bool m_lifecycle_started
Definition PrintJob.hpp:49
std::string m_project_name
Definition PrintJob.hpp:65
bool m_lifecycle_success
Definition PrintJob.hpp:51
bool m_lifecycle_finished
Definition PrintJob.hpp:50
@ PrintJobFinished
Definition LifecycleEvents.hpp:61
@ 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_lifecycle_finished, m_lifecycle_started, m_lifecycle_success, m_project_name, Slic3r::LifecycleEventContext::msg, Slic3r::LifecycleEventContext::name, Slic3r::Ok, Slic3r::PrintJobFinished, Slic3r::LifecycleEventContext::source, and Slic3r::Warn.

Here is the call graph for this function:

◆ get_http_error_msg()

wxString Slic3r::GUI::PrintJob::get_http_error_msg ( unsigned int status,
std::string body )
115{
116 try {
117 int code = 0;
118 std::string error;
119 std::string message;
120 wxString result;
121 if (status >= 400 && status < 500)
122 try {
123 json j = json::parse(body);
124 if (j.contains("code")) {
125 if (!j["code"].is_null())
126 code = j["code"].get<int>();
127 }
128 if (j.contains("error")) {
129 if (!j["error"].is_null())
130 error = j["error"].get<std::string>();
131 }
132 if (j.contains("message")) {
133 if (!j["message"].is_null())
134 message = j["message"].get<std::string>();
135 }
136 }
137 catch (...) {
138 ;
139 }
140 else if (status == 503) {
141 return _L("Service Unavailable");
142 }
143 else {
144 wxString unkown_text = _L("Unknown Error.");
145 unkown_text += wxString::Format("status=%u, body=%s", status, body);
146 BOOST_LOG_TRIVIAL(error) << "http_error: status=" << status << ", code=" << code << ", error=" << error;
147 return unkown_text;
148 }
149
150 BOOST_LOG_TRIVIAL(error) << "http_error: status=" << status << ", code=" << code << ", error=" << error;
151
152 result = wxString::Format("code=%u, error=%s", code, from_u8(error));
153 return result;
154 } catch(...) {
155 ;
156 }
157 return wxEmptyString;
158}
#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::PrintJob::is_finished ( )
inline
130{ return m_job_finished; }
bool m_job_finished
Definition PrintJob.hpp:48

References m_job_finished.

◆ on_check_ip_address_fail()

void Slic3r::GUI::PrintJob::on_check_ip_address_fail ( std::function< void()> func)
775{
777}
std::function< void()> m_enter_ip_address_fun_fail
Definition PrintJob.hpp:54

References m_enter_ip_address_fun_fail.

◆ on_check_ip_address_success()

void Slic3r::GUI::PrintJob::on_check_ip_address_success ( std::function< void()> func)
780{
782}
std::function< void()> m_enter_ip_address_fun_success
Definition PrintJob.hpp:55

References m_enter_ip_address_fun_success.

◆ on_success()

void Slic3r::GUI::PrintJob::on_success ( std::function< void()> success)
89{
90 m_success_fun = success;
91}
std::function< void()> m_success_fun
Definition PrintJob.hpp:46

References m_success_fun.

◆ prepare()

void Slic3r::GUI::PrintJob::prepare ( )
79{
80 if (job_data.is_from_plater)
81 m_plater->get_print_job_data(&job_data);
82 std::string temp_file = Slic3r::resources_dir() + "/check_access_code.txt";
83 auto check_access_code_path = temp_file.c_str();
84 BOOST_LOG_TRIVIAL(trace) << "sned_job: check_access_code_path = " << check_access_code_path;
85 job_data._temp_path = fs::path(check_access_code_path);
86}
PrintPrepareData job_data
Definition PrintJob.hpp:59
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::PrintJob::process ( Ctl & ctl)
overridevirtual

Implements Slic3r::GUI::Job.

161{
162 /* display info */
163 std::string msg;
164 int curr_percent = 10;
165 NetworkAgent* m_agent = wxGetApp().getAgent();
166 AppConfig* config = wxGetApp().app_config;
167
168 if (this->connection_type == "lan") {
169 msg = _u8L("Sending print job over LAN");
170 }
171 else {
172 msg = _u8L("Sending print job through cloud service");
173 }
174
175 ctl.update_status(0, msg);
176 ctl.call_on_main_thread([this] { prepare(); }).wait();
177
178 int result = -1;
179 std::string http_body;
180
181 const auto mark_lifecycle_started = [this]() {
183 return;
184
185 LifecycleEventContext start_ctx;
186 start_ctx.name = m_project_name;
187 start_ctx.device_id = m_dev_id;
188 start_ctx.source = "print_job";
190 m_lifecycle_started = true;
191 };
192
193 int total_plate_num = plate_data.plate_count;
194 if (!plate_data.is_valid) {
195 total_plate_num = m_plater->get_partplate_list().get_plate_count();
196 PartPlate *plate = m_plater->get_partplate_list().get_plate(job_data.plate_idx);
197 if (plate == nullptr) {
198 plate = m_plater->get_partplate_list().get_curr_plate();
199 if (plate == nullptr) return;
200 }
201
202 /* check gcode is valid */
203 if (!plate->is_valid_gcode_file() && m_print_type == "from_normal") {
204 ctl.update_status(curr_percent, check_gcode_failed_str);
205 return;
206 }
207
208 if (ctl.was_canceled()) {
209 ctl.update_status(curr_percent, printjob_cancel_str);
210 return;
211 }
212 }
213
214 const std::string transport_project_name = truncate_string(m_project_name, 100);
215 int curr_plate_idx = 0;
216
217 if (m_print_type == "from_normal") {
218 if (plate_data.is_valid)
219 curr_plate_idx = plate_data.cur_plate_index;
220 if (job_data.plate_idx >= 0)
221 curr_plate_idx = job_data.plate_idx + 1;
222 else if (job_data.plate_idx == PLATE_CURRENT_IDX)
223 curr_plate_idx = m_plater->get_partplate_list().get_curr_plate_index() + 1;
224 else if (job_data.plate_idx == PLATE_ALL_IDX)
225 curr_plate_idx = m_plater->get_partplate_list().get_curr_plate_index() + 1;
226 else
227 curr_plate_idx = m_plater->get_partplate_list().get_curr_plate_index() + 1;
228 }
229 else if(m_print_type == "from_sdcard_view") {
230 curr_plate_idx = m_print_from_sdc_plate_idx;
231 }
232
233 PartPlate* curr_plate = m_plater->get_partplate_list().get_curr_plate();
234 if (curr_plate) {
235 this->task_bed_type = bed_type_to_gcode_string(plate_data.is_valid ? plate_data.bed_type : curr_plate->get_bed_type(true));
236 }
237
238 PrintParams params;
239
240 // local print access
241 params.dev_ip = m_dev_ip;
242 params.use_ssl_for_ftp = m_local_use_ssl_for_ftp;
243 params.use_ssl_for_mqtt = m_local_use_ssl;
244 params.username = m_agent->default_lan_username();
245 params.password = m_access_code;
246
247 // check access code and ip address
248 if (this->connection_type == "lan" && m_print_type == "from_normal") {
249 bool emmc_ok = false;
250 bool ftp_ok = false;
251 if (could_emmc_print) {
252 std::string devIP = m_dev_ip;
253 std::string accessCode = m_access_code;
254 std::string url = "bambu:///local/" + devIP + "?port=6000&user=" + "bblp" + "&passwd=" + accessCode;
255 try {
256 std::unique_ptr<FileTransferTunnel> tunnel = std::make_unique<FileTransferTunnel>(module(), url);
257 emmc_ok = tunnel->sync_start_connect();
258 } catch (const std::exception &e) {
259 BOOST_LOG_TRIVIAL(warning) << "eMMC tunnel unavailable, falling back to FTP: " << e.what();
260 emmc_ok = false;
261 }
262 }
263 {
264 params.dev_id = m_dev_id;
265 params.project_name = "verify_job";
266 params.filename = job_data._temp_path.string();
267 params.connection_type = this->connection_type;
268
269 result = m_agent->start_send_gcode_to_sdcard(params, nullptr, nullptr, nullptr);
270
271 ftp_ok = result == 0;
272 }
273 if (!emmc_ok && !ftp_ok) {
274 bool legacy_mode = BBLNetworkPlugin::instance().use_legacy_network();
275 BOOST_LOG_TRIVIAL(error) << "LAN connection verification failed:"
276 << " emmc_ok=" << emmc_ok
277 << ", ftp_ok=" << ftp_ok
278 << ", ftp_result=" << result
279 << ", dev_ip=" << m_dev_ip
280 << ", dev_id=" << m_dev_id
281 << ", password_length=" << m_access_code.size()
282 << ", legacy_mode=" << (legacy_mode ? "true" : "false");
284 m_job_finished = true;
285 return;
286 }
287
288 params.project_name = "";
289 params.filename = "";
290 }
291
292 params.dev_id = m_dev_id;
293 params.ftp_folder = m_ftp_folder;
294 params.filename = job_data._3mf_path.string();
295 params.config_filename = job_data._3mf_config_path.string();
296 params.plate_index = curr_plate_idx;
297 params.task_bed_leveling = this->task_bed_leveling;
298 params.task_flow_cali = this->task_flow_cali;
299 params.task_vibration_cali = this->task_vibration_cali;
300 params.task_layer_inspect = this->task_layer_inspect;
301 params.task_record_timelapse= this->task_record_timelapse;
302 params.task_timelapse_use_internal = this->task_timelapse_use_internal;
303 params.nozzle_mapping = this->task_nozzle_mapping;
304 params.ams_mapping = this->task_ams_mapping;
305 params.ams_mapping2 = this->task_ams_mapping2;
306 params.ams_mapping_info = this->task_ams_mapping_info;
307 params.nozzles_info = this->task_nozzles_info;
308 params.connection_type = this->connection_type;
309 params.task_use_ams = this->task_use_ams;
310 params.task_bed_type = this->task_bed_type;
311 params.print_type = this->m_print_type;
312 params.auto_bed_leveling = this->auto_bed_leveling;
313 params.auto_flow_cali = this->auto_flow_cali;
314 params.auto_offset_cali = this->auto_offset_cali;
315 params.extruder_cali_manual_mode = this->extruder_cali_manual_mode;
316 params.task_ext_change_assist = this->task_ext_change_assist;
317 // Allow disabling the eMMC print path via AppConfig. Plugin 02.03.00.62's
318 // eMMC tunnel code hangs indefinitely at the upload phase with some
319 // printers (e.g., Bambu H2D), so we default to disabled. Users with
320 // working eMMC support can opt-in by setting disable_emmc_print = 0.
321 bool disable_emmc = true;
322 if (wxGetApp().app_config) {
323 auto v = wxGetApp().app_config->get("disable_emmc_print");
324 if (v == "0" || v == "false")
325 disable_emmc = false;
326 }
327 params.try_emmc_print = this->could_emmc_print && !disable_emmc;
328
329 if (m_print_type == "from_sdcard_view") {
330 params.dst_file = m_dst_path;
331 }
332
333 if (wxGetApp().model().model_info && wxGetApp().model().model_info.get()) {
334 ModelInfo* model_info = wxGetApp().model().model_info.get();
335 auto origin_profile_id = model_info->metadata_items.find(BBL_DESIGNER_PROFILE_ID_TAG);
336 if (origin_profile_id != model_info->metadata_items.end()) {
337 try {
338 params.origin_profile_id = std::stoi(origin_profile_id->second.c_str());
339 }
340 catch(...) {}
341 }
342 auto origin_model_id = model_info->metadata_items.find(BBL_DESIGNER_MODEL_ID_TAG);
343 if (origin_model_id != model_info->metadata_items.end()) {
344 try {
345 params.origin_model_id = origin_model_id->second;
346 }
347 catch(...) {}
348 }
349
350 auto profile_name = model_info->metadata_items.find(BBL_DESIGNER_PROFILE_TITLE_TAG);
351 if (profile_name != model_info->metadata_items.end()) {
352 try {
353 params.preset_name = profile_name->second;
354 }
355 catch (...) {}
356 }
357
358 if (m_print_type != "from_sdcard_view") {
359 auto model_name = model_info->metadata_items.find(BBL_DESIGNER_MODEL_TITLE_TAG);
360 if (model_name != model_info->metadata_items.end()) {
361 try {
362 std::string mall_model_name = model_name->second;
363 std::replace(mall_model_name.begin(), mall_model_name.end(), ' ', '_');
364 const char *unusable_symbols = "<>[]:/\\|?*\" ";
365 for (const char *symbol = unusable_symbols; *symbol != '\0'; ++symbol) { std::replace(mall_model_name.begin(), mall_model_name.end(), *symbol, '_'); }
366
367 std::regex pattern("_+");
368 params.project_name = std::regex_replace(mall_model_name, pattern, "_");
369 params.project_name = truncate_string(params.project_name, 100);
370 } catch (...) {}
371 }
372 }
373 }
374
375 params.stl_design_id = 0;
376 if (!wxGetApp().model().stl_design_id.empty()) {
377
378 auto country_code = wxGetApp().app_config->get_country_code();
379 bool match_code = false;
380
381 if (wxGetApp().model().stl_design_country == "DEV" && (country_code == "ENV_CN_DEV" || country_code == "NEW_ENV_DEV_HOST")) {
382 match_code = true;
383 }
384
385 if (wxGetApp().model().stl_design_country == "QA" && (country_code == "ENV_CN_QA" || country_code == "NEW_ENV_QAT_HOST")) {
386 match_code = true;
387 }
388
389 if (wxGetApp().model().stl_design_country == "CN_PRE" && (country_code == "ENV_CN_PRE" || country_code == "NEW_ENV_PRE_HOST")) {
390 match_code = true;
391 }
392
393 if (wxGetApp().model().stl_design_country == "US_PRE" && country_code == "ENV_US_PRE") {
394 match_code = true;
395 }
396
397 if (country_code == wxGetApp().model().stl_design_country) {
398 match_code = true;
399 }
400
401 if (match_code) {
402 int stl_design_id = 0;
403 try {
404 stl_design_id = std::stoi(wxGetApp().model().stl_design_id);
405 }
406 catch (const std::exception&) {
407 stl_design_id = 0;
408 }
409 params.stl_design_id = stl_design_id;
410 }
411 }
412
413 if (params.preset_name.empty() && m_print_type == "from_normal") { params.preset_name = wxString::Format("%s_plate_%d", transport_project_name, curr_plate_idx).ToStdString(); }
414 if (params.project_name.empty()) {params.project_name = transport_project_name;}
415
417 params.project_name = transport_project_name;
418 params.origin_model_id = "";
419 }
420
421 wxString error_text;
422 std::string msg_text;
423
424
425 const int StagePercentPoint[(int)PrintingStageFinished + 1] = {
426 20, // PrintingStageCreate
427 30, // PrintingStageUpload
428 70, // PrintingStageWaiting
429 75, // PrintingStageRecord
430 97, // PrintingStageSending
431 100, // PrintingStageFinished
432 100 // PrintingStageFinished
433 };
434
435 bool is_try_lan_mode = false;
436 bool is_try_lan_mode_failed = false;
437
438 auto update_fn = [this, &ctl,
439 &is_try_lan_mode,
440 &is_try_lan_mode_failed,
441 &msg,
442 &curr_percent,
443 StagePercentPoint
444 ](int stage, int code, std::string info) {
445
446 if (stage == SendingPrintJobStage::PrintingStageCreate && !is_try_lan_mode_failed) {
447 if (this->connection_type == "lan") {
448 msg = _u8L("Sending print job over LAN");
449 } else {
450 msg = _u8L("Sending print job through cloud service");
451 }
452 }
453 else if (stage == SendingPrintJobStage::PrintingStageUpload && !is_try_lan_mode_failed) {
454 if (code >= 0 && code <= 100 && !info.empty()) {
455 if (this->connection_type == "lan") {
456 msg = _u8L("Sending print job over LAN");
457 } else {
458 msg = _u8L("Sending print job through cloud service");
459 }
460 msg += format("(%s)", info);
461 }
462 }
464 if (this->connection_type == "lan") {
465 msg = _u8L("Sending print job over LAN");
466 } else {
467 msg = _u8L("Sending print job through cloud service");
468 }
469 }
470 else if (stage == SendingPrintJobStage::PrintingStageRecord && !is_try_lan_mode) {
471 msg = _u8L("Sending print configuration");
472 }
473 else if (stage == SendingPrintJobStage::PrintingStageSending && !is_try_lan_mode) {
474 if (this->connection_type == "lan") {
475 msg = _u8L("Sending print job over LAN");
476 } else {
477 msg = _u8L("Sending print job through cloud service");
478 }
479 }
481 msg = format(_u8L("Successfully sent. Will automatically jump to the device page in %ss"), info);
482 if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
483 msg = format(_u8L("Successfully sent. Will automatically jump to the next page in %ss"), info);
484 }
485 ctl.clear_percent();
486 } else {
487 if (this->connection_type == "lan") {
488 msg = _u8L("Sending print job over LAN");
489 } else {
490 msg = _u8L("Sending print job through cloud service");
491 }
492 }
493
494 // update current percnet
495 if (stage >= 0 && stage <= (int) PrintingStageFinished) {
496 curr_percent = StagePercentPoint[stage];
499 && (code > 0 && code <= 100)) {
500 curr_percent = (StagePercentPoint[stage + 1] - StagePercentPoint[stage]) * code / 100 + StagePercentPoint[stage];
501 }
502 }
503
504 //get errors
505 if (code > 100 || code < 0 || stage == SendingPrintJobStage::PrintingStageERROR) {
507 m_plater->update_print_error_info(code, desc_file_too_large, info);
509 m_plater->update_print_error_info(code, desc_fail_not_exist, info);
511 m_plater->update_print_error_info(code, desc_upload_ftp_failed, info);
512 }else {
513 m_plater->update_print_error_info(code, desc_network_error, info);
514 }
515 }
516 else {
517 ctl.update_status(curr_percent, msg);
518 }
519 };
520
521 auto cancel_fn = [&ctl]() {
522 return ctl.was_canceled();
523 };
524
525
526 DeviceManager* dev = wxGetApp().getDeviceManager();
527 MachineObject* obj = dev->get_selected_machine();
528
529 auto wait_fn = [&ctl, &obj](int state, std::string job_info) {
530 BOOST_LOG_TRIVIAL(info) << "print_job: get_job_info = " << job_info;
531
532 if (!obj->is_support_wait_sending_finish) {
533 return true;
534 }
535
536 std::string curr_job_id;
537 json job_info_j;
538 try {
539 std::ignore = job_info_j.parse(job_info);
540 if (job_info_j.contains("job_id")) {
541 curr_job_id = DevJsonValParser::get_longlong_val(job_info_j["job_id"]);
542 }
543 BOOST_LOG_TRIVIAL(trace) << "print_job: curr_obj_id=" << curr_job_id;
544
545 } catch(...) {
546 ;
547 }
548
549 if (obj) {
550 int time_out = 0;
552 BOOST_LOG_TRIVIAL(trace) << "print_job: obj job_id = " << obj->job_id_;
553 if (!obj->job_id_.empty() && obj->job_id_.compare(curr_job_id) == 0) {
554 BOOST_LOG_TRIVIAL(info) << "print_job: got job_id = " << obj->job_id_ << ", time_out=" << time_out;
555 return true;
556 }
557 if (obj->is_in_printing_status(obj->print_status)) {
558 BOOST_LOG_TRIVIAL(info) << "print_job: printer has enter printing status, s = " << obj->print_status;
559 return true;
560 }
561 // Break the wait-for-print-start loop on user cancel.
562 if (ctl.was_canceled()) {
563 BOOST_LOG_TRIVIAL(info) << "print_job: user cancel the job " << obj->job_id_;
564 return true;
565 }
566 time_out++;
567 boost::this_thread::sleep_for(boost::chrono::milliseconds(1000));
568 }
569 //this->update_status(curr_percent, _L("Print task sending times out."));
570 //m_plater->update_print_error_info(BAMBU_NETWORK_ERR_TIMEOUT, wait_sending_finish.ToStdString(), desc_wait_sending_finish.ToStdString());
571 BOOST_LOG_TRIVIAL(info) << "print_job: timeout, cancel the job" << obj->job_id_;
572 /* handle tiemout */
573 //obj->command_task_cancel(curr_job_id);
574 //return false;
575 return true;
576 }
577 BOOST_LOG_TRIVIAL(info) << "print_job: obj is null";
578 return true;
579 };
580
581 if (m_print_type == "from_sdcard_view") {
582 BOOST_LOG_TRIVIAL(info) << "print_job: try to send with cloud, model is sdcard view";
583 ctl.update_status(curr_percent, _u8L("Sending print job through cloud service"));
584 mark_lifecycle_started();
585 result = m_agent->start_sdcard_print(params, update_fn, cancel_fn);
586 } else if (params.connection_type != "lan") {
587 if (params.dev_ip.empty())
588 params.comments = "no_ip";
589 else if (this->cloud_print_only)
590 params.comments = "low_version";
591 else if (!this->has_sdcard)
592 params.comments = "no_sdcard";
593 else if (params.password.empty())
594 params.comments = "no_password";
595
596
597 //use ftp only
598 if (!wxGetApp().app_config->get("lan_mode_only").empty() && wxGetApp().app_config->get("lan_mode_only") == "1") {
599
600 if (params.password.empty() || params.dev_ip.empty()) {
601 error_text = wxString::Format(_L("Access code:%s IP address:%s"), params.password, params.dev_ip);
603 }
604 else {
605 BOOST_LOG_TRIVIAL(info) << "print_job: use ftp send print only";
606 ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
607 is_try_lan_mode = true;
608 mark_lifecycle_started();
609 result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
610 if (result < 0) {
611 error_text = wxString::Format(_L("Access code:%s IP address:%s"), params.password, params.dev_ip);
612 // try to send with cloud
613 BOOST_LOG_TRIVIAL(warning) << "print_job: use ftp send print failed";
614 }
615 }
616 }
617 else {
618 if (!this->cloud_print_only
619 && !params.password.empty()
620 && !params.dev_ip.empty()
621 && this->has_sdcard) {
622 // try to send local with record
623 BOOST_LOG_TRIVIAL(info) << "print_job: try to start local print with record";
624 ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
625 mark_lifecycle_started();
626 result = m_agent->start_local_print_with_record(params, update_fn, cancel_fn, wait_fn);
627 if (result == 0) {
628 params.comments = "";
629 }
631 params.comments = "upload_failed";
632 }
633 else {
634 params.comments = (boost::format("failed(%1%)") % result).str();
635 }
636 if (result < 0) {
637 is_try_lan_mode_failed = true;
638 // try to send with cloud
639 BOOST_LOG_TRIVIAL(warning) << "print_job: try to send with cloud";
640 ctl.update_status(curr_percent, _u8L("Sending print job through cloud service"));
641 // Started was already emitted before the local attempt.
642 result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
643 }
644 }
645 else {
646 BOOST_LOG_TRIVIAL(info) << "print_job: send with cloud";
647 ctl.update_status(curr_percent, _u8L("Sending print job through cloud service"));
648 mark_lifecycle_started();
649 result = m_agent->start_print(params, update_fn, cancel_fn, wait_fn);
650 }
651 }
652 } else {
653 if (this->could_emmc_print) {
654 ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
655 mark_lifecycle_started();
656 result = m_agent->start_local_print(params, update_fn, cancel_fn);
657 } else {
658 switch(this->sdcard_state) {
660 ctl.update_status(curr_percent, _u8L("A Storage needs to be inserted before printing via LAN."));
661 return;
663 if(this->has_sdcard) {
664 // means the storage is abnormal but can be used option is enabled
665 ctl.update_status(curr_percent, _u8L("Sending print job over LAN, but the Storage in the printer is abnormal and print-issues may be caused by this."));
666 mark_lifecycle_started();
667 result = m_agent->start_local_print(params, update_fn, cancel_fn);
668 break;
669 }
670 ctl.update_status(curr_percent, _u8L("The Storage in the printer is abnormal. Please replace it with a normal Storage before sending print job to printer."));
671 return;
673 ctl.update_status(curr_percent, _u8L("The Storage in the printer is read-only. Please replace it with a normal Storage before sending print job to printer."));
674 return;
676 ctl.update_status(curr_percent, _u8L("Sending print job over LAN"));
677 mark_lifecycle_started();
678 result = m_agent->start_local_print(params, update_fn, cancel_fn);
679 break;
680 default:
681 ctl.update_status(curr_percent, _u8L("Encountered an unknown error with the Storage status. Please try again."));
682 return;
683 }
684 }
685 }
686
687 if (result < 0) {
688 curr_percent = -1;
689
690 // The printer is still fetching its encryption flag (a transient state), so ask the
691 // user to retry rather than showing a generic error.
693 msg_text = _u8L("Retrieving printer information, please try again later.");
695 msg_text = file_is_not_exists_str;
697 msg_text = file_over_size_str;
701 msg_text = timeout_to_upload_str;
703 msg_text = upload_ftp_failed_str;
704 } else if (result == BAMBU_NETWORK_ERR_CANCELED) {
705 msg_text = print_canceled_str;
706 ctl.update_status(0, msg_text);
707 } else {
708 msg_text = send_print_failed_str;
709 }
710
711 if (result != BAMBU_NETWORK_ERR_CANCELED) {
712 ctl.show_error_info(msg_text, 0, "", "");
713 }
714
715 BOOST_LOG_TRIVIAL(error) << "print_job: failed, result = " << result;
716 } else {
717 // wait for printer mqtt ready the same job id
718
719 BOOST_LOG_TRIVIAL(error) << "print_job: send ok.";
720 wxCommandEvent* evt = new wxCommandEvent(m_print_job_completed_id);
721 if (!m_completed_evt_data.empty())
722 evt->SetString(m_completed_evt_data);
723 else
724 evt->SetString(m_dev_id);
725 if (m_print_job_completed_id == wxGetApp().plater()->get_send_calibration_finished_event()) {
726 int sel = wxGetApp().mainframe->get_calibration_curr_tab();
727 if (sel >= 0) {
728 evt->SetInt(sel);
729 }
730 }
731 wxQueueEvent(m_plater, evt);
732 m_job_finished = true;
733 m_lifecycle_success = true;
734 }
735}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
#define PLATE_CURRENT_IDX
Definition PartPlate.hpp:56
#define PRINT_JOB_SENDING_TIMEOUT
Definition PrintJob.hpp:20
#define BAMBU_NETOWRK_ERR_PRINT_SP_ENC_FLAG_NOT_READY
Definition bambu_networking.hpp:85
#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_UPLOAD_FTP_FAILED
Definition bambu_networking.hpp:68
#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
#define BBL_DESIGNER_PROFILE_ID_TAG
Definition bbs_3mf.hpp:47
#define BBL_DESIGNER_MODEL_TITLE_TAG
Definition bbs_3mf.hpp:46
#define BBL_DESIGNER_MODEL_ID_TAG
Definition bbs_3mf.hpp:49
#define BBL_DESIGNER_PROFILE_TITLE_TAG
Definition bbs_3mf.hpp:48
bool use_legacy_network() const
Definition BBLNetworkPlugin.hpp:304
static BBLNetworkPlugin & instance()
Definition BBLNetworkPlugin.cpp:56
static std::string get_longlong_val(const nlohmann::json &j)
Definition DevUtil.cpp:173
@ 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
std::string connection_type
Definition PrintJob.hpp:75
PlateListData plate_data
Definition PrintJob.hpp:60
bool m_local_use_ssl
Definition PrintJob.hpp:83
bool could_emmc_print
Definition PrintJob.hpp:93
bool task_vibration_cali
Definition PrintJob.hpp:87
bool task_use_ams
Definition PrintJob.hpp:94
int auto_offset_cali
Definition PrintJob.hpp:101
bool task_timelapse_use_internal
Definition PrintJob.hpp:89
bool task_flow_cali
Definition PrintJob.hpp:86
std::string m_print_type
Definition PrintJob.hpp:76
std::string task_ams_mapping2
Definition PrintJob.hpp:72
std::string truncate_string(const std::string &str, size_t maxLength)
Definition PrintJob.cpp:93
bool m_local_use_ssl_for_ftp
Definition PrintJob.hpp:84
bool cloud_print_only
Definition PrintJob.hpp:91
int extruder_cali_manual_mode
Definition PrintJob.hpp:102
bool task_record_timelapse
Definition PrintJob.hpp:88
std::string task_ams_mapping
Definition PrintJob.hpp:71
std::string task_ams_mapping_info
Definition PrintJob.hpp:73
bool task_layer_inspect
Definition PrintJob.hpp:90
void prepare()
Definition PrintJob.cpp:78
int m_print_from_sdc_plate_idx
Definition PrintJob.hpp:81
bool task_ext_change_assist
Definition PrintJob.hpp:97
int auto_bed_leveling
Definition PrintJob.hpp:99
std::string m_dst_path
Definition PrintJob.hpp:77
wxString m_completed_evt_data
Definition PrintJob.hpp:53
std::string m_ftp_folder
Definition PrintJob.hpp:67
std::string task_bed_type
Definition PrintJob.hpp:69
bool has_sdcard
Definition PrintJob.hpp:92
std::string task_nozzles_info
Definition PrintJob.hpp:74
DevStorage::SdcardState sdcard_state
Definition PrintJob.hpp:96
std::string task_nozzle_mapping
Definition PrintJob.hpp:70
int auto_flow_cali
Definition PrintJob.hpp:100
bool task_bed_leveling
Definition PrintJob.hpp:85
std::string m_dev_ip
Definition PrintJob.hpp:66
std::string m_access_code
Definition PrintJob.hpp:68
static auto upload_ftp_failed_str
Definition PrintJob.cpp:55
static auto desc_file_too_large
Definition PrintJob.cpp:58
constexpr int time_out
Definition FanControl.cpp:41
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
@ PrintingStageSending
Definition bambu_networking.hpp:151
@ PrintingStageCreate
Definition bambu_networking.hpp:148
@ PrintingStageFinished
Definition bambu_networking.hpp:154
@ PrintingStageUpload
Definition bambu_networking.hpp:149
@ PrintingStageWaiting
Definition bambu_networking.hpp:150
@ PrintingStageERROR
Definition bambu_networking.hpp:155
@ PrintingStageRecord
Definition bambu_networking.hpp:152
@ PrintJobStarted
Definition LifecycleEvents.hpp:60
static std::string bed_type_to_gcode_string(const BedType type)
Definition PrintConfig.hpp:701
FileTransferModule & module()
Definition FileTransferUtils.hpp:248
#define _u8L(s)
Definition I18N.hpp:11

References _L, _u8L, Slic3r::PrintParams::ams_mapping, Slic3r::PrintParams::ams_mapping2, Slic3r::PrintParams::ams_mapping_info, auto_bed_leveling, Slic3r::PrintParams::auto_bed_leveling, auto_flow_cali, Slic3r::PrintParams::auto_flow_cali, auto_offset_cali, Slic3r::PrintParams::auto_offset_cali, BAMBU_NETOWRK_ERR_PRINT_SP_ENC_FLAG_NOT_READY, 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, BAMBU_NETWORK_ERR_PRINT_WR_UPLOAD_FTP_FAILED, BBL_DESIGNER_MODEL_ID_TAG, BBL_DESIGNER_MODEL_TITLE_TAG, BBL_DESIGNER_PROFILE_ID_TAG, BBL_DESIGNER_PROFILE_TITLE_TAG, Slic3r::bed_type_to_gcode_string(), Slic3r::GUI::Job::Ctl::call_on_main_thread(), Slic3r::GUI::check_gcode_failed_str, Slic3r::GUI::Job::Ctl::clear_percent(), cloud_print_only, Slic3r::PrintParams::comments, Slic3r::PrintParams::config_filename, connection_type, Slic3r::PrintParams::connection_type, could_emmc_print, 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::PrintParams::dst_file, extruder_cali_manual_mode, Slic3r::PrintParams::extruder_cali_manual_mode, 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::PrintParams::ftp_folder, Slic3r::GUI::PartPlate::get_bed_type(), Slic3r::DevJsonValParser::get_longlong_val(), Slic3r::DeviceManager::get_selected_machine(), has_sdcard, Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_NORMAL, Slic3r::DevStorage::HAS_SDCARD_READONLY, Slic3r::BBLNetworkPlugin::instance(), Slic3r::MachineObject::is_in_printing_status(), Slic3r::MachineObject::is_support_wait_sending_finish, Slic3r::GUI::PartPlate::is_valid_gcode_file(), job_data, Slic3r::MachineObject::job_id_, m_access_code, m_completed_evt_data, m_dev_id, m_dev_ip, m_dst_path, m_enter_ip_address_fun_fail, m_ftp_folder, m_is_calibration_task, m_job_finished, m_lifecycle_started, m_lifecycle_success, m_local_use_ssl, m_local_use_ssl_for_ftp, m_plater, m_print_from_sdc_plate_idx, m_print_job_completed_id, m_print_type, m_project_name, Slic3r::ModelInfo::metadata_items, Slic3r::module(), Slic3r::LifecycleEventContext::name, Slic3r::DevStorage::NO_SDCARD, Slic3r::PrintParams::nozzle_mapping, Slic3r::PrintParams::nozzles_info, Slic3r::PrintParams::origin_model_id, Slic3r::PrintParams::origin_profile_id, Slic3r::PrintParams::password, PLATE_ALL_IDX, PLATE_CURRENT_IDX, plate_data, Slic3r::PrintParams::plate_index, Slic3r::GUI::plater(), prepare(), Slic3r::PrintParams::preset_name, Slic3r::GUI::print_canceled_str, PRINT_JOB_SENDING_TIMEOUT, Slic3r::MachineObject::print_status, Slic3r::PrintParams::print_type, Slic3r::PrintingStageCreate, Slic3r::PrintingStageERROR, Slic3r::PrintingStageFinished, Slic3r::PrintingStageRecord, Slic3r::PrintingStageSending, Slic3r::PrintingStageUpload, Slic3r::PrintingStageWaiting, Slic3r::GUI::printjob_cancel_str, Slic3r::PrintJobStarted, Slic3r::PrintParams::project_name, sdcard_state, Slic3r::GUI::send_print_failed_str, Slic3r::GUI::Job::Ctl::show_error_info(), Slic3r::LifecycleEventContext::source, Slic3r::NetworkAgent::start_local_print(), Slic3r::NetworkAgent::start_local_print_with_record(), Slic3r::NetworkAgent::start_print(), Slic3r::NetworkAgent::start_sdcard_print(), Slic3r::NetworkAgent::start_send_gcode_to_sdcard(), Slic3r::PrintParams::stl_design_id, task_ams_mapping, task_ams_mapping2, task_ams_mapping_info, task_bed_leveling, Slic3r::PrintParams::task_bed_leveling, task_bed_type, Slic3r::PrintParams::task_bed_type, task_ext_change_assist, Slic3r::PrintParams::task_ext_change_assist, task_flow_cali, Slic3r::PrintParams::task_flow_cali, task_layer_inspect, Slic3r::PrintParams::task_layer_inspect, task_nozzle_mapping, task_nozzles_info, task_record_timelapse, Slic3r::PrintParams::task_record_timelapse, task_timelapse_use_internal, Slic3r::PrintParams::task_timelapse_use_internal, task_use_ams, Slic3r::PrintParams::task_use_ams, task_vibration_cali, Slic3r::PrintParams::task_vibration_cali, Slic3r::GUI::time_out, Slic3r::GUI::timeout_to_upload_str, Slic3r::trace(), truncate_string(), Slic3r::PrintParams::try_emmc_print, Slic3r::GUI::Job::Ctl::update_status(), Slic3r::GUI::upload_ftp_failed_str, Slic3r::BBLNetworkPlugin::use_legacy_network(), 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_calibration_task()

void Slic3r::GUI::PrintJob::set_calibration_task ( bool is_calibration)
790{
791 m_is_calibration_task = is_calibration;
792}

References m_is_calibration_task.

◆ set_dst_name()

void Slic3r::GUI::PrintJob::set_dst_name ( std::string path)
769{
770 m_dst_path = path;
771}

References m_dst_path.

◆ set_print_config()

void Slic3r::GUI::PrintJob::set_print_config ( std::string bed_type,
bool bed_leveling,
bool flow_cali,
bool vabration_cali,
bool record_timelapse,
bool layer_inspect,
bool ext_change_assist,
int auto_bed_levelingt,
int auto_flow_calit,
int auto_offset_calit,
int extruder_cali_manual_modet = -1 )
inline
109 {
110 task_bed_type = bed_type;
111 task_bed_leveling = bed_leveling;
112 task_flow_cali = flow_cali;
113 task_vibration_cali = vabration_cali;
114 task_record_timelapse = record_timelapse;
115 task_layer_inspect = layer_inspect;
116 task_ext_change_assist = ext_change_assist;
117
118 auto_bed_leveling = auto_bed_levelingt;
119 auto_flow_cali = auto_flow_calit;
120 auto_offset_cali = auto_offset_calit;
121 extruder_cali_manual_mode = extruder_cali_manual_modet;
122
123 }

References auto_bed_leveling, auto_flow_cali, auto_offset_cali, extruder_cali_manual_mode, task_bed_leveling, task_bed_type, task_ext_change_assist, task_flow_cali, task_layer_inspect, task_record_timelapse, and task_vibration_cali.

◆ set_print_job_finished_event()

void Slic3r::GUI::PrintJob::set_print_job_finished_event ( int event_id,
wxString evt_data = wxEmptyString )
inline
131 {
132 m_print_job_completed_id = event_id;
133 m_completed_evt_data = evt_data;
134 }

References m_completed_evt_data, and m_print_job_completed_id.

◆ set_project_name()

void Slic3r::GUI::PrintJob::set_project_name ( std::string name)
764{
765 m_project_name = name;
766}

References m_project_name.

◆ status_range()

int Slic3r::GUI::PrintJob::status_range ( ) const
inline
126 {
127 return 100;
128 }

◆ truncate_string()

std::string Slic3r::GUI::PrintJob::truncate_string ( const std::string & str,
size_t maxLength )
94{
95 if (str.length() <= maxLength)
96 {
97 return str;
98 }
99
100 wxString local_str = wxString::FromUTF8(str);
101 wxString truncatedStr;
102
103 for (auto i = 1; i < local_str.Length(); i++) {
104 wxString tagStr = local_str.Mid(0, i);
105 if (tagStr.ToUTF8().length() >= maxLength) {
106 truncatedStr = local_str.Mid(0, i - 1);
107 break;
108 }
109 }
110 return truncatedStr.utf8_string();
111}

Referenced by process().

Here is the caller graph for this function:

Member Data Documentation

◆ auto_bed_leveling

int Slic3r::GUI::PrintJob::auto_bed_leveling {0}
99{0};

Referenced by process(), and set_print_config().

◆ auto_flow_cali

int Slic3r::GUI::PrintJob::auto_flow_cali {0}
100{0};

Referenced by process(), and set_print_config().

◆ auto_offset_cali

int Slic3r::GUI::PrintJob::auto_offset_cali {0}
101{0};

Referenced by process(), and set_print_config().

◆ cloud_print_only

bool Slic3r::GUI::PrintJob::cloud_print_only { false }
91{ false };

Referenced by process().

◆ connection_type

std::string Slic3r::GUI::PrintJob::connection_type

Referenced by process().

◆ could_emmc_print

bool Slic3r::GUI::PrintJob::could_emmc_print { false }
93{ false };

Referenced by process().

◆ extruder_cali_manual_mode

int Slic3r::GUI::PrintJob::extruder_cali_manual_mode {-1}
102{-1};

Referenced by process(), and set_print_config().

◆ has_sdcard

bool Slic3r::GUI::PrintJob::has_sdcard { false }
92{ false };

Referenced by process().

◆ job_data

PrintPrepareData Slic3r::GUI::PrintJob::job_data

Referenced by prepare(), and process().

◆ m_access_code

std::string Slic3r::GUI::PrintJob::m_access_code

Referenced by process().

◆ m_completed_evt_data

wxString Slic3r::GUI::PrintJob::m_completed_evt_data
private

◆ m_dev_id

std::string Slic3r::GUI::PrintJob::m_dev_id
private

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

◆ m_dev_ip

std::string Slic3r::GUI::PrintJob::m_dev_ip

Referenced by process().

◆ m_dst_path

std::string Slic3r::GUI::PrintJob::m_dst_path

Referenced by process(), and set_dst_name().

◆ m_enter_ip_address_fun_fail

std::function<void()> Slic3r::GUI::PrintJob::m_enter_ip_address_fun_fail { nullptr }
private
54{ nullptr };

Referenced by on_check_ip_address_fail(), and process().

◆ m_enter_ip_address_fun_success

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

Referenced by on_check_ip_address_success().

◆ m_ftp_folder

std::string Slic3r::GUI::PrintJob::m_ftp_folder

Referenced by process().

◆ m_is_calibration_task

bool Slic3r::GUI::PrintJob::m_is_calibration_task = false

◆ m_job_finished

bool Slic3r::GUI::PrintJob::m_job_finished { false }
private
48{ false };

Referenced by is_finished(), and process().

◆ m_lifecycle_finished

bool Slic3r::GUI::PrintJob::m_lifecycle_finished { false }
private
50{ false };

Referenced by finalize().

◆ m_lifecycle_started

bool Slic3r::GUI::PrintJob::m_lifecycle_started { false }
private
49{ false };

Referenced by finalize(), and process().

◆ m_lifecycle_success

bool Slic3r::GUI::PrintJob::m_lifecycle_success { false }
private
51{ false };

Referenced by finalize(), and process().

◆ m_local_use_ssl

bool Slic3r::GUI::PrintJob::m_local_use_ssl { true }
83{ true };

Referenced by process().

◆ m_local_use_ssl_for_ftp

bool Slic3r::GUI::PrintJob::m_local_use_ssl_for_ftp { true }
84{ true };

Referenced by process().

◆ m_plater

Plater* Slic3r::GUI::PrintJob::m_plater
private

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

◆ m_print_from_sdc_plate_idx

int Slic3r::GUI::PrintJob::m_print_from_sdc_plate_idx = 0

Referenced by process().

◆ m_print_job_completed_id

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

◆ m_print_type

std::string Slic3r::GUI::PrintJob::m_print_type

Referenced by process().

◆ m_project_name

std::string Slic3r::GUI::PrintJob::m_project_name

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

◆ m_success_fun

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

Referenced by on_success().

◆ plate_data

PlateListData Slic3r::GUI::PrintJob::plate_data

Referenced by process().

◆ sdcard_state

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

Referenced by process().

◆ task_ams_mapping

std::string Slic3r::GUI::PrintJob::task_ams_mapping

Referenced by process().

◆ task_ams_mapping2

std::string Slic3r::GUI::PrintJob::task_ams_mapping2

Referenced by process().

◆ task_ams_mapping_info

std::string Slic3r::GUI::PrintJob::task_ams_mapping_info

Referenced by process().

◆ task_bed_leveling

bool Slic3r::GUI::PrintJob::task_bed_leveling

Referenced by process(), and set_print_config().

◆ task_bed_type

std::string Slic3r::GUI::PrintJob::task_bed_type

Referenced by process(), and set_print_config().

◆ task_ext_change_assist

bool Slic3r::GUI::PrintJob::task_ext_change_assist { false }
97{ false };

Referenced by process(), and set_print_config().

◆ task_flow_cali

bool Slic3r::GUI::PrintJob::task_flow_cali

Referenced by process(), and set_print_config().

◆ task_layer_inspect

bool Slic3r::GUI::PrintJob::task_layer_inspect

Referenced by process(), and set_print_config().

◆ task_nozzle_mapping

std::string Slic3r::GUI::PrintJob::task_nozzle_mapping

Referenced by process().

◆ task_nozzles_info

std::string Slic3r::GUI::PrintJob::task_nozzles_info

Referenced by process().

◆ task_record_timelapse

bool Slic3r::GUI::PrintJob::task_record_timelapse

Referenced by process(), and set_print_config().

◆ task_timelapse_use_internal

bool Slic3r::GUI::PrintJob::task_timelapse_use_internal { false }
89{ false };

Referenced by process().

◆ task_use_ams

bool Slic3r::GUI::PrintJob::task_use_ams { true }
94{ true };

Referenced by process().

◆ task_vibration_cali

bool Slic3r::GUI::PrintJob::task_vibration_cali

Referenced by process(), and set_print_config().


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