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

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

Inheritance diagram for Slic3r::GUI::SendToPrinterDialog:
Collaboration diagram for Slic3r::GUI::SendToPrinterDialog:

Public Types

enum  {
  SUCCESS = 0 , CONTINUE = 1 , ERROR_JSON = 2 , ERROR_PIPE = 3 ,
  ERROR_CANCEL = 4 , ERROR_RES_BUSY = 5 , ERROR_TIME_OUT = 6 , FILE_NO_EXIST = 10 ,
  FILE_NAME_INVALID = 11 , FILE_SIZE_ERR = 12 , FILE_OPEN_ERR = 13 , FILE_READ_WRITE_ERR = 14 ,
  FILE_CHECK_ERR = 15 , FILE_TYPE_ERR = 16 , STORAGE_UNAVAILABLE = 17 , API_VERSION_UNSUPPORT = 18 ,
  FILE_EXIST = 19 , STORAGE_SPACE_NOT_ENOUGH = 20 , FILE_CREATE_ERR = 21 , FILE_WRITE_ERR = 22 ,
  MD5_COMPARE_ERR = 23 , FILE_RENAME_ERR = 24 , SEND_ERR = 25
}

Public Member Functions

 SendToPrinterDialog (Plater *plater=nullptr)
 ~SendToPrinterDialog ()
