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

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

Inheritance diagram for Slic3r::GUI::CaliPASaveP1PPanel:
Collaboration diagram for Slic3r::GUI::CaliPASaveP1PPanel:

Public Member Functions

 CaliPASaveP1PPanel (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void create_panel (wxWindow *parent)
void set_save_img ()
void set_pa_cali_method (ManualPaCaliMethod method)
bool get_result (float *out_k, float *out_n)
virtual bool Show (bool show=true) override
void msw_rescale ()

Protected Attributes

wxBoxSizer * m_top_sizer
Label * m_complete_text
CaliPagePicture * m_picture_panel
::TextInput * m_k_val
::TextInput * m_n_val

Detailed Description

Constructor & Destructor Documentation

◆ CaliPASaveP1PPanel()

Slic3r::GUI::CaliPASaveP1PPanel::CaliPASaveP1PPanel ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL )
1067 : wxPanel(parent, id, pos, size, style)
1068{
1069 SetBackgroundColour(*wxWHITE);
1070
1071 m_top_sizer = new wxBoxSizer(wxVERTICAL);
1072
1073 create_panel(this);
1074
1075 this->SetSizer(m_top_sizer);
1076 m_top_sizer->Fit(this);
1077}
#define style
Definition WipeTowerDialog.cpp:101
wxBoxSizer * m_top_sizer
Definition CalibrationWizardSavePage.hpp:191
void create_panel(wxWindow *parent)
Definition CalibrationWizardSavePage.cpp:1079

References create_panel(), m_top_sizer, and style.

Here is the call graph for this function:

Member Function Documentation

◆ create_panel()

void Slic3r::GUI::CaliPASaveP1PPanel::create_panel ( wxWindow * parent)
1080{
1081 auto complete_text_panel = new wxPanel(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL);
1082 complete_text_panel->SetBackgroundColour(*wxWHITE);
1083 wxBoxSizer* complete_text_sizer = new wxBoxSizer(wxVERTICAL);
1084 m_complete_text = new Label(complete_text_panel, _L("Please find the best line on your plate"));
1087 complete_text_sizer->Add(m_complete_text, 0, wxEXPAND);
1088 complete_text_panel->SetSizer(complete_text_sizer);
1089 m_top_sizer->Add(complete_text_panel, 0, wxEXPAND, 0);
1090
1091 m_top_sizer->AddSpacer(FromDIP(20));
1092
1093 m_picture_panel = new CaliPagePicture(parent);
1094 set_save_img();
1095 m_top_sizer->Add(m_picture_panel, 0, wxEXPAND, 0);
1096
1097 m_top_sizer->AddSpacer(FromDIP(20));
1098
1099 auto value_sizer = new wxBoxSizer(wxHORIZONTAL);
1100 auto k_value_text = new Label(parent, _L("Factor K"));
1101 k_value_text->Wrap(-1);
1102 k_value_text->SetFont(::Label::Head_14);
1103 auto n_value_text = new Label(parent, _L("Factor N"));
1104 n_value_text->Wrap(-1);
1105 n_value_text->SetFont(::Label::Head_14);
1106 m_k_val = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0);
1107 m_k_val->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
1108 m_n_val = new TextInput(parent, wxEmptyString, "", "", wxDefaultPosition, CALIBRATION_OPTIMAL_INPUT_SIZE, 0);
1109 m_n_val->GetTextCtrl()->SetValidator(wxTextValidator(wxFILTER_NUMERIC));
1110 n_value_text->Hide();
1111 m_n_val->Hide();
1112 value_sizer->Add(k_value_text, 0, wxALIGN_CENTER_VERTICAL, 0);
1113 value_sizer->AddSpacer(FromDIP(10));
1114 value_sizer->Add(m_k_val, 0);
1115 value_sizer->AddSpacer(FromDIP(50));
1116 value_sizer->Add(n_value_text, 0, wxALIGN_CENTER_VERTICAL, 0);
1117 value_sizer->AddSpacer(FromDIP(10));
1118 value_sizer->Add(m_n_val, 0);
1119 m_top_sizer->Add(value_sizer, 0, wxALIGN_CENTER);
1120
1121 m_top_sizer->AddSpacer(FromDIP(20));
1122
1123 Bind(wxEVT_LEFT_DOWN, [this](auto& e) {
1124 SetFocusIgnoringChildren();
1125 });
1126}
#define CALIBRATION_TEXT_MAX_LENGTH
Definition CalibrationWizardPage.hpp:40
#define CALIBRATION_OPTIMAL_INPUT_SIZE
Definition CalibrationWizardPage.hpp:37
#define _L(s)
Definition OBJ.cpp:34
static wxFont Head_14
Definition Label.hpp:45
CaliPagePicture * m_picture_panel
Definition CalibrationWizardSavePage.hpp:193
::TextInput * m_k_val
Definition CalibrationWizardSavePage.hpp:194
void set_save_img()
Definition CalibrationWizardSavePage.cpp:1128
::TextInput * m_n_val
Definition CalibrationWizardSavePage.hpp:195
Label * m_complete_text
Definition CalibrationWizardSavePage.hpp:192

