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

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

Inheritance diagram for Slic3r::GUI::CaliPageSendingPanel:
Collaboration diagram for Slic3r::GUI::CaliPageSendingPanel:

Public Member Functions

 CaliPageSendingPanel (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void create (wxWindow *parent)
void update_print_error_info (int code, const std::string &msg, const std::string &extra)
void show_send_failed_info (bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
std::shared_ptr< BBLStatusBarSend > get_sending_progress_bar ()
void reset ()

Private Attributes

std::shared_ptr< BBLStatusBarSend > m_send_progress_bar
wxScrolledWindow * m_sw_print_failed_info { nullptr }
Label * m_st_txt_error_code { nullptr }
Label * m_st_txt_error_desc { nullptr }
Label * m_st_txt_extra_info { nullptr }
int m_print_error_code
std::string m_print_error_msg
std::string m_print_error_extra

Detailed Description

Constructor & Destructor Documentation

◆ CaliPageSendingPanel()

Slic3r::GUI::CaliPageSendingPanel::CaliPageSendingPanel ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL )
840 : wxPanel(parent, id, pos, size, style)
841{
842 SetBackgroundColour(*wxWHITE);
843 SetMinSize({ FromDIP(475), FromDIP(200) });
844 SetMaxSize({ FromDIP(475), FromDIP(200) });
845
846 create(this);
847
848 Layout();
849 Fit();
850
851 Bind(EVT_SHOW_ERROR_INFO_SEND, [this](auto& e) {
853 });
854}
#define style
Definition WipeTowerDialog.cpp:101
void show_send_failed_info(bool show, int code=0, wxString description=wxEmptyString, wxString extra=wxEmptyString)
Definition CalibrationWizardPage.cpp:947
void create(wxWindow *parent)
Definition CalibrationWizardPage.cpp:856

References create(), show_send_failed_info(), and style.

Here is the call graph for this function:

Member Function Documentation

◆ create()

void Slic3r::GUI::CaliPageSendingPanel::create ( wxWindow * parent)
857{
858 auto panel_sizer = new wxBoxSizer(wxVERTICAL);
859 parent->SetSizer(panel_sizer);
860
861 m_send_progress_bar = std::shared_ptr<BBLStatusBarSend>(new BBLStatusBarSend(parent));
862 panel_sizer->Add(m_send_progress_bar->get_panel(), 0, wxEXPAND);
863
864 m_sw_print_failed_info = new wxScrolledWindow(parent, wxID_ANY, wxDefaultPosition, wxSize(FromDIP(380), FromDIP(125)), wxVSCROLL);
865 m_sw_print_failed_info->SetBackgroundColour(*wxWHITE);
866 m_sw_print_failed_info->SetScrollRate(0, FromDIP(20));
867 m_sw_print_failed_info->SetMinSize(wxSize(FromDIP(380), FromDIP(125)));
868 m_sw_print_failed_info->SetMaxSize(wxSize(FromDIP(380), FromDIP(125)));
869
871
872 panel_sizer->Add(m_sw_print_failed_info, 0, wxEXPAND);
873
874 // create error info panel
875 wxBoxSizer* sizer_print_failed_info = new wxBoxSizer(wxVERTICAL);
876 m_sw_print_failed_info->SetSizer(sizer_print_failed_info);
877
878 wxBoxSizer* sizer_error_code = new wxBoxSizer(wxHORIZONTAL);
879 wxBoxSizer* sizer_error_desc = new wxBoxSizer(wxHORIZONTAL);
880 wxBoxSizer* sizer_extra_info = new wxBoxSizer(wxHORIZONTAL);
881
882 auto st_title_error_code = new Label(m_sw_print_failed_info, _L("Error code"));
883 auto st_title_error_code_doc = new Label(m_sw_print_failed_info, ": ");
884 m_st_txt_error_code = new Label(m_sw_print_failed_info, wxEmptyString);
885 st_title_error_code->SetForegroundColour(0x909090);
886 st_title_error_code_doc->SetForegroundColour(0x909090);
887 m_st_txt_error_code->SetForegroundColour(0x909090);
888 st_title_error_code->SetFont(::Label::Body_13);
889 st_title_error_code_doc->SetFont(::Label::Body_13);
891 st_title_error_code->SetMinSize(wxSize(FromDIP(74), -1));
892 st_title_error_code->SetMaxSize(wxSize(FromDIP(74), -1));
893 m_st_txt_error_code->SetMinSize(wxSize(FromDIP(260), -1));
894 m_st_txt_error_code->SetMaxSize(wxSize(FromDIP(260), -1));
895 sizer_error_code->Add(st_title_error_code, 0, wxALL, 0);
896 sizer_error_code->Add(st_title_error_code_doc, 0, wxALL, 0);
897 sizer_error_code->Add(m_st_txt_error_code, 0, wxALL, 0);
898
899 auto st_title_error_desc = new Label(m_sw_print_failed_info, _L("Error desc"));
900 auto st_title_error_desc_doc = new Label(m_sw_print_failed_info, ": ");
901 m_st_txt_error_desc = new Label(m_sw_print_failed_info, wxEmptyString);
902 st_title_error_desc->SetForegroundColour(0x909090);
903 st_title_error_desc_doc->SetForegroundColour(0x909090);
904 m_st_txt_error_desc->SetForegroundColour(0x909090);
905 st_title_error_desc->SetFont(::Label::Body_13);
906 st_title_error_desc_doc->SetFont(::Label::Body_13);
908 st_title_error_desc->SetMinSize(wxSize(FromDIP(74), -1));
909 st_title_error_desc->SetMaxSize(wxSize(FromDIP(74), -1));
910 m_st_txt_error_desc->SetMinSize(wxSize(FromDIP(260), -1));
911 m_st_txt_error_desc->SetMaxSize(wxSize(FromDIP(260), -1));
912 sizer_error_desc->Add(st_title_error_desc, 0, wxALL, 0);
913 sizer_error_desc->Add(st_title_error_desc_doc, 0, wxALL, 0);
914 sizer_error_desc->Add(m_st_txt_error_desc, 0, wxALL, 0);
915
916 auto st_title_extra_info = new Label(m_sw_print_failed_info, _L("Extra info"));
917 auto st_title_extra_info_doc = new Label(m_sw_print_failed_info, ": ");
918 m_st_txt_extra_info = new Label(m_sw_print_failed_info, wxEmptyString);
919 st_title_extra_info->SetForegroundColour(0x909090);
920 st_title_extra_info_doc->SetForegroundColour(0x909090);
921 m_st_txt_extra_info->SetForegroundColour(0x909090);
922 st_title_extra_info->SetFont(::Label::Body_13);
923 st_title_extra_info_doc->SetFont(::Label::Body_13);
925 st_title_extra_info->SetMinSize(wxSize(FromDIP(74), -1));
926 st_title_extra_info->SetMaxSize(wxSize(FromDIP(74), -1));
927 m_st_txt_extra_info->SetMinSize(wxSize(FromDIP(260), -1));
928 m_st_txt_extra_info->SetMaxSize(wxSize(FromDIP(260), -1));
929 sizer_extra_info->Add(st_title_extra_info, 0, wxALL, 0);
930 sizer_extra_info->Add(st_title_extra_info_doc, 0, wxALL, 0);
931 sizer_extra_info->Add(m_st_txt_extra_info, 0, wxALL, 0);
932
933 sizer_print_failed_info->Add(sizer_error_code, 0, wxLEFT, 5);
934 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
935 sizer_print_failed_info->Add(sizer_error_desc, 0, wxLEFT, 5);
936 sizer_print_failed_info->Add(0, 0, 0, wxTOP, FromDIP(3));
937 sizer_print_failed_info->Add(sizer_extra_info, 0, wxLEFT, 5);
938}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_13
Definition Label.hpp:54
std::shared_ptr< BBLStatusBarSend > m_send_progress_bar
Definition CalibrationWizardPage.hpp:270
Label * m_st_txt_extra_info
Definition CalibrationWizardPage.hpp:274
Label * m_st_txt_error_desc
Definition CalibrationWizardPage.hpp:273
wxScrolledWindow * m_sw_print_failed_info
Definition CalibrationWizardPage.hpp:271
Label * m_st_txt_error_code
Definition CalibrationWizardPage.hpp:272

References _L, Label::Body_13, m_send_progress_bar, m_st_txt_error_code, m_st_txt_error_desc, m_st_txt_extra_info, and m_sw_print_failed_info.

Referenced by CaliPageSendingPanel().

Here is the caller graph for this function:

◆ get_sending_progress_bar()

std::shared_ptr< BBLStatusBarSend > Slic3r::GUI::CaliPageSendingPanel::get_sending_progress_bar ( )
979{
980 return m_send_progress_bar;
981}

References m_send_progress_bar.

◆ reset()

void Slic3r::GUI::CaliPageSendingPanel::reset ( )
984{
985 m_send_progress_bar->reset();
986 m_sw_print_failed_info->Show(false);
987}

References m_send_progress_bar, and m_sw_print_failed_info.

◆ show_send_failed_info()

void Slic3r::GUI::CaliPageSendingPanel::show_send_failed_info ( bool show,
int code = 0,
wxString description = wxEmptyString,
wxString extra = wxEmptyString )
948{
949 if (show) {
950 if (!m_sw_print_failed_info->IsShown()) {
951 m_sw_print_failed_info->Show(true);
952
953 m_st_txt_error_code->SetLabelText(wxString::Format("%d", m_print_error_code));
954 m_st_txt_error_desc->SetLabelText(wxGetApp().filter_string(m_print_error_msg));
955 m_st_txt_extra_info->SetLabelText(wxGetApp().filter_string(m_print_error_extra));
956
957 m_st_txt_error_code->Wrap(FromDIP(260));
958 m_st_txt_error_desc->Wrap(FromDIP(260));
959 m_st_txt_extra_info->Wrap(FromDIP(260));
960 }
961 else {
962 m_sw_print_failed_info->Show(false);
963 }
964 Layout();
965 Fit();
966 }
967 else {
968 if (!m_sw_print_failed_info->IsShown()) { return; }
969 m_sw_print_failed_info->Show(false);
970 m_st_txt_error_code->SetLabelText(wxEmptyString);
971 m_st_txt_error_desc->SetLabelText(wxEmptyString);
972 m_st_txt_extra_info->SetLabelText(wxEmptyString);
973 Layout();
974 Fit();
975 }
976}
std::string m_print_error_msg
Definition CalibrationWizardPage.hpp:276
int m_print_error_code
Definition CalibrationWizardPage.hpp:275
std::string m_print_error_extra
Definition CalibrationWizardPage.hpp:277

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 CaliPageSendingPanel().

Here is the caller graph for this function:

◆ update_print_error_info()

void Slic3r::GUI::CaliPageSendingPanel::update_print_error_info ( int code,
const std::string & msg,
const std::string & extra )

Member Data Documentation

◆ m_print_error_code

int Slic3r::GUI::CaliPageSendingPanel::m_print_error_code
private

◆ m_print_error_extra

std::string Slic3r::GUI::CaliPageSendingPanel::m_print_error_extra
private

◆ m_print_error_msg

std::string Slic3r::GUI::CaliPageSendingPanel::m_print_error_msg
private

◆ m_send_progress_bar

std::shared_ptr<BBLStatusBarSend> Slic3r::GUI::CaliPageSendingPanel::m_send_progress_bar
private

◆ m_st_txt_error_code

Label* Slic3r::GUI::CaliPageSendingPanel::m_st_txt_error_code { nullptr }
private
272{ nullptr };

Referenced by create(), and show_send_failed_info().

◆ m_st_txt_error_desc

Label* Slic3r::GUI::CaliPageSendingPanel::m_st_txt_error_desc { nullptr }
private
273{ nullptr };

Referenced by create(), and show_send_failed_info().

◆ m_st_txt_extra_info

Label* Slic3r::GUI::CaliPageSendingPanel::m_st_txt_extra_info { nullptr }
private
274{ nullptr };

Referenced by create(), and show_send_failed_info().

◆ m_sw_print_failed_info

wxScrolledWindow* Slic3r::GUI::CaliPageSendingPanel::m_sw_print_failed_info { nullptr }
private
271{ nullptr };

Referenced by create(), reset(), and show_send_failed_info().


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