bool Show (bool show) override
bool is_timeout ()
void on_rename_click (wxCommandEvent &event)
void on_rename_enter ()
void stripWhiteSpace (std::string &str)
void prepare_mode ()
void sending_mode ()
void reset_timeout ()
void update_user_printer ()
void update_show_status ()
void prepare (int print_plate_idx)
void check_focus (wxWindow *window)
void check_fcous_state (wxWindow *window)
void update_priner_status_msg (wxString msg, bool is_warning=false)
void update_print_status_msg (wxString msg, bool is_warning=false, bool is_printer=true)
void update_printer_combobox (wxCommandEvent &event)
void on_cancel (wxCloseEvent &event)
void on_ok (wxCommandEvent &event)
void clear_ip_address_config (wxCommandEvent &e)
void on_refresh (wxCommandEvent &event)
void on_print_job_cancel (wxCommandEvent &evt)
void set_default ()
void on_timer (wxTimerEvent &event)
void on_selection_changed (wxCommandEvent &event)
void Enable_Refresh_Button (bool en)
void show_status (PrintDialogStatus status, std::vector< wxString > params=std::vector< wxString >())
void Enable_Send_Button (bool en)
void on_dpi_changed (const wxRect &suggested_rect) override
void update_user_machine_list ()
void show_print_failed_info (bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
void update_print_error_info (int code, std::string msg, std::string extra)
void on_change_color_mode ()
void update_storage_list (const std::vector< std::string > &storages)
std::string get_storage_selected ()
wxString format_text (wxString &m_msg)
std::vector< std::string > sort_string (std::vector< std::string > strArray)
void GetConnection ()
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Protected Member Functions

virtual void on_sys_color_changed ()

Private Types

enum  ConnectionStatus {
  NOT_START , CONNECTING , CONNECTED , CONNECTION_FAILED ,
  DISCONNECTED
}

Private Member Functions

void init_bind ()
void init_timer ()
void ResetConnectMethod ()
void ResetTunnelAndJob ()
void OnConnection (bool is_success, int error_code, std::string error_msg)
void CreateMediaAbilityJob ()
void CreateUploadFileJob (const std::string &path, const std::string &name)
void ChangeConnectMethod ()
void UploadFileProgressCallback (int progress)
void UploadFileRessultCallback (int res, int resp_ec, std::string json_res, std::vector< std::byte > bin_res)
void Reset ()
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

int m_print_plate_idx
int m_print_error_code = 0
int timeout_count = 0
int m_connect_try_times = 0
bool m_is_in_sending_mode { false }
bool m_is_rename_mode { false }
bool enable_prepare_mode { true }
bool m_export_3mf_cancel { false }
bool m_is_canceled { false }
bool m_tcp_try_connect {true}
bool m_tutk_try_connect {false}
bool m_ftp_try_connect {false}
std::string m_print_error_msg
std::string m_print_error_extra
std::string m_print_info
std::string m_printer_last_select
std::string m_device_select
wxString m_current_project_name
TextInput * m_rename_input { nullptr }
wxSimplebook * m_rename_switch_panel { nullptr }
Plater * m_plater { nullptr }
ThumbnailPanel * m_thumbnailPanel { nullptr }
ComboBox * m_comboBox_printer { nullptr }
Button * m_rename_button { nullptr }
Button * m_button_refresh { nullptr }
Button * m_button_ensure { nullptr }
wxPanel * m_scrollable_region
wxPanel * m_line_schedule { nullptr }
wxPanel * m_panel_sending { nullptr }
wxPanel * m_panel_prepare { nullptr }
wxPanel * m_panel_finish { nullptr }
wxPanel * m_line_top { nullptr }
wxPanel * m_panel_image { nullptr }
wxPanel * m_rename_normal_panel { nullptr }
wxPanel * m_line_materia { nullptr }
wxBoxSizer * m_storage_sizer { nullptr }
wxPanel * m_storage_panel { nullptr }
wxPanel * m_connecting_panel {nullptr}
wxSimplebook * m_simplebook { nullptr }
wxStaticText * m_statictext_finish { nullptr }
wxStaticText * m_statictext_printer_msg { nullptr }
wxStaticText * m_connecting_printer_msg {nullptr}
wxStaticText * m_stext_printer_title { nullptr }
wxStaticText * m_rename_text { nullptr }
wxStaticText * m_stext_time { nullptr }
wxStaticText * m_stext_weight { nullptr }
Label * m_st_txt_error_code { nullptr }
Label * m_st_txt_error_desc { nullptr }
Label * m_st_txt_extra_info { nullptr }
HyperLink * m_link_network_state { nullptr }
StateColor btn_bg_enable
wxBoxSizer * rename_sizer_v { nullptr }
wxBoxSizer * rename_sizer_h { nullptr }
wxBoxSizer * sizer_thumbnail
wxBoxSizer * m_sizer_scrollable_region
wxBoxSizer * m_sizer_main
PrintDialogStatus m_print_status { PrintStatusInit }
AnimaIcon * m_animaicon {nullptr}
std::vector< wxString > m_bedtype_list
std::map< std::string, ::CheckBox * > m_checkbox_list
std::vector< MachineObject * > m_list
wxColour m_colour_def_color { wxColour(255, 255, 255) }
wxColour m_colour_bold_color { wxColour(38, 46, 48) }
wxTimer * m_refresh_timer { nullptr }
std::unique_ptr< wxTimer > m_task_timer { nullptr }
std::unique_ptr< wxTimer > m_url_timer {nullptr}
std::shared_ptr< BBLStatusBarSend > m_status_bar
std::unique_ptr< Worker > m_worker
wxScrolledWindow * m_sw_print_failed_info {nullptr}
std::shared_ptr< int > m_token = std::make_shared<int>(0)
std::vector< RadioBox * > m_storage_radioBox
std::string m_selected_storage
bool m_if_has_sdcard
std::vector< std::string > m_ability_list
ConnectionStatus m_connection_status {ConnectionStatus::NOT_START}
std::unique_ptr< FileTransferTunnel > m_filetransfer_tunnel
std::unique_ptr< FileTransferJob > m_filetransfer_mediability_job
std::unique_ptr< FileTransferJob > m_filetransfer_uploadfile_job
wxDateTime m_last_refresh_time
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
SUCCESS 
CONTINUE 
ERROR_JSON 
ERROR_PIPE 
ERROR_CANCEL 
ERROR_RES_BUSY 
ERROR_TIME_OUT 
FILE_NO_EXIST 
FILE_NAME_INVALID 
FILE_SIZE_ERR 
FILE_OPEN_ERR 
FILE_READ_WRITE_ERR 
FILE_CHECK_ERR 
FILE_TYPE_ERR 
STORAGE_UNAVAILABLE 
API_VERSION_UNSUPPORT 
FILE_EXIST 
STORAGE_SPACE_NOT_ENOUGH 
FILE_CREATE_ERR 
FILE_WRITE_ERR 
MD5_COMPARE_ERR 
FILE_RENAME_ERR 
SEND_ERR 
146 {
147 SUCCESS = 0,
148 CONTINUE = 1,
149 ERROR_JSON = 2,
150 ERROR_PIPE = 3,
151 ERROR_CANCEL = 4,
152 ERROR_RES_BUSY = 5,
153 ERROR_TIME_OUT = 6,
154 FILE_NO_EXIST = 10,
156 FILE_SIZE_ERR = 12,
157 FILE_OPEN_ERR = 13,
159 FILE_CHECK_ERR = 15,
160 FILE_TYPE_ERR = 16,
163 FILE_EXIST = 19,
165 FILE_CREATE_ERR = 21,
166 FILE_WRITE_ERR = 22,
167 MD5_COMPARE_ERR = 23,
168 FILE_RENAME_ERR = 24,
169 SEND_ERR = 25,
170};
@ ERROR_TIME_OUT
Definition SendToPrinter.hpp:153
@ FILE_WRITE_ERR
Definition SendToPrinter.hpp:166
@ FILE_EXIST
Definition SendToPrinter.hpp:163
@ ERROR_CANCEL
Definition SendToPrinter.hpp:151
@ API_VERSION_UNSUPPORT
Definition SendToPrinter.hpp:162
@ MD5_COMPARE_ERR
Definition SendToPrinter.hpp:167
@ SEND_ERR
Definition SendToPrinter.hpp:169
@ ERROR_PIPE
Definition SendToPrinter.hpp:150
@ FILE_OPEN_ERR
Definition SendToPrinter.hpp:157
@ ERROR_RES_BUSY
Definition SendToPrinter.hpp:152
@ CONTINUE
Definition SendToPrinter.hpp:148
@ ERROR_JSON
Definition SendToPrinter.hpp:149
@ STORAGE_UNAVAILABLE
Definition SendToPrinter.hpp:161
@ FILE_NO_EXIST
Definition SendToPrinter.hpp:154
@ FILE_TYPE_ERR
Definition SendToPrinter.hpp:160
@ FILE_CREATE_ERR
Definition SendToPrinter.hpp:165
@ FILE_NAME_INVALID
Definition SendToPrinter.hpp:155
@ FILE_SIZE_ERR
Definition SendToPrinter.hpp:156
@ FILE_READ_WRITE_ERR
Definition SendToPrinter.hpp:158
@ FILE_CHECK_ERR
Definition SendToPrinter.hpp:159
@ STORAGE_SPACE_NOT_ENOUGH
Definition SendToPrinter.hpp:164
@ FILE_RENAME_ERR
Definition SendToPrinter.hpp:168
@ SUCCESS
Definition SendToPrinter.hpp:147

◆ ConnectionStatus

Enumerator
NOT_START 
CONNECTING 
CONNECTED 
CONNECTION_FAILED 
DISCONNECTED 
@ CONNECTED
Definition SendToPrinter.hpp:173
@ CONNECTION_FAILED
Definition SendToPrinter.hpp:173
@ NOT_START
Definition SendToPrinter.hpp:173
@ CONNECTING
Definition SendToPrinter.hpp:173
@ DISCONNECTED
Definition SendToPrinter.hpp:173

Constructor & Destructor Documentation

◆ SendToPrinterDialog()

Slic3r::GUI::SendToPrinterDialog::SendToPrinterDialog ( Plater * plater = nullptr)
270 : DPIDialog(static_cast<wxWindow *>(wxGetApp().mainframe), wxID_ANY, _L("Send to Printer storage"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxCLOSE_BOX)
272{
273#ifdef __WINDOWS__
274 SetDoubleBuffered(true);
275#endif //__WINDOWS__
276
277 // bind
278 Bind(wxEVT_CLOSE_WINDOW, &SendToPrinterDialog::on_cancel, this);
279
280 // font
281 SetFont(wxGetApp().normal_font());
282
283 Freeze();
284 SetBackgroundColour(m_colour_def_color);
285
286 m_sizer_main = new wxBoxSizer(wxVERTICAL);
287
288 m_sizer_main->SetMinSize(wxSize(0, -1));
289 m_line_top = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
290 m_line_top->SetBackgroundColour(wxColour(166, 169, 170));
291
292 m_scrollable_region = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
293 m_sizer_scrollable_region = new wxBoxSizer(wxVERTICAL);
294
295 m_panel_image = new wxPanel(m_scrollable_region, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
296 m_panel_image->SetBackgroundColour(m_colour_def_color);
297
298 sizer_thumbnail = new wxBoxSizer(wxVERTICAL);
299 m_thumbnailPanel = new ThumbnailPanel(m_panel_image);
300 m_thumbnailPanel->SetSize(wxSize(FromDIP(256), FromDIP(256)));
301 m_thumbnailPanel->SetMinSize(wxSize(FromDIP(256), FromDIP(256)));
302 m_thumbnailPanel->SetMaxSize(wxSize(FromDIP(256), FromDIP(256)));
303 sizer_thumbnail->Add(m_thumbnailPanel, 0, wxEXPAND, 0);
305 m_panel_image->Layout();
306
307 wxBoxSizer *m_sizer_basic = new wxBoxSizer(wxHORIZONTAL);
308 wxBoxSizer *m_sizer_basic_weight = new wxBoxSizer(wxHORIZONTAL);
309 wxBoxSizer *m_sizer_basic_time = new wxBoxSizer(wxHORIZONTAL);
310
311 auto timeimg = new wxStaticBitmap(m_scrollable_region, wxID_ANY, create_scaled_bitmap("print-time", this, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
312 m_sizer_basic_weight->Add(timeimg, 1, wxEXPAND | wxALL, FromDIP(5));
313 m_stext_time = new wxStaticText(m_scrollable_region, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_RIGHT);
314 m_sizer_basic_weight->Add(m_stext_time, 0, wxALL, FromDIP(5));
315 m_sizer_basic->Add(m_sizer_basic_weight, 0, wxALIGN_CENTER, 0);
316 m_sizer_basic->Add(0, 0, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
317
318 auto weightimg = new wxStaticBitmap(m_scrollable_region, wxID_ANY, create_scaled_bitmap("print-weight", this, 18), wxDefaultPosition, wxSize(FromDIP(18), FromDIP(18)), 0);
319 m_sizer_basic_time->Add(weightimg, 1, wxEXPAND | wxALL, FromDIP(5));
320 m_stext_weight = new wxStaticText(m_scrollable_region, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT);
321 m_sizer_basic_time->Add(m_stext_weight, 0, wxALL, FromDIP(5));
322 m_sizer_basic->Add(m_sizer_basic_time, 0, wxALIGN_CENTER, 0);
323
324 m_line_materia = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1), wxTAB_TRAVERSAL);
325 m_line_materia->SetForegroundColour(wxColour(238, 238, 238));
326 m_line_materia->SetBackgroundColour(wxColour(238, 238, 238));
327
328 wxBoxSizer *m_sizer_printer = new wxBoxSizer(wxHORIZONTAL);
329
330 m_stext_printer_title = new wxStaticText(this, wxID_ANY, _L("Printer"), wxDefaultPosition, wxSize(-1, -1), 0);
332 m_stext_printer_title->Wrap(-1);
333 m_stext_printer_title->SetForegroundColour(m_colour_bold_color);
334 m_stext_printer_title->SetBackgroundColour(m_colour_def_color);
335
336 m_sizer_printer->Add(m_stext_printer_title, 0, wxALL | wxLEFT, FromDIP(5));
337 m_sizer_printer->Add(0, 0, 0, wxEXPAND | wxLEFT, FromDIP(12));
338
339 m_comboBox_printer = new ::ComboBox(this, wxID_ANY, "", wxDefaultPosition, wxSize(FromDIP(250), -1), 0, nullptr, wxCB_READONLY);
341
342 m_sizer_printer->Add(m_comboBox_printer, 1, wxEXPAND | wxRIGHT, FromDIP(5));
343
344 m_button_refresh = new Button(this, _L("Refresh"));
346 m_button_refresh->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_refresh, this);
347
348 m_sizer_printer->Add(m_button_refresh, 0, wxALL | wxLEFT, FromDIP(5));
349
350 /*select storage*/
351 m_storage_panel = new wxPanel(this);
352 m_storage_panel->SetBackgroundColour(*wxWHITE);
353 m_storage_sizer = new wxBoxSizer(wxHORIZONTAL);
355 m_storage_panel->Layout();
356
357 // try to connect
358 m_statictext_printer_msg = new wxStaticText(this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(FromDIP(400), -1), wxALIGN_CENTER_HORIZONTAL);
360 m_statictext_printer_msg->SetForegroundColour(*wxBLACK);
362
363 wxBoxSizer *m_sizer_connecting = new wxBoxSizer(wxHORIZONTAL);
364 m_connecting_panel = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxDefaultSize);
365
366 m_connecting_printer_msg = new wxStaticText(m_connecting_panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxALIGN_CENTER_HORIZONTAL);
368 m_connecting_printer_msg->SetForegroundColour(*wxBLACK);
369 m_connecting_printer_msg->SetLabel(_L("Try to connect"));
370 /*m_connecting_printer_msg->Hide();*/
372
373 std::vector<std::string> list{"ams_rfid_1", "ams_rfid_2", "ams_rfid_3", "ams_rfid_4"};
374 m_animaicon = new AnimaIcon(m_connecting_panel, wxID_ANY, list, "refresh_printer", 100);
375 m_sizer_connecting->Add(m_connecting_printer_msg, 1, wxALIGN_CENTER_VERTICAL | wxRIGHT, FromDIP(5));
376 m_sizer_connecting->Add(m_animaicon, 0, wxALIGN_CENTER_VERTICAL);
377
378 m_connecting_panel->SetSizer(m_sizer_connecting);
379 m_connecting_panel->Layout();
380 m_connecting_panel->Fit();
381 m_connecting_panel->Hide();
382
383 // line schedule
384 m_line_schedule = new wxPanel(this, wxID_ANY, wxDefaultPosition, wxSize(-1, 1));
385 m_line_schedule->SetBackgroundColour(wxColour(238, 238, 238));
386 m_simplebook = new wxSimplebook(this, wxID_ANY, wxDefaultPosition, SELECT_MACHINE_DIALOG_SIMBOOK_SIZE, 0);
387
388 // perpare mode
389 m_panel_prepare = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
390 m_panel_prepare->SetBackgroundColour(m_colour_def_color);
391 // m_panel_prepare->SetBackgroundColour(wxColour(135,206,250));
392 wxBoxSizer *m_sizer_prepare = new wxBoxSizer(wxVERTICAL);
393 wxBoxSizer *m_sizer_pcont = new wxBoxSizer(wxHORIZONTAL);
394
395 m_sizer_prepare->Add(0, 0, 1, wxTOP, FromDIP(22));
396 m_sizer_pcont->Add(0, 0, 1, wxEXPAND, 0);
397 m_button_ensure = new Button(m_panel_prepare, _L("Send"));
399
400 m_button_ensure->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_ok, this);
401 m_sizer_pcont->Add(m_button_ensure, 0, wxEXPAND | wxBOTTOM, FromDIP(10));
402 m_sizer_prepare->Add(m_sizer_pcont, 0, wxEXPAND, 0);
403 m_panel_prepare->SetSizer(m_sizer_prepare);
404 m_panel_prepare->Layout();
405 m_simplebook->AddPage(m_panel_prepare, wxEmptyString, true);
406
407 // sending mode
408 m_status_bar = std::make_shared<BBLStatusBarSend>(m_simplebook);
409 m_panel_sending = m_status_bar->get_panel();
410 m_simplebook->AddPage(m_panel_sending, wxEmptyString, false);
411
412 m_worker = std::make_unique<PlaterWorker<BoostThreadWorker>>(this, m_status_bar, "send_worker");
413
414 // finish mode
415 m_panel_finish = new wxPanel(m_simplebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
416 m_panel_finish->SetBackgroundColour(wxColour(135, 206, 250));
417 wxBoxSizer *m_sizer_finish = new wxBoxSizer(wxHORIZONTAL);
418 wxBoxSizer *m_sizer_finish_v = new wxBoxSizer(wxVERTICAL);
419 wxBoxSizer *m_sizer_finish_h = new wxBoxSizer(wxHORIZONTAL);
420
421 auto imgsize = FromDIP(25);
422 auto completedimg = new wxStaticBitmap(m_panel_finish, wxID_ANY, create_scaled_bitmap("completed", m_panel_finish, 25), wxDefaultPosition, wxSize(imgsize, imgsize), 0);
423 m_sizer_finish_h->Add(completedimg, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
424
425 m_statictext_finish = new wxStaticText(m_panel_finish, wxID_ANY, _L("Send complete"), wxDefaultPosition, wxDefaultSize, 0);
426 m_statictext_finish->Wrap(-1);
427 m_statictext_finish->SetForegroundColour(wxColour(0, 150, 136));
428 m_sizer_finish_h->Add(m_statictext_finish, 0, wxALIGN_CENTER | wxALL, FromDIP(5));
429
430 m_sizer_finish_v->Add(m_sizer_finish_h, 1, wxALIGN_CENTER, 0);
431
432 m_sizer_finish->Add(m_sizer_finish_v, 1, wxALIGN_CENTER, 0);
433
434 m_panel_finish->SetSizer(m_sizer_finish);
435 m_panel_finish->Layout();
436 m_sizer_finish->Fit(m_panel_finish);
437 m_simplebook->AddPage(m_panel_finish, wxEmptyString, false);
438
439 //show bind failed info
440 m_sw_print_failed_info = new wxScrolledWindow(this, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(380), FromDIP(125)), wxVSCROLL);
441 m_sw_print_failed_info->SetBackgroundColour(*wxWHITE);
442 m_sw_print_failed_info->SetScrollRate(0, FromDIP(20));
443 m_sw_print_failed_info->SetMinSize(wxSize(FromDIP(380), FromDIP(125)));
444 m_sw_print_failed_info->SetMaxSize(wxSize(FromDIP(380), FromDIP(125)));
445
446 wxBoxSizer* sizer_print_failed_info = new wxBoxSizer(wxVERTICAL);
447 m_sw_print_failed_info->SetSizer(sizer_print_failed_info);
448
449 wxBoxSizer* sizer_error_code = new wxBoxSizer(wxHORIZONTAL);
450 wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL);
451 wxBoxSizer* sizer_extra_info = new wxBoxSizer(wxHORIZONTAL);
452
453 auto st_title_error_code = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error code"));
454 auto st_title_error_code_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
455 m_st_txt_error_code = new Label(m_sw_print_failed_info, wxEmptyString);
456 st_title_error_code->SetForegroundColour(0x909090);
457 st_title_error_code_doc->SetForegroundColour(0x909090);
458 m_st_txt_error_code->SetForegroundColour(0x909090);
459 st_title_error_code->SetFont(::Label::Body_13);
460 st_title_error_code_doc->SetFont(::Label::Body_13);
462 st_title_error_code->SetMinSize(wxSize(FromDIP(74), -1));
463 st_title_error_code->SetMaxSize(wxSize(FromDIP(74), -1));
464 m_st_txt_error_code->SetMinSize(wxSize(FromDIP(260), -1));
465 m_st_txt_error_code->SetMaxSize(wxSize(FromDIP(260), -1));
466 sizer_error_code->Add(st_title_error_code, 0, wxALL, 0);
467 sizer_error_code->Add(st_title_error_code_doc, 0, wxALL, 0);
468 sizer_error_code->Add(m_st_txt_error_code, 0, wxALL, 0);
469
470 auto st_title_error_desc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Error desc"));
471 auto st_title_error_desc_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
472 m_st_txt_error_desc = new Label(m_sw_print_failed_info, wxEmptyString);
473 st_title_error_desc->SetForegroundColour(0x909090);
474 st_title_error_desc_doc->SetForegroundColour(0x909090);
475 m_st_txt_error_desc->SetForegroundColour(0x909090);
476 st_title_error_desc->SetFont(::Label::Body_13);
477 st_title_error_desc_doc->SetFont(::Label::Body_13);
479 st_title_error_desc->SetMinSize(wxSize(FromDIP(74), -1));
480 st_title_error_desc->SetMaxSize(wxSize(FromDIP(74), -1));
481 m_st_txt_error_desc->SetMinSize(wxSize(FromDIP(260), -1));
482 m_st_txt_error_desc->SetMaxSize(wxSize(FromDIP(260), -1));
483 sizer_error_desc->Add(st_title_error_desc, 0, wxALL, 0);
484 sizer_error_desc->Add(st_title_error_desc_doc, 0, wxALL, 0);
485 sizer_error_desc->Add(m_st_txt_error_desc, 0, wxALL, 0);
486
487 auto st_title_extra_info = new wxStaticText(m_sw_print_failed_info, wxID_ANY, _L("Extra info"));
488 auto st_title_extra_info_doc = new wxStaticText(m_sw_print_failed_info, wxID_ANY, ": ");
489 m_st_txt_extra_info = new Label(m_sw_print_failed_info, wxEmptyString);
490 st_title_extra_info->SetForegroundColour(0x909090);
491 st_title_extra_info_doc->SetForegroundColour(0x909090);
492 m_st_txt_extra_info->SetForegroundColour(0x909090);
493 st_title_extra_info->SetFont(::Label::Body_13);
494 st_title_extra_info_doc->SetFont(::Label::Body_13);
496 st_title_extra_info->SetMinSize(wxSize(FromDIP(74), -1));
497 st_title_extra_info->SetMaxSize(wxSize(FromDIP(74), -1));
498 m_st_txt_extra_info->SetMinSize(wxSize(FromDIP(260), -1));
499 m_st_txt_extra_info->SetMaxSize(wxSize(FromDIP(260), -1));
500 sizer_extra_info->Add(st_title_extra_info, 0, wxALL, 0);
501 sizer_extra_info->Add(st_title_extra_info_doc, 0, wxALL, 0);
502 sizer_extra_info->Add(m_st_txt_extra_info, 0, wxALL, 0);
503
504 // ORCA standardized HyperLink
505 m_link_network_state = new HyperLink(m_sw_print_failed_info, _L("Check the status of current system services"), wxGetApp().link_to_network_check());
507
508 sizer_print_failed_info->Add(m_link_network_state, 0, wxLEFT, 5);
509 sizer_print_failed_info->Add(sizer_error_code, 0, wxLEFT, 5);
510 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
511 sizer_print_failed_info->Add(sizer_error_desc, 0, wxLEFT, 5);
512 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
513 sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
514
515 // bind
516 Bind(EVT_SHOW_ERROR_INFO_SEND, [this](auto& e) {
518 });
519
520 // bind
521 Bind(EVT_UPDATE_USER_MACHINE_LIST, &SendToPrinterDialog::update_printer_combobox, this);
522 Bind(EVT_PRINT_JOB_CANCEL, &SendToPrinterDialog::on_print_job_cancel, this);
523
524
525 m_sizer_scrollable_region->Add(m_panel_image, 0, wxALIGN_CENTER_HORIZONTAL, 0);
526 m_sizer_scrollable_region->Add(0, 0, 0, wxTOP, FromDIP(10));
527 m_sizer_scrollable_region->Add(m_sizer_basic, 0, wxALIGN_CENTER_HORIZONTAL, 0);
529 m_scrollable_region->Layout();
530
531 //file name
532 //rename normal
533 m_rename_switch_panel = new wxSimplebook(this);
534 m_rename_switch_panel->SetSize(wxSize(FromDIP(420), FromDIP(25)));
535 m_rename_switch_panel->SetMinSize(wxSize(FromDIP(420), FromDIP(25)));
536 m_rename_switch_panel->SetMaxSize(wxSize(FromDIP(420), FromDIP(25)));
537
538 m_rename_normal_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
539 m_rename_normal_panel->SetBackgroundColour(*wxWHITE);
540 rename_sizer_v = new wxBoxSizer(wxVERTICAL);
541 rename_sizer_h = new wxBoxSizer(wxHORIZONTAL);
542
543 m_rename_text = new wxStaticText(m_rename_normal_panel, wxID_ANY, wxT("MyLabel"), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END);
544 m_rename_text->SetForegroundColour(*wxBLACK);
546 m_rename_text->SetMaxSize(wxSize(FromDIP(390), -1));
547 m_rename_button = new Button(m_rename_normal_panel, "", "rename_edit", wxBORDER_NONE, FromDIP(13)); // ORCA Match edit icon and its size
548 m_rename_button->SetBackgroundColor(*wxWHITE);
549 m_rename_button->SetBackgroundColour(*wxWHITE);
550
551 rename_sizer_h->Add(m_rename_text, 0, wxALIGN_CENTER, 0);
552 rename_sizer_h->Add(m_rename_button, 0, wxALIGN_CENTER, 0);
553 rename_sizer_v->Add(rename_sizer_h, 1, wxALIGN_CENTER, 0);
555 m_rename_normal_panel->Layout();
557
558 //rename edit
559 auto m_rename_edit_panel = new wxPanel(m_rename_switch_panel, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
560 m_rename_edit_panel->SetBackgroundColour(*wxWHITE);
561 auto rename_edit_sizer_v = new wxBoxSizer(wxVERTICAL);
562
563 m_rename_input = new ::TextInput(m_rename_edit_panel, wxEmptyString, wxEmptyString, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
564 m_rename_input->GetTextCtrl()->SetFont(::Label::Body_13);
565 m_rename_input->SetSize(wxSize(FromDIP(380), FromDIP(24)));
566 m_rename_input->SetMinSize(wxSize(FromDIP(380), FromDIP(24)));
567 m_rename_input->SetMaxSize(wxSize(FromDIP(380), FromDIP(24)));
568 m_rename_input->Bind(wxEVT_TEXT_ENTER, [this](auto& e) {on_rename_enter();});
569 m_rename_input->Bind(wxEVT_KILL_FOCUS, [this](auto& e) {
570 if (!m_rename_input->HasFocus() && !m_rename_text->HasFocus())
572 else
573 e.Skip(); });
574 rename_edit_sizer_v->Add(m_rename_input, 1, wxALIGN_CENTER, 0);
575
576
577 m_rename_edit_panel->SetSizer(rename_edit_sizer_v);
578 m_rename_edit_panel->Layout();
579 rename_edit_sizer_v->Fit(m_rename_edit_panel);
580
581 m_rename_button->Bind(wxEVT_BUTTON, &SendToPrinterDialog::on_rename_click, this);
582 m_rename_switch_panel->AddPage(m_rename_normal_panel, wxEmptyString, true);
583 m_rename_switch_panel->AddPage(m_rename_edit_panel, wxEmptyString, false);
584
585 Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& e) {
586 if (e.GetKeyCode() == WXK_ESCAPE) {
587 if (m_rename_switch_panel->GetSelection() == 0) {
588 e.Skip();
589 }
590 else {
591 m_rename_switch_panel->SetSelection(0);
593 m_rename_normal_panel->Layout();
594 }
595 }
596 else {
597 e.Skip();
598 }
599 });
600
601 m_panel_prepare->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
602 check_fcous_state(this);
603 e.Skip();
604 });
605
606 m_scrollable_region->Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
607 check_fcous_state(this);
608 e.Skip();
609 });
610
611 Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
612 check_fcous_state(this);
613 e.Skip();
614 });
615
616 m_sizer_main->Add(m_line_top, 0, wxEXPAND, 0);
617 m_sizer_main->Add(0, 0, 0, wxTOP, FromDIP(10));
618 m_sizer_main->Add(m_scrollable_region, 0, wxALIGN_CENTER_HORIZONTAL, 0);
619 m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
620 m_sizer_main->Add(m_rename_switch_panel, 0, wxALIGN_CENTER_HORIZONTAL, 0);
621 m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(6));
622 m_sizer_main->Add(m_line_materia, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
623 m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(12));
624 m_sizer_main->Add(m_sizer_printer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
625 m_sizer_main->Add(m_storage_panel, 0, wxALIGN_CENTER_HORIZONTAL | wxTOP , FromDIP(8));
626 m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(11));
627 m_sizer_main->Add(m_statictext_printer_msg, 0, wxALIGN_CENTER_HORIZONTAL, 0);
628 m_sizer_main->Add(m_connecting_panel, 0, wxALIGN_CENTER_HORIZONTAL, 0);
629 m_sizer_main->Add(0, 1, 0, wxTOP, FromDIP(22));
630 m_sizer_main->Add(m_line_schedule, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(30));
631 m_sizer_main->Add(m_simplebook, 0, wxALIGN_CENTER_HORIZONTAL, 0);
632 m_sizer_main->Add(m_sw_print_failed_info, 0, wxALIGN_CENTER, 0);
633 m_sizer_main->Add(0, 0, 0, wxEXPAND | wxTOP, FromDIP(13));
634
635 m_last_refresh_time = wxDateTime::Now();
637 SetSizer(m_sizer_main);
638 Layout();
639 Fit();
640 Thaw();
641
642 init_bind();
643 init_timer();
644 // CenterOnParent();
645 Centre(wxBOTH);
646 wxGetApp().UpdateDlgDarkUI(this);
647}
@ Confirm
Definition Button.hpp:25
@ Choice
Definition Button.hpp:33
@ Window
Definition Button.hpp:32
#define _L(s)
Definition OBJ.cpp:34
class WXDLLIMPEXP_FWD_CORE wxStaticText
Definition ProgressDialog.hpp:30
#define SELECT_MACHINE_DIALOG_SIMBOOK_SIZE
Definition SelectMachine.hpp:130
static wxFont Body_13
Definition Label.hpp:54
static wxFont Head_14
Definition Label.hpp:45
static wxFont Body_12
Definition Label.hpp:55
const wxFont & normal_font() const
Definition GUI_Utils.hpp:205
void on_cancel(wxCloseEvent &event)
Definition SendToPrinter.cpp:867
wxPanel * m_panel_sending
Definition SendToPrinter.hpp:97
Button * m_button_ensure
Definition SendToPrinter.hpp:94
void on_refresh(wxCommandEvent &event)
Definition SendToPrinter.cpp:1112
wxPanel * m_connecting_panel
Definition SendToPrinter.hpp:106
wxPanel * m_line_top
Definition SendToPrinter.hpp:100
wxBoxSizer * m_sizer_scrollable_region
Definition SendToPrinter.hpp:123
void on_print_job_cancel(wxCommandEvent &evt)
Definition SendToPrinter.cpp:1126
wxBoxSizer * rename_sizer_v
Definition SendToPrinter.hpp:120
void check_fcous_state(wxWindow *window)
Definition SendToPrinter.cpp:172
ThumbnailPanel * m_thumbnailPanel
Definition SendToPrinter.hpp:90
std::unique_ptr< Worker > m_worker
Definition SendToPrinter.hpp:137
void show_print_failed_info(bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
Definition SendToPrinter.cpp:730
wxStaticText * m_stext_printer_title
Definition SendToPrinter.hpp:111
wxStaticText * m_stext_weight
Definition SendToPrinter.hpp:114
Button * m_button_refresh
Definition SendToPrinter.hpp:93
ComboBox * m_comboBox_printer
Definition SendToPrinter.hpp:91
wxPanel * m_panel_prepare
Definition SendToPrinter.hpp:98
wxDateTime m_last_refresh_time
Definition SendToPrinter.hpp:179
Button * m_rename_button
Definition SendToPrinter.hpp:92
wxPanel * m_storage_panel
Definition SendToPrinter.hpp:105
wxBoxSizer * m_storage_sizer
Definition SendToPrinter.hpp:104
wxPanel * m_panel_image
Definition SendToPrinter.hpp:101
wxPanel * m_rename_normal_panel
Definition SendToPrinter.hpp:102
Label * m_st_txt_error_code
Definition SendToPrinter.hpp:115
wxPanel * m_scrollable_region
Definition SendToPrinter.hpp:95
void on_ok(wxCommandEvent &event)
Definition SendToPrinter.cpp:880
wxString m_current_project_name
Definition SendToPrinter.hpp:85
wxPanel * m_panel_finish
Definition SendToPrinter.hpp:99
HyperLink * m_link_network_state
Definition SendToPrinter.hpp:118
wxBoxSizer * sizer_thumbnail
Definition SendToPrinter.hpp:122
Plater * m_plater
Definition SendToPrinter.hpp:89
wxColour m_colour_bold_color
Definition SendToPrinter.hpp:132
void on_selection_changed(wxCommandEvent &event)
Definition SendToPrinter.cpp:1250
wxPanel * m_line_materia
Definition SendToPrinter.hpp:103
wxColour m_colour_def_color
Definition SendToPrinter.hpp:131
wxPanel * m_line_schedule
Definition SendToPrinter.hpp:96
wxScrolledWindow * m_sw_print_failed_info
Definition SendToPrinter.hpp:138
void on_rename_enter()
Definition SendToPrinter.cpp:190
wxBoxSizer * m_sizer_main
Definition SendToPrinter.hpp:124
bool m_export_3mf_cancel
Definition SendToPrinter.hpp:75
wxStaticText * m_statictext_finish
Definition SendToPrinter.hpp:108
void update_printer_combobox(wxCommandEvent &event)
Definition SendToPrinter.cpp:1239
std::shared_ptr< BBLStatusBarSend > m_status_bar
Definition SendToPrinter.hpp:136
void init_bind()
Definition SendToPrinter.cpp:855
void on_rename_click(wxCommandEvent &event)
Definition SendToPrinter.cpp:181
wxSimplebook * m_rename_switch_panel
Definition SendToPrinter.hpp:88
wxStaticText * m_stext_time
Definition SendToPrinter.hpp:113
wxSimplebook * m_simplebook
Definition SendToPrinter.hpp:107
wxBoxSizer * rename_sizer_h
Definition SendToPrinter.hpp:121
Label * m_st_txt_error_desc
Definition SendToPrinter.hpp:116
Label * m_st_txt_extra_info
Definition SendToPrinter.hpp:117
wxStaticText * m_connecting_printer_msg
Definition SendToPrinter.hpp:110
void init_timer()
Definition SendToPrinter.cpp:861
wxStaticText * m_statictext_printer_msg
Definition SendToPrinter.hpp:109
wxStaticText * m_rename_text
Definition SendToPrinter.hpp:112
TextInput * m_rename_input
Definition SendToPrinter.hpp:87
AnimaIcon * m_animaicon
Definition SendToPrinter.hpp:126
static Plater * plater()
Definition GUI_Factories.cpp:400
wxBitmap create_scaled_bitmap(const std::string &bmp_name_in, wxWindow *win, const int px_cnt, const bool grayscale, const std::string &new_color, const bool menu_bitmap, const bool resize, const bool bitmap2, const std::vector< std::string > &array_new_color)
Definition wxExtensions.cpp:448

References _L, Label::Body_12, Label::Body_13, check_fcous_state(), Choice, Confirm, create_scaled_bitmap(), Label::Head_14, init_bind(), init_timer(), m_animaicon, m_button_ensure, m_button_refresh, m_colour_bold_color, m_colour_def_color, m_comboBox_printer, m_connecting_panel, m_connecting_printer_msg, m_current_project_name, m_export_3mf_cancel, m_last_refresh_time, m_line_materia, m_line_schedule, m_line_top, m_link_network_state, m_panel_finish, m_panel_image, m_panel_prepare, m_panel_sending, m_plater, m_rename_button, m_rename_input, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, m_scrollable_region, m_simplebook, m_sizer_main, m_sizer_scrollable_region, m_st_txt_error_code, m_st_txt_error_desc, m_st_txt_extra_info, m_statictext_finish, m_statictext_printer_msg, m_status_bar, m_stext_printer_title, m_stext_time, m_stext_weight, m_storage_panel, m_storage_sizer, m_sw_print_failed_info, m_thumbnailPanel, m_worker, Slic3r::GUI::DPIAware< wxDialog >::normal_font(), on_cancel(), on_ok(), on_print_job_cancel(), on_refresh(), on_rename_click(), on_rename_enter(), on_selection_changed(), Slic3r::GUI::plater(), rename_sizer_h, rename_sizer_v, SELECT_MACHINE_DIALOG_SIMBOOK_SIZE, show_print_failed_info(), sizer_thumbnail, update_printer_combobox(), Window, and wxStaticText.

Here is the call graph for this function:

◆ ~SendToPrinterDialog()

Slic3r::GUI::SendToPrinterDialog::~SendToPrinterDialog ( )
2094{
2095 delete m_refresh_timer;
2096 if (m_task_timer && m_task_timer->IsRunning())
2097 m_task_timer->Stop();
2098 if (m_url_timer && m_url_timer->IsRunning())
2099 m_url_timer->Stop();
2100}
std::unique_ptr< wxTimer > m_task_timer
Definition SendToPrinter.hpp:134
wxTimer * m_refresh_timer
Definition SendToPrinter.hpp:133
std::unique_ptr< wxTimer > m_url_timer
Definition SendToPrinter.hpp:135

References ~SendToPrinterDialog(), m_refresh_timer, m_task_timer, and m_url_timer.

Referenced by ~SendToPrinterDialog().

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

Member Function Documentation

◆ ChangeConnectMethod()

void Slic3r::GUI::SendToPrinterDialog::ChangeConnectMethod ( )
private
1864{
1865 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1866 if (!dev) return;
1867 MachineObject *obj = dev->get_my_machine(m_printer_last_select);
1868 if (!obj) return;
1869
1870 bool is_lan = (obj->connection_type() == "lan");
1871
1872 m_tcp_try_connect = false;
1873
1874 if (is_lan) {
1875 m_ftp_try_connect = true;
1876 m_tutk_try_connect = false;
1877 } else {
1878 if (m_connect_try_times == 0) {
1879 m_ftp_try_connect = false;
1880 m_tutk_try_connect = true;
1881 } else {
1882 m_ftp_try_connect = true;
1883 m_tutk_try_connect = false;
1884 }
1885 }
1887}
std::string m_printer_last_select
Definition SendToPrinter.hpp:83
bool m_tutk_try_connect
Definition SendToPrinter.hpp:78
bool m_tcp_try_connect
Definition SendToPrinter.hpp:77
bool m_ftp_try_connect
Definition SendToPrinter.hpp:79
int m_connect_try_times
Definition SendToPrinter.hpp:71

References ChangeConnectMethod(), Slic3r::MachineObject::connection_type(), Slic3r::DeviceManager::get_my_machine(), m_connect_try_times, m_ftp_try_connect, m_printer_last_select, m_tcp_try_connect, and m_tutk_try_connect.

Referenced by ChangeConnectMethod(), and OnConnection().

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

◆ check_fcous_state()

void Slic3r::GUI::SendToPrinterDialog::check_fcous_state ( wxWindow * window)
173{
174 check_focus(window);
175 auto children = window->GetChildren();
176 for (auto child : children) {
177 check_fcous_state(child);
178 }
179}
void check_focus(wxWindow *window)
Definition SendToPrinter.cpp:165

References check_fcous_state(), and check_focus().

Referenced by SendToPrinterDialog(), and check_fcous_state().

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

◆ check_focus()

void Slic3r::GUI::SendToPrinterDialog::check_focus ( wxWindow * window)
166{
167 if (window == m_rename_input || window == m_rename_input->GetTextCtrl()) {
169 }
170}

References m_rename_input, and on_rename_enter().

Referenced by check_fcous_state().

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

◆ clear_ip_address_config()

void Slic3r::GUI::SendToPrinterDialog::clear_ip_address_config ( wxCommandEvent & e)
1077{
1078 enable_prepare_mode = true;
1079 prepare_mode();
1080}
bool enable_prepare_mode
Definition SendToPrinter.hpp:74
void prepare_mode()
Definition SendToPrinter.cpp:761

References enable_prepare_mode, and prepare_mode().

Referenced by init_bind().

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

◆ CreateMediaAbilityJob()

void Slic3r::GUI::SendToPrinterDialog::CreateMediaAbilityJob ( )
private
1920{
1921 nlohmann::json media_ability = {{"cmd_type", 7}};
1922 try
1923 {
1924 m_filetransfer_mediability_job = std::make_unique<FileTransferJob>(module(), std::string(media_ability.dump()));
1925 }
1926 catch (const std::exception& e)
1927 {
1928 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": FileTransferJob unavailable: " << e.what();
1930 return;
1931 }
1932 m_filetransfer_mediability_job->on_result([this](int res, int resp_ec, std::string json_res, std::vector<std::byte> bin_res) {
1933 //this pl
1934 CallAfter([this, res, resp_ec, json_res] {
1935 if (res == 0) // 0 is success
1936 {
1938 try
1939 {
1940 auto media_set = nlohmann::json::parse(json_res);
1941 for (const auto &it : media_set)
1942 m_ability_list.push_back(it.get<std::string>());
1943
1944 BOOST_LOG_TRIVIAL(info) << "CreateMediaAbilityJob::" << "request mediaability success." << json_res;
1945 if (m_if_has_sdcard == false && m_ability_list.size() == 1)
1946 {
1948 return;
1949 }
1950 else
1951 {
1953 }
1954 }
1955 catch (const nlohmann::json::exception &e)
1956 {
1957 BOOST_LOG_TRIVIAL(error) << "CreateMediaAbilityJob::" << ": " << e.what();
1958 }
1959 catch (...)
1960 {
1961 BOOST_LOG_TRIVIAL(error) << "CreateMediaAbilityJob::" << ": " << "parse error!";
1962 }
1963 }
1964 else
1965 {
1966 BOOST_LOG_TRIVIAL(error) << "CreateMediaAbilityJob::" << ":request mediaability failed. res =" << res << "resp_ec is:" << resp_ec;
1968 update_print_status_msg(ParseErrorCode(resp_ec), false, true);
1969 }
1970 });
1971 });
1972 // Guard against a null transfer tunnel before dereferencing.
1975 } else {
1976 BOOST_LOG_TRIVIAL(info) << "CreateMediaAbilityJob: file transfer tunnel is null";
1977 }
1978}
std::vector< std::string > m_ability_list
Definition SendToPrinter.hpp:143
void update_print_status_msg(wxString msg, bool is_warning=false, bool is_printer=true)
Definition SendToPrinter.cpp:845
void show_status(PrintDialogStatus status, std::vector< wxString > params=std::vector< wxString >())
Definition SendToPrinter.cpp:1412
std::unique_ptr< FileTransferJob > m_filetransfer_mediability_job
Definition SendToPrinter.hpp:177
bool m_if_has_sdcard
Definition SendToPrinter.hpp:142
std::unique_ptr< FileTransferTunnel > m_filetransfer_tunnel
Definition SendToPrinter.hpp:176
void update_storage_list(const std::vector< std::string > &storages)
Definition SendToPrinter.cpp:662
@ PrintStatusPublicInitFailed
Definition PrePrintChecker.hpp:158
@ PrintStatusReadingFinished
Definition PrePrintChecker.hpp:148
@ PrintStatusNoSdcard
Definition PrePrintChecker.hpp:77
static wxString ParseErrorCode(int errorcde)
Definition SendToPrinter.cpp:119
FileTransferModule & module()
Definition FileTransferUtils.hpp:248