References _L, CALIBRATION_OPTIMAL_INPUT_SIZE, CALIBRATION_TEXT_MAX_LENGTH, Label::Head_14, m_complete_text, m_k_val, m_n_val, m_picture_panel, m_top_sizer, and set_save_img().

Referenced by CaliPASaveP1PPanel().

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

◆ get_result()

bool Slic3r::GUI::CaliPASaveP1PPanel::get_result ( float * out_k,
float * out_n )
1152 {
1153 // Check if the value is valid
1154 if (!CalibUtils::validate_input_k_value(m_k_val->GetTextCtrl()->GetValue(), out_k)) {
1155 MessageDialog msg_dlg(nullptr, wxString::Format(_L("Please input a valid value (K in %.1f~%.1f)"), MIN_PA_K_VALUE, MAX_PA_K_VALUE), wxEmptyString, wxICON_WARNING | wxOK);
1156 msg_dlg.ShowModal();
1157 return false;
1158 }
1159 return true;
1160}
static bool validate_input_k_value(wxString k_text, float *output_value)
Definition CalibUtils.cpp:452
const double MAX_PA_K_VALUE
Definition CalibUtils.cpp:68
const double MIN_PA_K_VALUE
Definition CalibUtils.cpp:67

References _L, m_k_val, Slic3r::GUI::MAX_PA_K_VALUE, Slic3r::GUI::MIN_PA_K_VALUE, Slic3r::GUI::DPIAware< P >::ShowModal(), and Slic3r::GUI::CalibUtils::validate_input_k_value().

Here is the call graph for this function:

◆ msw_rescale()

void Slic3r::GUI::CaliPASaveP1PPanel::msw_rescale ( )
1171{
1172 m_picture_panel->msw_rescale();
1173}

References m_picture_panel.

◆ set_pa_cali_method()

void Slic3r::GUI::CaliPASaveP1PPanel::set_pa_cali_method ( ManualPaCaliMethod method)
1137{
1138 if (method == ManualPaCaliMethod::PA_LINE) {
1139 m_complete_text->SetLabel(_L("Please find the best line on your plate"));
1140 set_save_img();
1141 }
1142 else if (method == ManualPaCaliMethod::PA_PATTERN) {
1143 m_complete_text->SetLabel(_L("Please find the corner with the perfect degree of extrusion"));
1144 if (wxGetApp().app_config->get_language_code() == "zh-cn") {
1145 m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result_CN", 350));
1146 } else {
1147 m_picture_panel->set_bmp(ScalableBitmap(this, "fd_pattern_manual_result", 350));
1148 }
1149 }
1150}
@ PA_PATTERN
Definition DevCalib.h:25
@ PA_LINE
Definition DevCalib.h:24

References _L, m_complete_text, m_picture_panel, Slic3r::PA_LINE, Slic3r::PA_PATTERN, and set_save_img().

Here is the call graph for this function:

◆ set_save_img()

void Slic3r::GUI::CaliPASaveP1PPanel::set_save_img ( )
1128 {
1129 if (wxGetApp().app_config->get_language_code() == "zh-cn") {
1130 m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result_CN", 350));
1131 } else {
1132 m_picture_panel->set_bmp(ScalableBitmap(this, "fd_calibration_manual_result", 350));
1133 }
1134}

References m_picture_panel.

Referenced by create_panel(), and set_pa_cali_method().

Here is the caller graph for this function:

◆ Show()

bool Slic3r::GUI::CaliPASaveP1PPanel::Show ( bool show = true)
overridevirtual
1162 {
1163 if (show) {
1164 m_k_val->GetTextCtrl()->ChangeValue("");
1165 m_n_val->GetTextCtrl()->ChangeValue("");
1166 }
1167 return wxPanel::Show(show);
1168}

References m_k_val, and m_n_val.

Member Data Documentation

◆ m_complete_text

Label* Slic3r::GUI::CaliPASaveP1PPanel::m_complete_text
protected

Referenced by create_panel(), and set_pa_cali_method().

◆ m_k_val

::TextInput* Slic3r::GUI::CaliPASaveP1PPanel::m_k_val
protected

Referenced by create_panel(), get_result(), and Show().

◆ m_n_val

::TextInput* Slic3r::GUI::CaliPASaveP1PPanel::m_n_val
protected

Referenced by create_panel(), and Show().

◆ m_picture_panel

CaliPagePicture* Slic3r::GUI::CaliPASaveP1PPanel::m_picture_panel
protected

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::CaliPASaveP1PPanel::m_top_sizer
protected

Referenced by CaliPASaveP1PPanel(), and create_panel().


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