References CreateMediaAbilityJob(), m_ability_list, m_filetransfer_mediability_job, m_filetransfer_tunnel, m_if_has_sdcard, Slic3r::module(), Slic3r::GUI::ParseErrorCode(), Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusPublicInitFailed, Slic3r::GUI::PrintStatusReadingFinished, show_status(), update_print_status_msg(), and update_storage_list().

Referenced by CreateMediaAbilityJob(), and OnConnection().

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

◆ CreateUploadFileJob()

void Slic3r::GUI::SendToPrinterDialog::CreateUploadFileJob ( const std::string & path,
const std::string & name )
private
1981{
1982 nlohmann::json upload_params = {
1983 {"cmd_type", 5},
1984 };
1985 upload_params["dest_storage"] = m_selected_storage;
1986 upload_params["dest_name"] = name; // filenme no path
1987 upload_params["file_path"] = path;
1988
1989 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": Begin CreateUploadFileJob";
1990 try
1991 {
1992 m_filetransfer_uploadfile_job = std::make_unique<FileTransferJob>(module(), std::string(upload_params.dump()));
1993 }
1994 catch (const std::exception& e)
1995 {
1996 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": FileTransferJob unavailable: " << e.what();
1998 return;
1999 }
2000 m_filetransfer_uploadfile_job->on_result([this](int res, int resp_ec, std::string json_res, std::vector<std::byte> bin_res) { //
2001 CallAfter([this, res, resp_ec, json_res, bin_res] {
2002 UploadFileRessultCallback(res, resp_ec,json_res, bin_res);
2003 });
2004 });
2005
2006 m_filetransfer_uploadfile_job->on_msg([this](int kind, std::string json_res) {
2007 CallAfter([this, kind, json_res] {
2008 if (kind == 0) {
2009 try
2010 {
2011 auto js = nlohmann::json::parse(json_res);
2012 int progress = js["progress"].get<int>();
2014 }
2015 catch (const nlohmann::json::exception& e)
2016 {
2017 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": " << e.what();
2018 }
2019 catch (...)
2020 {
2021 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": " << "parse_json failed! ";
2022 }
2023 }
2024 });
2025 });
2026 // Guard against a null transfer tunnel before dereferencing.
2029 } else {
2030 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": file transfer tunnel is null";
2031 }
2032}
std::unique_ptr< FileTransferJob > m_filetransfer_uploadfile_job
Definition SendToPrinter.hpp:178
std::string m_selected_storage
Definition SendToPrinter.hpp:141
void UploadFileRessultCallback(int res, int resp_ec, std::string json_res, std::vector< std::byte > bin_res)
Definition SendToPrinter.cpp:2058
void UploadFileProgressCallback(int progress)
Definition SendToPrinter.cpp:2034
@ PrintStatusPublicUploadFiled
Definition PrePrintChecker.hpp:159

References CreateUploadFileJob(), m_filetransfer_tunnel, m_filetransfer_uploadfile_job, m_selected_storage, Slic3r::module(), Slic3r::GUI::PrintStatusPublicUploadFiled, show_status(), UploadFileProgressCallback(), and UploadFileRessultCallback().

Referenced by CreateUploadFileJob(), and on_ok().

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

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ Enable_Refresh_Button()

void Slic3r::GUI::SendToPrinterDialog::Enable_Refresh_Button ( bool en)
1400{
1401 if (!en) {
1402 if (m_button_refresh->IsEnabled()) {
1403 m_button_refresh->Disable(); // ORCA no need to set colors again
1404 }
1405 } else {
1406 if (!m_button_refresh->IsEnabled()) {
1407 m_button_refresh->Enable(); // ORCA no need to set colors again
1408 }
1409 }
1410}

References m_button_refresh.

Referenced by show_status().

Here is the caller graph for this function:

◆ Enable_Send_Button()

void Slic3r::GUI::SendToPrinterDialog::Enable_Send_Button ( bool en)
1544{
1545 if (!en) {
1546 if (m_button_ensure->IsEnabled()) {
1547 m_button_ensure->Disable();
1548 m_storage_panel->Hide();
1549 }
1550 } else {
1551 if (!m_button_ensure->IsEnabled()) {
1552 m_button_ensure->Enable();
1553 m_storage_panel->Show();
1554 }
1555 }
1556}

References m_button_ensure, and m_storage_panel.

Referenced by on_ok(), prepare_mode(), and show_status().

Here is the caller graph for this function:

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ format_text()

wxString Slic3r::GUI::SendToPrinterDialog::format_text ( wxString & m_msg)
144{
145
146 if (wxGetApp().app_config->get("language") != "zh_CN") { return m_msg; }
147
148 wxString out_txt = m_msg;
149 wxString count_txt = "";
150 int new_line_pos = 0;
151
152 for (int i = 0; i < m_msg.length(); i++) {
153 auto text_size = m_statictext_printer_msg->GetTextExtent(count_txt);
154 if (text_size.x < (FromDIP(400))) {
155 count_txt += m_msg[i];
156 }
157 else {
158 out_txt.insert(i - 1, '\n');
159 count_txt = "";
160 }
161 }
162 return out_txt;
163}

References m_statictext_printer_msg.

Referenced by update_priner_status_msg().

Here is the caller graph for this function:

◆ get_storage_selected()

std::string Slic3r::GUI::SendToPrinterDialog::get_storage_selected ( )
650{
651 if (!m_selected_storage.empty())
652 return m_selected_storage;
653
654 for (const auto& radio : m_storage_radioBox) {
655 if (radio->GetValue()) {
656 return radio->GetLabel().ToStdString();
657 }
658 }
659 return "";
660}
std::vector< RadioBox * > m_storage_radioBox
Definition SendToPrinter.hpp:140

References m_selected_storage, and m_storage_radioBox.

◆ GetConnection()

void Slic3r::GUI::SendToPrinterDialog::GetConnection ( )
1704{
1705 DeviceManager *dm = GUI::wxGetApp().getDeviceManager();
1706 MachineObject *obj = dm ? dm->get_selected_machine() : nullptr;
1707
1708 if (!obj)
1709 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " : obj is empty";
1710 if (obj && !obj->get_file_remote())
1711 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " : remote_proto is not support";
1712 if (obj && obj->is_camera_busy_off())
1713 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " : camera is busy";
1714
1715 NetworkAgent* agent = wxGetApp().getAgent();
1716
1717 if (m_url_timer && m_url_timer->IsRunning())
1718 {
1719 m_url_timer->Stop();
1720 }
1721
1722 m_url_timer.reset(new wxTimer());
1723 m_url_timer->SetOwner(this);
1724 this->Bind(
1725 wxEVT_TIMER,
1726 [this](wxTimerEvent &e) {
1727 BOOST_LOG_TRIVIAL(info) << "Timer callback triggered!";
1729 m_ftp_try_connect = true;
1731 {
1732 m_filetransfer_tunnel.reset();
1733 m_filetransfer_tunnel = nullptr;
1734 }
1735
1736 },
1737 m_url_timer->GetId());
1738 m_url_timer->StartOnce(8000);
1739
1740 if (obj && agent)
1741 {
1742 std::string dev_ver = obj->get_ota_version();
1743 std::string dev_id = obj->get_dev_id();
1744
1745 if (m_tcp_try_connect) {
1746 std::string devIP = obj->get_dev_ip();
1747 std::string accessCode = obj->get_access_code();
1748 std::string url = "bambu:///local/" + devIP + "?port=6000&user=" + "bblp" + "&passwd=" + accessCode;
1749 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": Connect method tcp, dev_id=" << dev_id
1750 << ", dev_ip=" << devIP << ", access_code_len=" << accessCode.size();
1751
1752 try
1753 {
1754 m_filetransfer_tunnel = std::make_unique<FileTransferTunnel>(module(), url);
1755 m_filetransfer_tunnel->on_connection([this](bool is_success, int err_code, std::string error_msg)
1756 {
1757 CallAfter([this, is_success, err_code, error_msg]()
1758 {
1759 OnConnection(is_success, err_code, error_msg);
1760 });
1761 });
1762 m_filetransfer_tunnel->start_connect();
1763 }
1764 catch (const std::exception& e)
1765 {
1766 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": tcp FileTransferTunnel unavailable for dev_id=" <<
1767 dev_id
1768 << " dev_ip=" << devIP << ": " << e.what();
1769 if (m_url_timer && m_url_timer->IsRunning()) m_url_timer->Stop();
1770 m_filetransfer_tunnel.reset();
1773 }
1774 }
1775 else if (m_tutk_try_connect)
1776 {
1777 std::string protocols[] = {"", "\"tutk\"", "\"agora\"", "\"tutk\",\"agora\""};
1778 agent->get_camera_url(obj->get_dev_id() + "|" + dev_ver + "|" + protocols[1], [this, m = dev_id, v = agent->get_version(), dv = dev_ver](std::string url) {
1779 if (boost::algorithm::starts_with(url, "bambu:///")) {
1780 url += "&device=" + m;
1781 url += "&net_ver=" + v;
1782 url += "&dev_ver=" + dv;
1783 url += "&refresh_url=" + boost::lexical_cast<std::string>(&refresh_agora_url);
1784 url += "&cli_id=" + wxGetApp().app_config->get("slicer_uuid");
1785 url += "&cli_ver=" + std::string(SLIC3R_VERSION);
1786 }
1787
1788 if (m_url_timer && m_url_timer->IsRunning())
1789 {
1790 m_url_timer->Stop();
1791 }
1792
1793 #if !BBL_RELEASE_TO_PUBLIC
1794 BOOST_LOG_TRIVIAL(info) << "SendToPrinter::camera_url: " << hide_passwd(url, {"?uid=", "authkey=", "passwd="});
1795 #endif
1796
1797
1798 if (boost::algorithm::starts_with(url, "bambu:///"))
1799 {
1800 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": Connect method tutk";
1801 try
1802 {
1803 m_filetransfer_tunnel = std::make_unique<FileTransferTunnel>(module(), url);
1804 m_filetransfer_tunnel->on_connection(
1805 [this](bool is_success, int err_code, std::string error_msg)
1806 {
1807 CallAfter([this, is_success, err_code, error_msg]()
1808 {
1809 OnConnection(is_success, err_code, error_msg);
1810 });
1811 });
1812 m_filetransfer_tunnel->start_connect();
1813 }
1814 catch (const std::exception& e)
1815 {
1816 BOOST_LOG_TRIVIAL(warning) << __FUNCTION__ << ": tutk FileTransferTunnel unavailable: " << e.
1817what();
1818 if (m_url_timer && m_url_timer->IsRunning()) m_url_timer->Stop();
1819 m_filetransfer_tunnel.reset();
1822 }
1823 }
1824 else
1825 {
1826 std::string res = "";
1827 if (!url.empty() && boost::ends_with(url, "]"))
1828 {
1829 size_t n = url.find_last_of('[');
1830 if (n != std::string::npos)
1831 res = url.substr(n + 1, url.length() - n - 2);
1832 }
1833 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << " : Tutk url error: ress = " << res;
1834 }
1835 }, wxGetApp().get_printer_cloud_provider());
1836 }
1837 }
1838}
void OnConnection(bool is_success, int error_code, std::string error_msg)
Definition SendToPrinter.cpp:1840
ConnectionStatus m_connection_status
Definition SendToPrinter.hpp:174
wxString hide_passwd(wxString url, std::vector< wxString > const &passwords)
Definition MediaPlayCtrl.cpp:351

References CONNECTION_FAILED, Slic3r::MachineObject::get_access_code(), Slic3r::NetworkAgent::get_camera_url(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_dev_ip(), Slic3r::MachineObject::get_file_remote(), Slic3r::MachineObject::get_ota_version(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::NetworkAgent::get_version(), Slic3r::GUI::hide_passwd(), Slic3r::MachineObject::is_camera_busy_off(), m_connection_status, m_filetransfer_tunnel, m_ftp_try_connect, m_tcp_try_connect, m_tutk_try_connect, m_url_timer, Slic3r::module(), OnConnection(), Slic3r::GUI::PrintStatusPublicInitFailed, and show_status().

Referenced by OnConnection(), and update_show_status().

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

◆ init_bind()

void Slic3r::GUI::SendToPrinterDialog::init_bind ( )
private
856{
857 Bind(wxEVT_TIMER, &SendToPrinterDialog::on_timer, this);
858 Bind(EVT_CLEAR_IPADDRESS, &SendToPrinterDialog::clear_ip_address_config, this);
859}
void on_timer(wxTimerEvent &event)
Definition SendToPrinter.cpp:1245
void clear_ip_address_config(wxCommandEvent &e)
Definition SendToPrinter.cpp:1076

References clear_ip_address_config(), and on_timer().

Referenced by SendToPrinterDialog().

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

◆ init_timer()

void Slic3r::GUI::SendToPrinterDialog::init_timer ( )
private
862{
863 m_refresh_timer = new wxTimer();
864 m_refresh_timer->SetOwner(this);
865}

References m_refresh_timer.

Referenced by SendToPrinterDialog().

Here is the caller graph for this function:

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ is_timeout()

bool Slic3r::GUI::SendToPrinterDialog::is_timeout ( )
1146{
1147 if (timeout_count > 15 * 1000 / LIST_REFRESH_INTERVAL) {
1148 return true;
1149 }
1150 return false;
1151}
#define LIST_REFRESH_INTERVAL
Definition CalibrationPanel.cpp:46
int timeout_count
Definition SendToPrinter.hpp:70

References LIST_REFRESH_INTERVAL, and timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ normal_font()

◆ on_cancel()

void Slic3r::GUI::SendToPrinterDialog::on_cancel ( wxCloseEvent & event)
868{
869 m_worker->cancel_all();
870
871 if (m_task_timer && m_task_timer->IsRunning()) {
872 m_task_timer->Stop();
873 m_task_timer.reset();
874 }
875
876 Reset();
877 this->EndModal(wxID_CANCEL);
878}
void EndModal(int retCode) override
Definition GUI_Utils.hpp:305
void Reset()
Definition SendToPrinter.cpp:2083

References Slic3r::GUI::DPIDialog::EndModal(), m_task_timer, m_worker, and Reset().

Referenced by SendToPrinterDialog().

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

◆ on_change_color_mode()

void Slic3r::GUI::SendToPrinterDialog::on_change_color_mode ( )
inline
216{ wxGetApp().UpdateDlgDarkUI(this); }

◆ on_dpi_changed()

void Slic3r::GUI::SendToPrinterDialog::on_dpi_changed ( const wxRect & suggested_rect)
overridevirtual

Implements Slic3r::GUI::DPIAware< wxDialog >.

1559{
1560 m_button_refresh->Rescale(); // ORCA
1561 m_button_ensure->Rescale(); // ORCA
1562 m_status_bar->msw_rescale();
1563 Fit();
1564 Refresh();
1565}

References m_button_ensure, m_button_refresh, and m_status_bar.

◆ on_ok()

void Slic3r::GUI::SendToPrinterDialog::on_ok ( wxCommandEvent & event)
881{
882 BOOST_LOG_TRIVIAL(info) << "print_job: on_ok to send !";
883 m_is_canceled = false;
884 Enable_Send_Button(false);
886 return;
887
888 int result = 0;
889 if (m_printer_last_select.empty()) {
890 return;
891 }
892
893 DeviceManager *dev = Slic3r::GUI::wxGetApp().getDeviceManager();
894 if (!dev) return;
895
896 MachineObject *obj_ = dev->get_selected_machine();
897
898 if (obj_ == nullptr) {
900 m_comboBox_printer->SetTextLabel("");
901 return;
902 }
903 assert(obj_->get_dev_id() == m_printer_last_select);
904
905 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ", print_job: for send task, current printer id = " << m_printer_last_select << std::endl;
907
908 m_status_bar->reset();
909 m_status_bar->set_prog_block();
910 m_status_bar->set_cancel_callback_fina([this]() {
911 BOOST_LOG_TRIVIAL(info) << "print_job: enter canceled";
912 m_worker->cancel_all();
913
914 if (m_task_timer && m_task_timer->IsRunning()) {
915 m_task_timer->Stop();
916 m_task_timer.reset();
917 }
918
923 }
924
925 m_is_canceled = true;
926 wxCommandEvent* event = new wxCommandEvent(EVT_PRINT_JOB_CANCEL);
927 wxQueueEvent(this, event);
928 });
929
930 if (m_is_canceled) {
931 BOOST_LOG_TRIVIAL(info) << "send_job: m_is_canceled";
932 //m_status_bar->set_status_text(task_canceled_text);
933 return;
934 }
935
936 // enter sending mode
937 sending_mode();
938
939 if (wxGetApp().plater()->using_exported_file()) {
940 m_plater->set_print_job_plate_idx(m_print_plate_idx);
941 result = 0;
942 }
943 else {
944 result = m_plater->send_gcode(m_print_plate_idx, [this](int export_stage, int current, int total, bool &cancel) {
945 if (this->m_is_canceled) return;
946 bool cancelled = false;
947 wxString msg = _L("Preparing print job");
948 m_status_bar->update_status(msg, cancelled, 10, true);
949 m_export_3mf_cancel = cancel = cancelled;
950 });
951 }
952
954 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": send progress 10";
955 BOOST_LOG_TRIVIAL(info) << "send_job: m_export_3mf_cancel or m_is_canceled";
956 //m_status_bar->set_status_text(task_canceled_text);
957 return;
958 }
959
960 if (result < 0) {
961 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": Abnormal print file data. Please slice again";
962 wxString msg = _L("Abnormal print file data. Please slice again");
963 m_status_bar->set_status_text(msg);
964 return;
965 }
966
967 // export config 3mf if needed
968 if(!wxGetApp().plater()->using_exported_file() && !obj_->is_lan_mode_printer()) {
969 result = m_plater->export_config_3mf(m_print_plate_idx);
970 if (result < 0) {
971 BOOST_LOG_TRIVIAL(info) << "export_config_3mf failed, result = " << result;
972 return;
973 }
974 }
975
976
978 BOOST_LOG_TRIVIAL(info) << "send_job: m_export_3mf_cancel or m_is_canceled";
979 //m_status_bar->set_status_text(task_canceled_text);
980 return;
981 }
982
983 /* std::string file_name = "";
984 auto default_output_file = wxGetApp().plater()->get_export_gcode_filename(".3mf");
985 if (!default_output_file.empty()) {
986 fs::path default_output_file_path = boost::filesystem::path(default_output_file.c_str());
987 file_name = default_output_file_path.filename().string();
988 }*/
989
990 if (obj_->is_support_brtc && (m_tcp_try_connect || m_tutk_try_connect))
991 {
992 update_print_status_msg(wxEmptyString, false, false);
993
994 PrintPrepareData print_data;
995
996 m_plater->get_print_job_data(&print_data);
997 std::string project_name = m_current_project_name.utf8_string() + ".gcode.3mf";
998
999 std::string _3mf_path;
1000 if (wxGetApp().plater()->using_exported_file())
1001 _3mf_path = wxGetApp().plater()->get_3mf_filename();
1002 else
1003 _3mf_path = print_data._3mf_path.string();
1004
1005 CreateUploadFileJob(_3mf_path, project_name);
1006
1007 // time out
1008 if (m_task_timer && m_task_timer->IsRunning()) m_task_timer->Stop();
1009
1010 m_task_timer.reset(new wxTimer());
1011 m_task_timer->SetOwner(this);
1012
1013 this->Bind(wxEVT_TIMER, [this](auto e){
1016 update_print_status_msg(_L("Upload file timeout, please check if the firmware version supports it."), false, true);
1017 },m_task_timer->GetId());
1018 m_task_timer->StartOnce(timeout_period);
1019 }
1020 else
1021 {
1022 auto m_send_job = std::make_unique<SendJob>(m_printer_last_select);
1023 m_send_job->m_dev_ip = obj_->get_dev_ip();
1024 m_send_job->m_access_code = obj_->get_access_code();
1025
1026
1027 BOOST_LOG_TRIVIAL(info) << "send_job: use ftp send job";
1028
1029
1030#if !BBL_RELEASE_TO_PUBLIC
1031 m_send_job->m_local_use_ssl_for_ftp = wxGetApp().app_config->get("enable_ssl_for_ftp") == "true" ? true : false;
1032 m_send_job->m_local_use_ssl = wxGetApp().app_config->get("enable_ssl_for_mqtt") == "true" ? true : false;
1033#else
1034 m_send_job->m_local_use_ssl_for_ftp = obj_->local_use_ssl_for_ftp;
1035 m_send_job->m_local_use_ssl = obj_->local_use_ssl;
1036
1037#endif
1038 m_send_job->connection_type = obj_->connection_type();
1039 m_send_job->cloud_print_only = true;
1040 m_send_job->sdcard_state = obj_->GetStorage()->get_sdcard_state();
1041 m_send_job->has_sdcard = wxGetApp().app_config->get("allow_abnormal_storage") == "true"
1042 ? (m_send_job->sdcard_state == DevStorage::SdcardState::HAS_SDCARD_NORMAL
1043 || m_send_job->sdcard_state == DevStorage::SdcardState::HAS_SDCARD_ABNORMAL)
1044 : m_send_job->sdcard_state == DevStorage::SdcardState::HAS_SDCARD_NORMAL;
1045 m_send_job->set_project_name(m_current_project_name.utf8_string());
1046
1047 enable_prepare_mode = false;
1048
1049 m_send_job->on_check_ip_address_fail([this, token = std::weak_ptr(m_token)](int result) {
1050 CallAfter([token, this] {
1051 if (token.expired()) { return; }
1052 SendFailedConfirm sfcDlg;
1053 auto res = sfcDlg.ShowModal();
1054 m_status_bar->cancel();
1055
1056 if (res == wxYES) {
1057 wxQueueEvent(m_button_ensure, new wxCommandEvent(wxEVT_BUTTON));
1058 } else if (res == wxAPPLY) {
1059 wxCommandEvent *evt = new wxCommandEvent(EVT_CLEAR_IPADDRESS);
1060 wxQueueEvent(this, evt);
1061 wxGetApp().show_ip_address_enter_dialog();
1062 }
1063 });
1064 });
1065
1066 if (obj_->is_lan_mode_printer()) {
1067 m_send_job->set_check_mode();
1068 m_send_job->check_and_continue();
1069 }
1070 replace_job(*m_worker, std::move(m_send_job));
1071 }
1072
1073 BOOST_LOG_TRIVIAL(info) << "send_job: send print job";
1074}
@ HAS_SDCARD_NORMAL
Definition DevStorage.h:19
@ HAS_SDCARD_ABNORMAL
Definition DevStorage.h:20
void Enable_Send_Button(bool en)
Definition SendToPrinter.cpp:1543
void sending_mode()
Definition SendToPrinter.cpp:778
bool m_is_in_sending_mode
Definition SendToPrinter.hpp:72
std::shared_ptr< int > m_token
Definition SendToPrinter.hpp:139
bool m_is_canceled
Definition SendToPrinter.hpp:76
int m_print_plate_idx
Definition SendToPrinter.hpp:68
void CreateUploadFileJob(const std::string &path, const std::string &name)
Definition SendToPrinter.cpp:1980
@ PrintStatusSending
Definition PrePrintChecker.hpp:75
constexpr int timeout_period
Definition SendToPrinter.cpp:94
bool replace_job(Worker &w, Args &&...args)
Definition Worker.hpp:99

References Slic3r::GUI::PrintPrepareData::_3mf_path, _L, Slic3r::MachineObject::connection_type(), CreateUploadFileJob(), enable_prepare_mode, Enable_Send_Button(), Slic3r::MachineObject::get_access_code(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_dev_ip(), Slic3r::DevStorage::get_sdcard_state(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::MachineObject::GetStorage(), Slic3r::DevStorage::HAS_SDCARD_ABNORMAL, Slic3r::DevStorage::HAS_SDCARD_NORMAL, Slic3r::MachineObject::is_lan_mode_printer(), Slic3r::MachineObject::is_support_brtc, Slic3r::MachineObject::local_use_ssl, Slic3r::MachineObject::local_use_ssl_for_ftp, m_button_ensure, m_comboBox_printer, m_current_project_name, m_export_3mf_cancel, m_filetransfer_uploadfile_job, m_is_canceled, m_is_in_sending_mode, m_plater, m_print_plate_idx, m_printer_last_select, m_status_bar, m_task_timer, m_tcp_try_connect, m_token, m_tutk_try_connect, m_worker, Slic3r::GUI::plater(), Slic3r::GUI::PrintStatusPublicUploadFiled, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::replace_job(), sending_mode(), show_status(), Slic3r::GUI::DPIAware< P >::ShowModal(), Slic3r::GUI::timeout_period, and update_print_status_msg().

Referenced by SendToPrinterDialog().

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

◆ on_print_job_cancel()

void Slic3r::GUI::SendToPrinterDialog::on_print_job_cancel ( wxCommandEvent & evt)
1127{
1128 BOOST_LOG_TRIVIAL(info) << "print_job: canceled";
1130 // enter prepare mode
1131 prepare_mode();
1132}
@ PrintStatusSendingCanceled
Definition PrePrintChecker.hpp:149

References prepare_mode(), Slic3r::GUI::PrintStatusSendingCanceled, and show_status().

Referenced by SendToPrinterDialog().

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

◆ on_refresh()

void Slic3r::GUI::SendToPrinterDialog::on_refresh ( wxCommandEvent & event)
1113{
1114 wxDateTime now = wxDateTime::Now();
1115 wxTimeSpan elapsed = now - m_last_refresh_time;
1116
1117 if (elapsed.GetMilliseconds() < 500) return;
1118
1119 m_last_refresh_time = now;
1120
1121 BOOST_LOG_TRIVIAL(info) << "m_printer_last_select: on_refresh";
1124}
void update_user_machine_list()
Definition SendToPrinter.cpp:1082
@ PrintStatusRefreshingMachineList
Definition PrePrintChecker.hpp:74

References m_last_refresh_time, Slic3r::GUI::PrintStatusRefreshingMachineList, show_status(), and update_user_machine_list().

Referenced by SendToPrinterDialog().

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

◆ on_rename_click()

void Slic3r::GUI::SendToPrinterDialog::on_rename_click ( wxCommandEvent & event)
182{
183 m_is_rename_mode = true;
184 m_rename_input->GetTextCtrl()->SetValue(m_current_project_name);
185 m_rename_switch_panel->SetSelection(1);
186 m_rename_input->GetTextCtrl()->SetFocus();
187 m_rename_input->GetTextCtrl()->SetInsertionPointEnd();
188}
bool m_is_rename_mode
Definition SendToPrinter.hpp:73

References m_current_project_name, m_is_rename_mode, m_rename_input, and m_rename_switch_panel.

Referenced by SendToPrinterDialog().

Here is the caller graph for this function:

◆ on_rename_enter()

void Slic3r::GUI::SendToPrinterDialog::on_rename_enter ( )
191{
192 if (m_is_rename_mode == false) {
193 return;
194 }
195 else {
196 m_is_rename_mode = false;
197 }
198
199 auto new_file_name = m_rename_input->GetTextCtrl()->GetValue();
200
201 wxString temp;
202 int num = 0;
203 for (auto t : new_file_name) {
204 if (t == wxString::FromUTF8("\x20")) {
205 num++;
206 if (num == 1) temp += t;
207 } else {
208 num = 0;
209 temp += t;
210 }
211 }
212 new_file_name = temp;
213
214 auto m_valid_type = Valid;
215 wxString info_line;
216
217 const char* unusable_symbols = "<>[]:/\\|?*\"";
218
219 const std::string unusable_suffix = PresetCollection::get_suffix_modified(); //"(modified)";
220 for (size_t i = 0; i < std::strlen(unusable_symbols); i++) {
221 if (new_file_name.find_first_of(unusable_symbols[i]) != std::string::npos) {
222 info_line = _L("Name is invalid;") + "\n" + _L("illegal characters:") + " " + unusable_symbols;
223 m_valid_type = NoValid;
224 break;
225 }
226 }
227
228 if (m_valid_type == Valid && new_file_name.find(unusable_suffix) != std::string::npos) {
229 info_line = _L("Name is invalid;") + "\n" + _L("illegal suffix:") + "\n\t" + from_u8(PresetCollection::get_suffix_modified());
230 m_valid_type = NoValid;
231 }
232
233 if (m_valid_type == Valid && new_file_name.empty()) {
234 info_line = _L("The name field is not allowed to be empty.");
235 m_valid_type = NoValid;
236 }
237
238 if (m_valid_type == Valid && new_file_name.find_first_of(' ') == 0) {
239 info_line = _L("The name is not allowed to start with a space.");
240 m_valid_type = NoValid;
241 }
242
243 if (m_valid_type == Valid && new_file_name.find_last_of(' ') == new_file_name.length() - 1) {
244 info_line = _L("The name is not allowed to end with a space.");
245 m_valid_type = NoValid;
246 }
247
248 if (m_valid_type == Valid && new_file_name.size() >= 100) {
249 info_line = _L("The name length exceeds the limit.");
250 m_valid_type = NoValid;
251 }
252
253 if (m_valid_type != Valid) {
254 MessageDialog msg_wingow(nullptr, info_line, "", wxICON_WARNING | wxOK);
255 if (msg_wingow.ShowModal() == wxID_OK) {
256 m_rename_switch_panel->SetSelection(0);
258 m_rename_normal_panel->Layout();
259 return;
260 }
261 }
262
263 m_current_project_name = new_file_name;
264 m_rename_switch_panel->SetSelection(0);
266 m_rename_normal_panel->Layout();
267}
@ NoValid
Definition Auxiliary.hpp:87
@ Valid
Definition Auxiliary.hpp:87
static const std::string & get_suffix_modified()
Definition Preset.cpp:3766
wxString from_u8(const std::string &str)
Definition GUI.cpp:544

References _L, Slic3r::GUI::from_u8(), Slic3r::PresetCollection::get_suffix_modified(), m_current_project_name, m_is_rename_mode, m_rename_input, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, NoValid, Slic3r::GUI::DPIAware< P >::ShowModal(), and Valid.

Referenced by SendToPrinterDialog(), and check_focus().

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

◆ on_selection_changed()

void Slic3r::GUI::SendToPrinterDialog::on_selection_changed ( wxCommandEvent & event)
1251{
1252 /* reset timeout and reading printer info */
1253 //m_status_bar->reset();
1254 timeout_count = 0;
1255
1256 auto selection = m_comboBox_printer->GetSelection();
1257 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1258 if (!dev) return;
1259
1260 Reset();
1261
1262 MachineObject* obj = nullptr;
1263 for (int i = 0; i < m_list.size(); i++) {
1264 if (i == selection) {
1265 m_printer_last_select = m_list[i]->get_dev_id();
1266 obj = m_list[i];
1267 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "for send task, current printer id = " << m_printer_last_select << std::endl;
1268 break;
1269 }
1270 }
1271
1272 if (obj && !obj->get_lan_mode_connection_state()) {
1273 obj->command_get_version();
1274 obj->command_request_push_all();
1275 if (!dev->get_selected_machine()) {
1276 dev->set_selected_machine(m_printer_last_select);
1277
1278 }else if (dev->get_selected_machine()->get_dev_id() != m_printer_last_select) {
1279 update_storage_list(std::vector<std::string>());
1280 dev->set_selected_machine(m_printer_last_select);
1281 }
1282 }
1283 else {
1284 BOOST_LOG_TRIVIAL(error) << "on_selection_changed dev_id not found";
1285 return;
1286 }
1287
1289}
std::vector< MachineObject * > m_list
Definition SendToPrinter.hpp:130
void update_show_status()
Definition SendToPrinter.cpp:1291

References Slic3r::MachineObject::command_get_version(), Slic3r::MachineObject::command_request_push_all(), Slic3r::MachineObject::get_dev_id(), Slic3r::MachineObject::get_lan_mode_connection_state(), Slic3r::DeviceManager::get_selected_machine(), m_comboBox_printer, m_list, m_printer_last_select, Reset(), Slic3r::DeviceManager::set_selected_machine(), timeout_count, update_show_status(), and update_storage_list().

Referenced by SendToPrinterDialog().

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

◆ on_sys_color_changed()

◆ on_timer()

void Slic3r::GUI::SendToPrinterDialog::on_timer ( wxTimerEvent & event)
1246{
1248}

References update_show_status().

Referenced by init_bind().

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

◆ OnConnection()

void Slic3r::GUI::SendToPrinterDialog::OnConnection ( bool is_success,
int error_code,
std::string error_msg )
private
1840 {
1841 if (is_success)
1842 {
1843 if (m_url_timer && m_url_timer->IsRunning()) { m_url_timer->Stop(); }
1844 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "Connect success";
1847 }
1848 else
1849 {
1850 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << "Connect failed, error_code is:" << error_code << "error_msg is :" << error_msg;
1855 return;
1856 }
1857 m_filetransfer_tunnel.reset();
1858 m_filetransfer_tunnel = nullptr;
1859 GetConnection();
1860 }
1861}
void ChangeConnectMethod()
Definition SendToPrinter.cpp:1863
void GetConnection()
Definition SendToPrinter.cpp:1703
void CreateMediaAbilityJob()
Definition SendToPrinter.cpp:1919

References ChangeConnectMethod(), CONNECTED, CONNECTION_FAILED, CreateMediaAbilityJob(), GetConnection(), m_connection_status, m_filetransfer_tunnel, m_tcp_try_connect, m_tutk_try_connect, m_url_timer, OnConnection(), Slic3r::GUI::PrintStatusPublicInitFailed, and show_status().

Referenced by GetConnection(), and OnConnection().

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

◆ prepare()

void Slic3r::GUI::SendToPrinterDialog::prepare ( int print_plate_idx)
790{
791 m_print_plate_idx = print_plate_idx;
792}

References m_print_plate_idx.

◆ prepare_mode()

void Slic3r::GUI::SendToPrinterDialog::prepare_mode ( )
762{
763 m_is_in_sending_mode = false;
764 m_comboBox_printer->Enable();
765 m_worker->wait_for_idle();
766
767 if (wxIsBusy())
768 wxEndBusyCursor();
769 Enable_Send_Button(true);
771
772 m_status_bar->reset();
773 if (m_simplebook->GetSelection() != 0) {
774 m_simplebook->SetSelection(0);
775 }
776}

References Enable_Send_Button(), m_comboBox_printer, m_is_in_sending_mode, m_simplebook, m_status_bar, m_worker, and show_print_failed_info().

Referenced by clear_ip_address_config(), on_print_job_cancel(), set_default(), and show_status().

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

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ Reset()

void Slic3r::GUI::SendToPrinterDialog::Reset ( )
private
2083 {
2084 if (m_url_timer && m_url_timer->IsRunning()) { m_url_timer->Stop(); }
2085 m_ability_list.clear();
2086 update_storage_list(std::vector<std::string>());
2087 m_device_select.clear();
2090
2091}
void ResetTunnelAndJob()
Definition SendToPrinter.cpp:1898
std::string m_device_select
Definition SendToPrinter.hpp:84
void ResetConnectMethod()
Definition SendToPrinter.cpp:1889

References m_ability_list, m_device_select, m_url_timer, Reset(), ResetConnectMethod(), ResetTunnelAndJob(), and update_storage_list().

Referenced by on_cancel(), on_selection_changed(), Reset(), and Show().

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

◆ reset_timeout()

void Slic3r::GUI::SendToPrinterDialog::reset_timeout ( )
1154{
1155 timeout_count = 0;
1156}

References timeout_count.

Referenced by update_show_status().

Here is the caller graph for this function:

◆ ResetConnectMethod()

void Slic3r::GUI::SendToPrinterDialog::ResetConnectMethod ( )
private
1890{
1891 m_tcp_try_connect = true;
1892 m_ftp_try_connect = false;
1893 m_tutk_try_connect = false;
1895}

References m_connect_try_times, m_ftp_try_connect, m_tcp_try_connect, m_tutk_try_connect, and ResetConnectMethod().

Referenced by Reset(), and ResetConnectMethod().

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

◆ ResetTunnelAndJob()

void Slic3r::GUI::SendToPrinterDialog::ResetTunnelAndJob ( )
private
1899{
1901 {
1905 }
1907 {
1911 }
1913 {
1914 m_filetransfer_tunnel.reset();
1915 m_filetransfer_tunnel = nullptr;
1916 }
1917}

References m_filetransfer_mediability_job, m_filetransfer_tunnel, m_filetransfer_uploadfile_job, and ResetTunnelAndJob().

Referenced by Reset(), and ResetTunnelAndJob().

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

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ sending_mode()

void Slic3r::GUI::SendToPrinterDialog::sending_mode ( )
779{
781 m_comboBox_printer->Disable();
782 if (m_simplebook->GetSelection() != 1){
783 m_simplebook->SetSelection(1);
784 Layout();
785 Fit();
786 }
787}

References m_comboBox_printer, m_is_in_sending_mode, and m_simplebook.

Referenced by on_ok(), and show_status().

Here is the caller graph for this function:

◆ set_default()

void Slic3r::GUI::SendToPrinterDialog::set_default ( )
1568{
1569 //project name
1570 m_rename_switch_panel->SetSelection(0);
1571
1572 wxString filename = m_plater->get_export_gcode_filename("", true, m_print_plate_idx == PLATE_ALL_IDX ? true : false);
1573
1574 if (m_print_plate_idx == PLATE_ALL_IDX && filename.empty()) {
1575 filename = _L("Untitled");
1576 }
1577
1578 if (filename.empty()) {
1579 filename = m_plater->get_export_gcode_filename("", true);
1580 if (filename.empty()) filename = _L("Untitled");
1581 }
1582
1583 fs::path filename_path(filename.c_str());
1584 m_current_project_name = from_path(filename_path.filename());
1585
1586 //unsupported character filter
1587 m_current_project_name = from_u8(filter_characters(m_current_project_name.ToUTF8().data(), "<>[]:/\\|?*\""));
1588
1590 m_rename_normal_panel->Layout();
1591
1592 enable_prepare_mode = true;
1593 prepare_mode();
1594
1595 //clear combobox
1596 m_list.clear();
1597 m_comboBox_printer->Clear();
1599 m_print_info = "";
1600 m_comboBox_printer->SetValue(wxEmptyString);
1601 m_comboBox_printer->Enable();
1602 // rset status bar
1603 m_status_bar->reset();
1604
1605 NetworkAgent* agent = wxGetApp().getAgent();
1606 if (agent) {
1607 if (agent->is_user_login(wxGetApp().get_printer_cloud_provider())) {
1609 }
1610 }
1611
1612 // thumbmail
1613 //wxBitmap bitmap;
1614 ThumbnailData &data = m_plater->get_partplate_list().get_curr_plate()->thumbnail_data;
1615 if (data.is_valid()) {
1616 wxImage image(data.width, data.height);
1617 image.InitAlpha();
1618 for (unsigned int r = 0; r < data.height; ++r) {
1619 unsigned int rr = (data.height - 1 - r) * data.width;
1620 for (unsigned int c = 0; c < data.width; ++c) {
1621 unsigned char *px = (unsigned char *) data.pixels.data() + 4 * (rr + c);
1622 image.SetRGB((int) c, (int) r, px[0], px[1], px[2]);
1623 image.SetAlpha((int) c, (int) r, px[3]);
1624 }
1625 }
1626 image = image.Rescale(FromDIP(256), FromDIP(256));
1627 m_thumbnailPanel->set_thumbnail(image);
1628 } else {
1629 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << " : thumbnail_data invalid." << "current plater: " << m_plater->get_partplate_list().get_curr_plate_index();
1630 }
1631
1632 std::vector<std::string> materials;
1633 std::vector<std::string> display_materials;
1634 {
1635 auto preset_bundle = wxGetApp().preset_bundle;
1636 for (auto filament_name : preset_bundle->filament_presets) {
1637 for (auto iter = preset_bundle->filaments.lbegin(); iter != preset_bundle->filaments.end(); iter++) {
1638 if (filament_name.compare(iter->name) == 0) {
1639 std::string display_filament_type;
1640 std::string filament_type = iter->config.get_filament_type(display_filament_type);
1641 display_materials.push_back(display_filament_type);
1642 materials.push_back(filament_type);
1643 }
1644 }
1645 }
1646 }
1647
1648 m_scrollable_region->Layout();
1649 m_scrollable_region->Fit();
1650 Layout();
1651 Fit();
1652
1653
1654 wxSize screenSize = wxGetDisplaySize();
1655 auto dialogSize = this->GetSize();
1656
1657
1658 // basic info
1659 auto aprint_stats = m_plater->get_partplate_list().get_current_fff_print().print_statistics();
1660 wxString time;
1661 PartPlate *plate = m_plater->get_partplate_list().get_curr_plate();
1662 if (plate) {
1663 if (plate->get_slice_result()) { time = wxString::Format("%s", short_time(get_time_dhms(plate->get_slice_result()->print_statistics.modes[0].time))); }
1664 }
1665
1666 char weight[64];
1667 if (wxGetApp().app_config->get("use_inches") == "1") {
1668 ::sprintf(weight, "%.2f oz", aprint_stats.total_weight*0.035274); // ORCA remove spacing before text
1669 }else{
1670 ::sprintf(weight, "%.2f g", aprint_stats.total_weight); // ORCA remove spacing before text
1671 }
1672
1673 m_stext_time->SetLabel(time);
1674 m_stext_weight->SetLabel(weight);
1675}
#define PLATE_ALL_IDX
Definition PartPlate.hpp:57
std::string m_print_info
Definition SendToPrinter.hpp:82
wxString from_path(const boost::filesystem::path &path)
Definition GUI.cpp:555
@ PrintStatusInit
Definition PrePrintChecker.hpp:56
int64_t px(const Point &pt)
Definition ClipperUtils.cpp:207
std::string filter_characters(const std::string &str, const std::string &filterChars)
Definition Utils.hpp:768
std::string short_time(const std::string &time)
Definition Utils.hpp:563
zaa_minimize_perimeter_height filament_type((ConfigOptionBools, filament_soluble))((ConfigOptionStrings
std::string get_time_dhms(float time_in_secs)
Definition Utils.hpp:609

References _L, enable_prepare_mode, Slic3r::filament_type(), Slic3r::filter_characters(), Slic3r::GUI::from_path(), Slic3r::GUI::from_u8(), Slic3r::GUI::PartPlate::get_slice_result(), Slic3r::get_time_dhms(), Slic3r::ThumbnailData::height, Slic3r::NetworkAgent::is_user_login(), Slic3r::ThumbnailData::is_valid(), m_comboBox_printer, m_current_project_name, m_list, m_plater, m_print_info, m_print_plate_idx, m_printer_last_select, m_rename_normal_panel, m_rename_switch_panel, m_rename_text, m_scrollable_region, m_status_bar, m_stext_time, m_stext_weight, m_thumbnailPanel, Slic3r::PrintEstimatedStatistics::modes, Slic3r::ThumbnailData::pixels, PLATE_ALL_IDX, prepare_mode(), Slic3r::GCodeProcessorResult::print_statistics, Slic3r::GUI::PrintStatusInit, Slic3r::short_time(), show_status(), and Slic3r::ThumbnailData::width.

Referenced by Show().

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

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ Show()

bool Slic3r::GUI::SendToPrinterDialog::Show ( bool show)
override
1678{
1680
1681 // set default value when show this dialog
1682 if (show) {
1683 update_storage_list(std::vector<std::string>());
1684 set_default();
1686 Reset();
1688
1689 } else {
1690 m_refresh_timer->Stop();
1691 }
1692
1693 Layout();
1694 Fit();
1695 if (show) { CenterOnParent(); }
1696
1697 return DPIDialog::Show(show);
1698}
void set_default()
Definition SendToPrinter.cpp:1567

References LIST_REFRESH_INTERVAL, m_refresh_timer, Slic3r::GUI::PrintStatusInit, Reset(), set_default(), show_status(), update_storage_list(), and update_user_machine_list().

Here is the call graph for this function:

◆ show_print_failed_info()

void Slic3r::GUI::SendToPrinterDialog::show_print_failed_info ( bool show,
int code = 0,
wxString description = wxEmptyString,
wxString extra = wxEmptyString )
731{
732 if (show) {
733 if (!m_sw_print_failed_info->IsShown()) {
734 m_sw_print_failed_info->Show(true);
735
736 m_st_txt_error_code->SetLabelText(wxString::Format("%d", m_print_error_code));
737 m_st_txt_error_desc->SetLabelText( wxGetApp().filter_string(m_print_error_msg));
738 m_st_txt_extra_info->SetLabelText( wxGetApp().filter_string(m_print_error_extra));
739
740 m_st_txt_error_code->Wrap(FromDIP(260));
741 m_st_txt_error_desc->Wrap(FromDIP(260));
742 m_st_txt_extra_info->Wrap(FromDIP(260));
743 }
744 else {
745 m_sw_print_failed_info->Show(false);
746 }
747 Layout();
748 Fit();
749 }
750 else {
751 if (!m_sw_print_failed_info->IsShown()) { return; }
752 m_sw_print_failed_info->Show(false);
753 m_st_txt_error_code->SetLabelText(wxEmptyString);
754 m_st_txt_error_desc->SetLabelText(wxEmptyString);
755 m_st_txt_extra_info->SetLabelText(wxEmptyString);
756 Layout();
757 Fit();
758 }
759}
std::string m_print_error_extra
Definition SendToPrinter.hpp:81
int m_print_error_code
Definition SendToPrinter.hpp:69
std::string m_print_error_msg
Definition SendToPrinter.hpp:80

References m_print_error_code, m_print_error_extra, m_print_error_msg, m_st_txt_error_code, m_st_txt_error_desc, m_st_txt_extra_info, and m_sw_print_failed_info.

Referenced by SendToPrinterDialog(), and prepare_mode().

Here is the caller graph for this function:

◆ show_status()

void Slic3r::GUI::SendToPrinterDialog::show_status ( PrintDialogStatus status,
std::vector< wxString > params = std::vector<wxString>() )
1413{
1414 if (m_print_status != status)
1415 BOOST_LOG_TRIVIAL(info) << "select_machine_dialog: show_status = " << status;
1416 else
1417 return;
1418 m_print_status = status;
1419
1420 // m_comboBox_printer
1422 m_comboBox_printer->Disable();
1423 else
1424 m_comboBox_printer->Enable();
1425
1426
1427 //connecting
1429 {
1430 m_connecting_printer_msg->SetLabel(_L("Try to connect"));
1431 update_print_status_msg(wxEmptyString, true, true);
1432 m_connecting_panel->Show();
1433 m_animaicon->Play();
1434
1435 Layout();
1436 Enable_Send_Button(false);
1437 Enable_Refresh_Button(false);
1438 return;
1439
1440 } else if (status == PrintDialogStatus::PrintStatusReconnecting) {
1441 m_connecting_printer_msg->SetLabel(_L("Connection failed. Click the icon to retry"));
1442 update_print_status_msg(wxEmptyString, true, true);
1443 m_connecting_panel->Show();
1444 m_animaicon->Stop();
1445 m_animaicon->ShowEnabledIcon();
1446
1447 Layout();
1448 Enable_Send_Button(false);
1450 return;
1451 }
1452 else {
1453 m_connecting_panel->Hide();
1454 }
1455
1456
1457 // m_panel_warn m_simplebook
1459 sending_mode();
1460 }
1461
1462 // other
1463 if (status == PrintDialogStatus::PrintStatusInit) {
1464 update_print_status_msg(wxEmptyString, false, false);
1465 Enable_Send_Button(false);
1467 } else if (status == PrintDialogStatus::PrintStatusInvalidPrinter) {
1468 update_print_status_msg(wxEmptyString, true, true);
1469 Enable_Send_Button(false);
1472 wxString msg_text = _L("Connecting to server...");
1473 update_print_status_msg(msg_text, true, true);
1474 Enable_Send_Button(true);
1476 } else if (status == PrintDialogStatus::PrintStatusReading) {
1477 wxString msg_text = _L("Synchronizing device information...");
1478 update_print_status_msg(msg_text, false, true);
1479 Enable_Send_Button(false);
1480 Enable_Refresh_Button(false);
1481 } else if (status == PrintDialogStatus::PrintStatusReadingFinished) {
1482 update_print_status_msg(wxEmptyString, false, true);
1483 Enable_Send_Button(true);
1485 } else if (status == PrintDialogStatus::PrintStatusReadingTimeout) {
1486 wxString msg_text = _L("Synchronizing device information timed out.");
1487 update_print_status_msg(msg_text, true, true);
1488 Enable_Send_Button(true);
1490 } else if (status == PrintDialogStatus::PrintStatusInUpgrading) {
1491 wxString msg_text = _L("Cannot send print tasks when an update is in progress");
1492 update_print_status_msg(msg_text, true, true);
1493 Enable_Send_Button(false);
1496 wxString msg_text = _L("The selected printer is incompatible with the chosen printer presets.");
1497 update_print_status_msg(msg_text, true, true);
1498 Enable_Send_Button(true);
1501 update_print_status_msg(wxEmptyString, false, true);
1502 Enable_Send_Button(false);
1503 Enable_Refresh_Button(false);
1504 } else if (status == PrintDialogStatus::PrintStatusSending) {
1505 Enable_Send_Button(false);
1506 Enable_Refresh_Button(false);
1507 } else if (status == PrintDialogStatus::PrintStatusSendingCanceled) {
1508 Enable_Send_Button(true);
1510 } else if (status == PrintDialogStatus::PrintStatusNoSdcard) {
1511 wxString msg_text = _L("Storage needs to be inserted before send to printer.");
1512 update_print_status_msg(msg_text, true, true);
1513 Enable_Send_Button(false);
1515 } else if (status == PrintDialogStatus::PrintStatusNotOnTheSameLAN) {
1516 wxString msg_text = _L("The printer is required to be on the same LAN as Orca Slicer.");
1517 update_print_status_msg(msg_text, true, true);
1518 Enable_Send_Button(false);
1521 wxString msg_text = _L("The printer does not support sending to printer storage.");
1522 update_print_status_msg(msg_text, true, true);
1523 Enable_Send_Button(false);
1526 wxString msg_text = _L(
1527 "Failed to initialize the printer file transfer. Please check the connection and try again.");
1528 update_print_status_msg(msg_text, true, true);
1529 Enable_Send_Button(false);
1532 prepare_mode();
1533 Enable_Send_Button(true);
1535 }
1536 else {
1537 Enable_Send_Button(true);
1539 }
1540}
void Enable_Refresh_Button(bool en)
Definition SendToPrinter.cpp:1399
PrintDialogStatus m_print_status
Definition SendToPrinter.hpp:125
@ PrintStatusReadingTimeout
Definition PrePrintChecker.hpp:60
@ PrintStatusConnecting
Definition PrePrintChecker.hpp:62
@ PrintStatusInvalidPrinter
Definition PrePrintChecker.hpp:58
@ PrintStatusUnsupportedPrinter
Definition PrePrintChecker.hpp:83
@ PrintStatusNotSupportedSendToSDCard
Definition PrePrintChecker.hpp:157
@ PrintStatusConnectingServer
Definition PrePrintChecker.hpp:59
@ PrintStatusReconnecting
Definition PrePrintChecker.hpp:63
@ PrintStatusReading
Definition PrePrintChecker.hpp:61
@ PrintStatusNotOnTheSameLAN
Definition PrePrintChecker.hpp:156
@ PrintStatusInUpgrading
Definition PrePrintChecker.hpp:64

References _L, Enable_Refresh_Button(), Enable_Send_Button(), m_animaicon, m_comboBox_printer, m_connecting_panel, m_connecting_printer_msg, m_print_status, prepare_mode(), Slic3r::GUI::PrintStatusConnecting, Slic3r::GUI::PrintStatusConnectingServer, Slic3r::GUI::PrintStatusInit, Slic3r::GUI::PrintStatusInUpgrading, Slic3r::GUI::PrintStatusInvalidPrinter, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotOnTheSameLAN, Slic3r::GUI::PrintStatusNotSupportedSendToSDCard, Slic3r::GUI::PrintStatusPublicInitFailed, Slic3r::GUI::PrintStatusPublicUploadFiled, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingFinished, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusReconnecting, Slic3r::GUI::PrintStatusRefreshingMachineList, Slic3r::GUI::PrintStatusSending, Slic3r::GUI::PrintStatusSendingCanceled, Slic3r::GUI::PrintStatusUnsupportedPrinter, sending_mode(), and update_print_status_msg().

Referenced by CreateMediaAbilityJob(), CreateUploadFileJob(), GetConnection(), on_ok(), on_print_job_cancel(), on_refresh(), OnConnection(), set_default(), Show(), update_printer_combobox(), update_show_status(), UploadFileProgressCallback(), and UploadFileRessultCallback().

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

◆ ShowModal()

◆ sort_string()

std::vector< std::string > Slic3r::GUI::SendToPrinterDialog::sort_string ( std::vector< std::string > strArray)
1135{
1136 std::vector<std::string> outputArray;
1137 std::sort(strArray.begin(), strArray.end());
1138 std::vector<std::string>::iterator st;
1139 for (st = strArray.begin(); st != strArray.end(); st++) { outputArray.push_back(*st); }
1140
1141 return outputArray;
1142}

Referenced by update_user_printer().

Here is the caller graph for this function:

◆ stripWhiteSpace()

void Slic3r::GUI::SendToPrinterDialog::stripWhiteSpace ( std::string & str)
127{
128 if (str == "") { return; }
129
130 std::string::iterator cur_it;
131 cur_it = str.begin();
132
133 while (cur_it != str.end()) {
134 if ((*cur_it) == '\n' || (*cur_it) == ' ') {
135 cur_it = str.erase(cur_it);
136 }
137 else {
138 cur_it++;
139 }
140 }
141}

Referenced by update_priner_status_msg().

Here is the caller graph for this function:

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

◆ update_priner_status_msg()

void Slic3r::GUI::SendToPrinterDialog::update_priner_status_msg ( wxString msg,
bool is_warning = false )
795{
796 auto colour = is_warning ? wxColour(0xFF, 0x6F, 0x00) : wxColour(0x6B, 0x6B, 0x6B);
797 m_statictext_printer_msg->SetForegroundColour(colour);
798
799 if (msg.empty()) {
800 if (!m_statictext_printer_msg->GetLabel().empty()) {
801 m_statictext_printer_msg->SetLabel(wxEmptyString);
802 m_statictext_printer_msg->Hide();
803 Layout();
804 Fit();
805 }
806 } else {
807 msg = format_text(msg);
808
809 auto str_new = msg.ToStdString();
810 stripWhiteSpace(str_new);
811
812 auto str_old = m_statictext_printer_msg->GetLabel().ToStdString();
813 stripWhiteSpace(str_old);
814
815 if (str_new != str_old) {
816 if (m_statictext_printer_msg->GetLabel() != msg) {
817 m_statictext_printer_msg->SetLabel(msg);
818 const int wrap_width = FromDIP(400);
819 m_statictext_printer_msg->Wrap(wrap_width);
820 int line_count = 1;
821 const wxString wrapped_label = m_statictext_printer_msg->GetLabel();
822 for (size_t i = 0; i < wrapped_label.length(); ++i) {
823 if (wrapped_label[i] == '\n')
824 ++line_count;
825 }
826 wxCoord text_width = 0;
827 wxCoord text_height = 0;
828 m_statictext_printer_msg->GetTextExtent(msg, &text_width, &text_height);
829 const int extent_line_count = text_width > 0 ?
830 std::max(1, (static_cast<int>(text_width) + wrap_width - 1) / wrap_width) : 1;
831 line_count = std::max(line_count, extent_line_count);
832 const int line_height = std::max(m_statictext_printer_msg->GetCharHeight(), static_cast<int>(text_height));
833 const int min_height = std::max(m_statictext_printer_msg->GetBestSize().GetHeight(),
834 line_count * line_height + FromDIP(2));
835 m_statictext_printer_msg->SetMinSize(wxSize(wrap_width, min_height));
836 m_statictext_printer_msg->SetMaxSize(wxDefaultSize);
838 Layout();
839 Fit();
840 }
841 }
842 }
843}
wxString format_text(wxString &m_msg)
Definition SendToPrinter.cpp:143
void stripWhiteSpace(std::string &str)
Definition SendToPrinter.cpp:126

References format_text(), m_statictext_printer_msg, and stripWhiteSpace().

Referenced by update_print_status_msg().

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

◆ update_print_error_info()

void Slic3r::GUI::SendToPrinterDialog::update_print_error_info ( int code,
std::string msg,
std::string extra )

◆ update_print_status_msg()

void Slic3r::GUI::SendToPrinterDialog::update_print_status_msg ( wxString msg,
bool is_warning = false,
bool is_printer = true )
846{
847 if (is_printer_msg) {
848 update_priner_status_msg(msg, is_warning);
849 } else {
850 update_priner_status_msg(wxEmptyString, false);
851 }
852}
void update_priner_status_msg(wxString msg, bool is_warning=false)
Definition SendToPrinter.cpp:794

References update_priner_status_msg().

Referenced by CreateMediaAbilityJob(), on_ok(), show_status(), update_show_status(), UploadFileProgressCallback(), and UploadFileRessultCallback().

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

◆ update_printer_combobox()

void Slic3r::GUI::SendToPrinterDialog::update_printer_combobox ( wxCommandEvent & event)
1240{
1243}
void update_user_printer()
Definition SendToPrinter.cpp:1158

References Slic3r::GUI::PrintStatusInit, show_status(), and update_user_printer().

Referenced by SendToPrinterDialog().

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

◆ update_show_status()

void Slic3r::GUI::SendToPrinterDialog::update_show_status ( )
1292{
1293 NetworkAgent* agent = Slic3r::GUI::wxGetApp().getAgent();
1294 DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1295 if (!agent) return;
1296 if (!dev) return;
1297 const std::string provider = wxGetApp().get_printer_cloud_provider();
1298 MachineObject* obj_ = dev->get_my_machine(m_printer_last_select);
1299
1300 if (!obj_) {
1301 if (agent) {
1302 if (agent->is_user_login(provider)) {
1304 }
1305 }
1306 return;
1307 }
1308
1309 /* check cloud machine connections */
1310 if (!obj_->is_lan_mode_printer()) {
1311 if (!agent->is_server_connected(provider)) {
1313 reset_timeout();
1314 return;
1315 }
1316 }
1317
1318 if (!obj_->is_info_ready()) {
1319 if (is_timeout()) {
1321 return;
1322 }
1323 else {
1324 timeout_count++;
1326 return;
1327 }
1328 return;
1329 }
1330
1331 reset_timeout();
1332
1333 // reading done
1334 if (wxGetApp().is_blocking_printing(obj_)) {
1336 return;
1337 }
1338 else if (obj_->is_in_upgrading()) {
1340 return;
1341 }
1342 else if (obj_->is_system_printing()) {
1344 return;
1345 }
1346
1347 // check sdcard when if lan mode printer
1348 /* if (obj_->is_lan_mode_printer()) {
1349 }*/
1350 if (!obj_->is_support_send_to_sdcard) {
1352 return;
1353 }
1354
1356 {
1357 if (obj_->is_support_brtc && !m_ftp_try_connect)
1358 {
1359 std::string dev_id = obj_->get_dev_ip();
1360 if (m_device_select != dev_id)
1361 {
1363 m_device_select.swap(dev_id);
1364 if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD)
1365 m_if_has_sdcard = false;
1366 else
1367 m_if_has_sdcard = true;
1368
1370 m_filetransfer_tunnel.reset();
1371 m_filetransfer_tunnel = nullptr;
1372 }
1373
1374 GetConnection();
1375 }
1376 }
1377 else
1378 {
1379 if (obj_->is_support_brtc && !obj_->is_lan_mode_printer())
1380 {
1382 update_print_status_msg(_L("Connection timed out, please check your network."), true, true);
1383 }
1384 else
1385 {
1386 //use ftp
1387 if (obj_->GetStorage()->get_sdcard_state() == DevStorage::SdcardState::NO_SDCARD) {
1389 return;
1390 }
1391
1393 return;
1394 }
1395 }
1396 }
1397}
@ NO_SDCARD
Definition DevStorage.h:18
bool is_timeout()
Definition SendToPrinter.cpp:1145
void reset_timeout()
Definition SendToPrinter.cpp:1153
@ PrintStatusInSystemPrinting
Definition PrePrintChecker.hpp:67

References _L, Slic3r::MachineObject::get_dev_ip(), Slic3r::DeviceManager::get_my_machine(), Slic3r::DevStorage::get_sdcard_state(), GetConnection(), Slic3r::MachineObject::GetStorage(), Slic3r::MachineObject::is_in_upgrading(), Slic3r::MachineObject::is_info_ready(), Slic3r::MachineObject::is_lan_mode_printer(), Slic3r::NetworkAgent::is_server_connected(), Slic3r::MachineObject::is_support_brtc, Slic3r::MachineObject::is_support_send_to_sdcard, Slic3r::MachineObject::is_system_printing(), is_timeout(), Slic3r::NetworkAgent::is_user_login(), m_device_select, m_filetransfer_tunnel, m_ftp_try_connect, m_if_has_sdcard, m_is_in_sending_mode, m_printer_last_select, Slic3r::DevStorage::NO_SDCARD, Slic3r::GUI::PrintStatusConnecting, Slic3r::GUI::PrintStatusConnectingServer, Slic3r::GUI::PrintStatusInSystemPrinting, Slic3r::GUI::PrintStatusInUpgrading, Slic3r::GUI::PrintStatusInvalidPrinter, Slic3r::GUI::PrintStatusNoSdcard, Slic3r::GUI::PrintStatusNotSupportedSendToSDCard, Slic3r::GUI::PrintStatusPublicInitFailed, Slic3r::GUI::PrintStatusReading, Slic3r::GUI::PrintStatusReadingFinished, Slic3r::GUI::PrintStatusReadingTimeout, Slic3r::GUI::PrintStatusUnsupportedPrinter, reset_timeout(), show_status(), timeout_count, and update_print_status_msg().

Referenced by on_selection_changed(), and on_timer().

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

◆ update_storage_list()

void Slic3r::GUI::SendToPrinterDialog::update_storage_list ( const std::vector< std::string > & storages)
663{
664 m_storage_sizer->Clear();
665 m_storage_radioBox.clear();
666 m_storage_panel->DestroyChildren();
667
668 for (int i=0; i < storages.size(); i++) {
669 RadioBox* radiobox = new RadioBox(m_storage_panel);
670 Label *storage_text = new Label(m_storage_panel);
671
672 if (storages[i] == "emmc")
673 {
674 storage_text->SetLabel(_L("Internal Storage"));
675 storage_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#000000")));
676 }
677 else
678 {
679 storage_text->SetLabel(_L("External Storage"));
680 storage_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#000000")));
681 }
682
683
684 //radiobox->SetLabel(storages[i]);
685 if (storages[i] != "emmc" && m_if_has_sdcard == false)
686 {
687 storage_text->SetLabel(_L("External Storage"));
688 radiobox->Disable();
689 storage_text->SetForegroundColour(StateColor::darkModeColorFor(wxColour("#CECECE")));
690 }
691 else
692 {
693 radiobox->Enable();
694 }
695 radiobox->Bind(wxEVT_LEFT_DOWN, [this, radiobox, selectd_storage = storages[i]](auto& e) {
696 for (const auto& radio : m_storage_radioBox) {
697 radio->SetValue(false);
698 }
699 radiobox->SetValue(true);
700 m_selected_storage = selectd_storage;
701 });
702
703 m_storage_sizer->Add(radiobox, 0, wxALIGN_CENTER, 0);
704 m_storage_sizer->Add(0, 0, 0, wxEXPAND|wxLEFT, FromDIP(6));
705 m_storage_sizer->Add(storage_text, 0, wxALIGN_CENTER,0);
706 m_storage_sizer->AddSpacer(20);
707 m_storage_radioBox.push_back(radiobox);
708 }
709
710 if (m_storage_radioBox.size() > 0) {
711 m_storage_sizer->Add(0, 0, 0, wxEXPAND, FromDIP(6));
712 auto radio = m_storage_radioBox.front();
713 radio->SetValue(true);
714 if (storages.size() > 0)
715 m_selected_storage = storages[0];
716 }
717
718 m_storage_panel->Layout();
719 m_storage_panel->Fit();
720 Layout();
721 Fit();
722}
void SetLabel(const wxString &label) override
Definition Label.cpp:322
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219

References _L, StateColor::darkModeColorFor(), Slic3r::GUI::RadioBox::Disable(), m_if_has_sdcard, m_selected_storage, m_storage_panel, m_storage_radioBox, m_storage_sizer, Label::SetLabel(), and Slic3r::GUI::RadioBox::SetValue().

Referenced by CreateMediaAbilityJob(), on_selection_changed(), Reset(), and Show().

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

◆ update_user_machine_list()

void Slic3r::GUI::SendToPrinterDialog::update_user_machine_list ( )
1083{
1084 NetworkAgent* m_agent = wxGetApp().getAgent();
1085 const std::string provider = wxGetApp().get_printer_cloud_provider();
1086 if (m_agent && m_agent->is_user_login(provider)) {
1087 boost::thread get_print_info_thread = Slic3r::create_thread([this, token = std::weak_ptr<int>(m_token), provider] {
1088 NetworkAgent* agent = wxGetApp().getAgent();
1089 unsigned int http_code;
1090 std::string body;
1091 int result = agent->get_user_print_info(&http_code, &body, provider);
1092 CallAfter([token, this, result, body] {
1093 if (token.expired()) {return;}
1094 if (result == 0) {
1095 m_print_info = body;
1096 }
1097 else {
1098 m_print_info = "";
1099 }
1100 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
1101 event.SetEventObject(this);
1102 wxPostEvent(this, event);
1103 });
1104 });
1105 } else {
1106 wxCommandEvent event(EVT_UPDATE_USER_MACHINE_LIST);
1107 event.SetEventObject(this);
1108 wxPostEvent(this, event);
1109 }
1110}
boost::thread create_thread(boost::thread::attributes &attrs, Fn &&fn)
Definition Thread.hpp:48

References Slic3r::create_thread(), Slic3r::NetworkAgent::get_user_print_info(), Slic3r::NetworkAgent::is_user_login(), m_print_info, and m_token.

Referenced by on_refresh(), and Show().

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

◆ update_user_printer()

void Slic3r::GUI::SendToPrinterDialog::update_user_printer ( )
1159{
1160 Slic3r::DeviceManager* dev = Slic3r::GUI::wxGetApp().getDeviceManager();
1161 if (!dev) return;
1162
1163 // update user print info
1164 if (!m_print_info.empty()) {
1166 m_print_info = "";
1167 }
1168
1169 // clear machine list
1170 m_list.clear();
1171 m_comboBox_printer->Clear();
1172 std::vector<std::string> machine_list;
1173 wxArrayString machine_list_name;
1174 std::map<std::string, MachineObject*> option_list;
1175
1176 option_list = dev->get_my_machine_list(dev->get_current_printer_agent_id());
1177
1178 // same machine only appear once
1179 for (auto it = option_list.begin(); it != option_list.end(); it++) {
1180 if (it->second && (it->second->is_online() || it->second->is_connected())) {
1181 machine_list.push_back(it->second->get_dev_name());
1182 }
1183 }
1184 machine_list = sort_string(machine_list);
1185 for (auto tt = machine_list.begin(); tt != machine_list.end(); tt++) {
1186 for (auto it = option_list.begin(); it != option_list.end(); it++) {
1187 if (it->second->get_dev_name() == *tt) {
1188 m_list.push_back(it->second);
1189 wxString dev_name_text = from_u8(it->second->get_dev_name());
1190 if (it->second->is_lan_mode_printer()) {
1191 dev_name_text += _L("(LAN)");
1192 }
1193 machine_list_name.Add(dev_name_text);
1194 break;
1195 }
1196 }
1197 }
1198
1199 m_comboBox_printer->Set(machine_list_name);
1200
1201 MachineObject* obj = dev->get_selected_machine();
1202 if (!obj) {
1203 dev->load_last_machine();
1204 obj = dev->get_selected_machine();
1205 }
1206
1207 if (obj) {
1208 m_printer_last_select = obj->get_dev_id();
1209 } else {
1211 }
1212
1213 if (m_list.size() > 0) {
1214 // select a default machine
1215 if (m_printer_last_select.empty()) {
1216 m_printer_last_select = m_list[0]->get_dev_id();
1217 m_comboBox_printer->SetSelection(0);
1218 wxCommandEvent event(wxEVT_COMBOBOX);
1219 event.SetEventObject(m_comboBox_printer);
1220 wxPostEvent(m_comboBox_printer, event);
1221 }
1222 for (auto i = 0; i < m_list.size(); i++) {
1223 if (m_list[i]->get_dev_id() == m_printer_last_select) {
1224 m_comboBox_printer->SetSelection(i);
1225 wxCommandEvent event(wxEVT_COMBOBOX);
1226 event.SetEventObject(m_comboBox_printer);
1227 wxPostEvent(m_comboBox_printer, event);
1228 }
1229 }
1230 }
1231 else {
1233 m_comboBox_printer->SetValue(_L("No available printers"));
1234 }
1235
1236 BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << "for send task, current printer id = " << m_printer_last_select << std::endl;
1237}
std::map< std::string, MachineObject * > get_my_machine_list(const std::string &agent_id="")
Definition DevManager.cpp:824
void parse_user_print_info(std::string body)
Definition DevManager.cpp:894
MachineObject * get_selected_machine()
Definition DevManager.cpp:747
std::string get_current_printer_agent_id() const
Definition DevManager.cpp:192
void load_last_machine()
Definition DevManager.cpp:1083
std::vector< std::string > sort_string(std::vector< std::string > strArray)
Definition SendToPrinter.cpp:1134

References _L, Slic3r::GUI::from_u8(), Slic3r::DeviceManager::get_current_printer_agent_id(), Slic3r::MachineObject::get_dev_id(), Slic3r::DeviceManager::get_my_machine_list(), Slic3r::DeviceManager::get_selected_machine(), Slic3r::DeviceManager::load_last_machine(), m_comboBox_printer, m_list, m_print_info, m_printer_last_select, Slic3r::DeviceManager::parse_user_print_info(), and sort_string().

Referenced by update_printer_combobox().

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

◆ UploadFileProgressCallback()

void Slic3r::GUI::SendToPrinterDialog::UploadFileProgressCallback ( int progress)
private
2035{
2036 bool cancelled = false;
2037 wxString msg = _L("Sending...");
2038 m_status_bar->update_status(msg, cancelled, 10 + std::floor(progress * 0.9), true);
2039
2040 if (m_task_timer && m_task_timer->IsRunning()) m_task_timer->Stop();
2041
2042 if (progress == 99) {
2043 m_task_timer.reset(new wxTimer());
2044 m_task_timer->SetOwner(this);
2045
2046 this->Bind(
2047 wxEVT_TIMER,
2048 [this](auto e) {
2051 _L("File upload timed out. Please check if the firmware version supports this operation or verify if the printer is functioning properly."), false, true);
2052 },
2053 m_task_timer->GetId());
2054 m_task_timer->StartOnce(timeout_period);
2055 }
2056}

References _L, m_status_bar, m_task_timer, Slic3r::GUI::PrintStatusPublicUploadFiled, show_status(), Slic3r::GUI::timeout_period, update_print_status_msg(), and UploadFileProgressCallback().

Referenced by CreateUploadFileJob(), and UploadFileProgressCallback().

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

◆ UploadFileRessultCallback()

void Slic3r::GUI::SendToPrinterDialog::UploadFileRessultCallback ( int res,
int resp_ec,
std::string json_res,
std::vector< std::byte > bin_res )
private
2059{
2060 if (m_task_timer && m_task_timer->IsRunning()) m_task_timer->Stop();
2061
2062 if (res == 0)
2063 {
2064 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":upload success to:" << m_selected_storage ;
2066 wxCommandEvent *evt = new wxCommandEvent(m_plater->get_send_finished_event());
2067 evt->SetString(from_u8(m_current_project_name.utf8_string()));
2068 wxQueueEvent(m_plater, evt);
2069 }
2070 else {
2071 BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ":upload failed to:"<< m_selected_storage << "res:" << res << "resp_ec is:" << resp_ec;
2073 // if (err_msg.IsEmpty()) err_msg = _L("Sending failed, please try again!"); // TODO error code
2074 if (ParseErrorCode(resp_ec) != "")
2075 update_print_status_msg(ParseErrorCode(resp_ec), false, true);
2076 else
2077 update_print_status_msg(_L("Sending failed, please try again!"), false, true);
2080 }
2081}

References _L, Slic3r::from_u8(), m_current_project_name, m_filetransfer_uploadfile_job, m_plater, m_selected_storage, m_task_timer, Slic3r::GUI::ParseErrorCode(), Slic3r::GUI::PrintStatusPublicUploadFiled, Slic3r::GUI::PrintStatusReadingFinished, show_status(), update_print_status_msg(), and UploadFileRessultCallback().

Referenced by CreateUploadFileJob(), and UploadFileRessultCallback().

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

Member Data Documentation

◆ btn_bg_enable

StateColor Slic3r::GUI::SendToPrinterDialog::btn_bg_enable
private

◆ enable_prepare_mode

bool Slic3r::GUI::SendToPrinterDialog::enable_prepare_mode { true }
private
74{ true };

Referenced by clear_ip_address_config(), on_ok(), and set_default().

◆ m_ability_list

std::vector<std::string> Slic3r::GUI::SendToPrinterDialog::m_ability_list
private

Referenced by CreateMediaAbilityJob(), and Reset().

◆ m_animaicon

AnimaIcon* Slic3r::GUI::SendToPrinterDialog::m_animaicon {nullptr}
private
126{nullptr};

Referenced by SendToPrinterDialog(), and show_status().

◆ m_bedtype_list

std::vector<wxString> Slic3r::GUI::SendToPrinterDialog::m_bedtype_list
private

◆ m_button_ensure

Button* Slic3r::GUI::SendToPrinterDialog::m_button_ensure { nullptr }
private

◆ m_button_refresh

Button* Slic3r::GUI::SendToPrinterDialog::m_button_refresh { nullptr }
private
93{ nullptr };

Referenced by SendToPrinterDialog(), Enable_Refresh_Button(), and on_dpi_changed().

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_checkbox_list

std::map<std::string, ::CheckBox*> Slic3r::GUI::SendToPrinterDialog::m_checkbox_list
private

◆ m_colour_bold_color

wxColour Slic3r::GUI::SendToPrinterDialog::m_colour_bold_color { wxColour(38, 46, 48) }
private
132{ wxColour(38, 46, 48) };

Referenced by SendToPrinterDialog().

◆ m_colour_def_color

wxColour Slic3r::GUI::SendToPrinterDialog::m_colour_def_color { wxColour(255, 255, 255) }
private
131{ wxColour(255, 255, 255) };

Referenced by SendToPrinterDialog().

◆ m_comboBox_printer

ComboBox* Slic3r::GUI::SendToPrinterDialog::m_comboBox_printer { nullptr }
private

◆ m_connect_try_times

int Slic3r::GUI::SendToPrinterDialog::m_connect_try_times = 0
private

◆ m_connecting_panel

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_connecting_panel {nullptr}
private
106{nullptr};

Referenced by SendToPrinterDialog(), and show_status().

◆ m_connecting_printer_msg

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_connecting_printer_msg {nullptr}
private
110{nullptr};

Referenced by SendToPrinterDialog(), and show_status().

◆ m_connection_status

ConnectionStatus Slic3r::GUI::SendToPrinterDialog::m_connection_status {ConnectionStatus::NOT_START}
private

◆ m_current_project_name

wxString Slic3r::GUI::SendToPrinterDialog::m_current_project_name
private

◆ m_device_select

std::string Slic3r::GUI::SendToPrinterDialog::m_device_select
private

Referenced by Reset(), and update_show_status().

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_export_3mf_cancel

bool Slic3r::GUI::SendToPrinterDialog::m_export_3mf_cancel { false }
private
75{ false };

Referenced by SendToPrinterDialog(), and on_ok().

◆ m_filetransfer_mediability_job

std::unique_ptr<FileTransferJob> Slic3r::GUI::SendToPrinterDialog::m_filetransfer_mediability_job
private

◆ m_filetransfer_tunnel

std::unique_ptr<FileTransferTunnel> Slic3r::GUI::SendToPrinterDialog::m_filetransfer_tunnel
private

◆ m_filetransfer_uploadfile_job

std::unique_ptr<FileTransferJob> Slic3r::GUI::SendToPrinterDialog::m_filetransfer_uploadfile_job
private

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_ftp_try_connect

bool Slic3r::GUI::SendToPrinterDialog::m_ftp_try_connect {false}
private

◆ m_if_has_sdcard

bool Slic3r::GUI::SendToPrinterDialog::m_if_has_sdcard
private

◆ m_is_canceled

bool Slic3r::GUI::SendToPrinterDialog::m_is_canceled { false }
private
76{ false };

Referenced by on_ok().

◆ m_is_in_sending_mode

bool Slic3r::GUI::SendToPrinterDialog::m_is_in_sending_mode { false }
private
72{ false };

Referenced by on_ok(), prepare_mode(), sending_mode(), and update_show_status().

◆ m_is_rename_mode

bool Slic3r::GUI::SendToPrinterDialog::m_is_rename_mode { false }
private
73{ false };

Referenced by on_rename_click(), and on_rename_enter().

◆ m_last_refresh_time

wxDateTime Slic3r::GUI::SendToPrinterDialog::m_last_refresh_time
private

Referenced by SendToPrinterDialog(), and on_refresh().

◆ m_line_materia

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_line_materia { nullptr }
private
103{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_line_schedule

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_line_schedule { nullptr }
private
96{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_line_top

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_line_top { nullptr }
private
100{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_link_network_state

HyperLink* Slic3r::GUI::SendToPrinterDialog::m_link_network_state { nullptr }
private
118{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_list

std::vector<MachineObject*> Slic3r::GUI::SendToPrinterDialog::m_list
private

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_panel_finish

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_panel_finish { nullptr }
private
99{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_panel_image

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_panel_image { nullptr }
private
101{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_panel_prepare

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_panel_prepare { nullptr }
private
98{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_panel_sending

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_panel_sending { nullptr }
private
97{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_plater

Plater* Slic3r::GUI::SendToPrinterDialog::m_plater { nullptr }
private

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_print_error_code

int Slic3r::GUI::SendToPrinterDialog::m_print_error_code = 0
private

◆ m_print_error_extra

std::string Slic3r::GUI::SendToPrinterDialog::m_print_error_extra
private

◆ m_print_error_msg

std::string Slic3r::GUI::SendToPrinterDialog::m_print_error_msg
private

◆ m_print_info

std::string Slic3r::GUI::SendToPrinterDialog::m_print_info
private

◆ m_print_plate_idx

int Slic3r::GUI::SendToPrinterDialog::m_print_plate_idx
private

Referenced by on_ok(), prepare(), and set_default().

◆ m_print_status

PrintDialogStatus Slic3r::GUI::SendToPrinterDialog::m_print_status { PrintStatusInit }
private

Referenced by show_status().

◆ m_printer_last_select

std::string Slic3r::GUI::SendToPrinterDialog::m_printer_last_select
private

◆ m_refresh_timer

wxTimer* Slic3r::GUI::SendToPrinterDialog::m_refresh_timer { nullptr }
private
133{ nullptr };

Referenced by ~SendToPrinterDialog(), init_timer(), and Show().

◆ m_rename_button

Button* Slic3r::GUI::SendToPrinterDialog::m_rename_button { nullptr }
private
92{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_rename_input

TextInput* Slic3r::GUI::SendToPrinterDialog::m_rename_input { nullptr }
private

◆ m_rename_normal_panel

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_rename_normal_panel { nullptr }
private
102{ nullptr };

Referenced by SendToPrinterDialog(), on_rename_enter(), and set_default().

◆ m_rename_switch_panel

wxSimplebook* Slic3r::GUI::SendToPrinterDialog::m_rename_switch_panel { nullptr }
private

◆ m_rename_text

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_rename_text { nullptr }
private
112{ nullptr };

Referenced by SendToPrinterDialog(), on_rename_enter(), and set_default().

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_scrollable_region

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_scrollable_region
private

Referenced by SendToPrinterDialog(), and set_default().

◆ m_selected_storage

std::string Slic3r::GUI::SendToPrinterDialog::m_selected_storage
private

◆ m_simplebook

wxSimplebook* Slic3r::GUI::SendToPrinterDialog::m_simplebook { nullptr }
private
107{ nullptr };

Referenced by SendToPrinterDialog(), prepare_mode(), and sending_mode().

◆ m_sizer_main

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::m_sizer_main
private

Referenced by SendToPrinterDialog().

◆ m_sizer_scrollable_region

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::m_sizer_scrollable_region
private

Referenced by SendToPrinterDialog().

◆ m_st_txt_error_code

Label* Slic3r::GUI::SendToPrinterDialog::m_st_txt_error_code { nullptr }
private
115{ nullptr };

Referenced by SendToPrinterDialog(), and show_print_failed_info().

◆ m_st_txt_error_desc

Label* Slic3r::GUI::SendToPrinterDialog::m_st_txt_error_desc { nullptr }
private
116{ nullptr };

Referenced by SendToPrinterDialog(), and show_print_failed_info().

◆ m_st_txt_extra_info

Label* Slic3r::GUI::SendToPrinterDialog::m_st_txt_extra_info { nullptr }
private
117{ nullptr };

Referenced by SendToPrinterDialog(), and show_print_failed_info().

◆ m_statictext_finish

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_statictext_finish { nullptr }
private
108{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_statictext_printer_msg

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_statictext_printer_msg { nullptr }
private
109{ nullptr };

Referenced by SendToPrinterDialog(), format_text(), and update_priner_status_msg().

◆ m_status_bar

std::shared_ptr<BBLStatusBarSend> Slic3r::GUI::SendToPrinterDialog::m_status_bar
private

◆ m_stext_printer_title

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_stext_printer_title { nullptr }
private
111{ nullptr };

Referenced by SendToPrinterDialog().

◆ m_stext_time

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_stext_time { nullptr }
private
113{ nullptr };

Referenced by SendToPrinterDialog(), and set_default().

◆ m_stext_weight

wxStaticText* Slic3r::GUI::SendToPrinterDialog::m_stext_weight { nullptr }
private
114{ nullptr };

Referenced by SendToPrinterDialog(), and set_default().

◆ m_storage_panel

wxPanel* Slic3r::GUI::SendToPrinterDialog::m_storage_panel { nullptr }
private

◆ m_storage_radioBox

std::vector<RadioBox *> Slic3r::GUI::SendToPrinterDialog::m_storage_radioBox
private

◆ m_storage_sizer

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::m_storage_sizer { nullptr }
private
104{ nullptr };

Referenced by SendToPrinterDialog(), and update_storage_list().

◆ m_sw_print_failed_info

wxScrolledWindow* Slic3r::GUI::SendToPrinterDialog::m_sw_print_failed_info {nullptr}
private
138{nullptr};

Referenced by SendToPrinterDialog(), and show_print_failed_info().

◆ m_task_timer

std::unique_ptr<wxTimer> Slic3r::GUI::SendToPrinterDialog::m_task_timer { nullptr }
private

◆ m_tcp_try_connect

bool Slic3r::GUI::SendToPrinterDialog::m_tcp_try_connect {true}
private

◆ m_thumbnailPanel

ThumbnailPanel* Slic3r::GUI::SendToPrinterDialog::m_thumbnailPanel { nullptr }
private
90{ nullptr };

Referenced by SendToPrinterDialog(), and set_default().

◆ m_token

std::shared_ptr<int> Slic3r::GUI::SendToPrinterDialog::m_token = std::make_shared<int>(0)
private

Referenced by on_ok(), and update_user_machine_list().

◆ m_tutk_try_connect

bool Slic3r::GUI::SendToPrinterDialog::m_tutk_try_connect {false}
private

◆ m_url_timer

std::unique_ptr<wxTimer> Slic3r::GUI::SendToPrinterDialog::m_url_timer {nullptr}
private
135{nullptr};

Referenced by ~SendToPrinterDialog(), GetConnection(), OnConnection(), and Reset().

◆ m_worker

std::unique_ptr<Worker> Slic3r::GUI::SendToPrinterDialog::m_worker
private

◆ rename_sizer_h

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::rename_sizer_h { nullptr }
private
121{ nullptr };

Referenced by SendToPrinterDialog().

◆ rename_sizer_v

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::rename_sizer_v { nullptr }
private
120{ nullptr };

Referenced by SendToPrinterDialog().

◆ sizer_thumbnail

wxBoxSizer* Slic3r::GUI::SendToPrinterDialog::sizer_thumbnail
private

Referenced by SendToPrinterDialog().

◆ timeout_count

int Slic3r::GUI::SendToPrinterDialog::timeout_count = 0
private

The documentation for this class was generated from the following files: