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

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

Inheritance diagram for Slic3r::GUI::CaliPresetTipsPanel:
Collaboration diagram for Slic3r::GUI::CaliPresetTipsPanel:

Public Member Functions

 CaliPresetTipsPanel (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_params (int nozzle_temp, int bed_temp, float max_volumetric)
void get_params (int &nozzle_temp, int &bed_temp, float &max_volumetric)

Protected Attributes

wxBoxSizer * m_top_sizer
TextInput * m_nozzle_temp
Label * m_bed_temp
TextInput * m_max_volumetric_speed

Detailed Description

Constructor & Destructor Documentation

◆ CaliPresetTipsPanel()

Slic3r::GUI::CaliPresetTipsPanel::CaliPresetTipsPanel ( wxWindow * parent,
wxWindowID id = wxID_ANY,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize,
long style = wxTAB_TRAVERSAL )
433 : wxPanel(parent, id, pos, size, style)
434{
435 this->SetBackgroundColour(wxColour(238, 238, 238));
436 this->SetMinSize(wxSize(MIN_CALIBRATION_PAGE_WIDTH, -1));
437
438 m_top_sizer = new wxBoxSizer(wxVERTICAL);
439
440 create_panel(this);
441
442 this->SetSizer(m_top_sizer);
443 m_top_sizer->Fit(this);
444}
#define MIN_CALIBRATION_PAGE_WIDTH
Definition CalibrationWizardPage.hpp:33
#define style
Definition WipeTowerDialog.cpp:101
wxBoxSizer * m_top_sizer
Definition CalibrationWizardPresetPage.hpp:129
void create_panel(wxWindow *parent)
Definition CalibrationWizardPresetPage.cpp:446

References create_panel(), m_top_sizer, MIN_CALIBRATION_PAGE_WIDTH, and style.

Here is the call graph for this function:

Member Function Documentation

◆ create_panel()

void Slic3r::GUI::CaliPresetTipsPanel::create_panel ( wxWindow * parent)
447{
448 m_top_sizer->AddSpacer(FromDIP(10));
449
450 auto preset_panel_tips = new Label(parent, _L("A test model will be printed. Please clear the build plate and place it back to the hot bed before calibration."));
451 preset_panel_tips->SetFont(Label::Body_14);
452 preset_panel_tips->Wrap(CALIBRATION_TEXT_MAX_LENGTH * 1.5f);
453 m_top_sizer->Add(preset_panel_tips, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
454
455 m_top_sizer->AddSpacer(FromDIP(10));
456
457 auto info_sizer = new wxFlexGridSizer(0, 3, 0, FromDIP(10));
458 info_sizer->SetFlexibleDirection(wxBOTH);
459 info_sizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
460
461 auto nozzle_temp_sizer = new wxBoxSizer(wxVERTICAL);
462 auto nozzle_temp_text = new Label(parent, _L("Nozzle temperature"));
463 nozzle_temp_text->SetFont(Label::Body_12);
464 m_nozzle_temp = new TextInput(parent, wxEmptyString, _L("\u2103" /* °C */), "", wxDefaultPosition, CALIBRATION_FROM_TO_INPUT_SIZE, wxTE_READONLY);
465 m_nozzle_temp->SetBorderWidth(0);
466 nozzle_temp_sizer->Add(nozzle_temp_text, 0, wxALIGN_LEFT);
467 nozzle_temp_sizer->Add(m_nozzle_temp, 0, wxEXPAND);
468 nozzle_temp_text->Hide();
469 m_nozzle_temp->Hide();
470
471 auto bed_temp_sizer = new wxBoxSizer(wxHORIZONTAL);
472 auto printing_param_text = new Label(parent, _L("Printing Parameters"));
473 printing_param_text->SetFont(Label::Head_12);
474 printing_param_text->Wrap(CALIBRATION_TEXT_MAX_LENGTH);
475 bed_temp_sizer->Add(printing_param_text, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(20));
476 auto bed_temp_text = new Label(parent, _L("Bed temperature"));
477 bed_temp_text->SetFont(Label::Body_12);
478
479 m_bed_temp = new Label(parent, _L("- \u2103" /* °C */));
480 m_bed_temp->SetFont(Label::Body_12);
481 bed_temp_sizer->Add(bed_temp_text, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(10));
482 bed_temp_sizer->Add(m_bed_temp, 0, wxALIGN_CENTER);
483
484 auto max_flow_sizer = new wxBoxSizer(wxVERTICAL);
485 auto max_flow_text = new Label(parent, _L("Max volumetric speed"));
486 max_flow_text->SetFont(Label::Body_12);
487 m_max_volumetric_speed = new TextInput(parent, wxEmptyString, _L("mm³"), "", wxDefaultPosition, CALIBRATION_FROM_TO_INPUT_SIZE, wxTE_READONLY);
488 m_max_volumetric_speed->SetBorderWidth(0);
489 max_flow_sizer->Add(max_flow_text, 0, wxALIGN_LEFT);
490 max_flow_sizer->Add(m_max_volumetric_speed, 0, wxEXPAND);
491 max_flow_text->Hide();
493
494 m_nozzle_temp->GetTextCtrl()->Bind(wxEVT_SET_FOCUS, [](auto&) {});
495 m_max_volumetric_speed->GetTextCtrl()->Bind(wxEVT_SET_FOCUS, [](auto&) {});
496
497 info_sizer->Add(nozzle_temp_sizer);
498 info_sizer->Add(bed_temp_sizer);
499 info_sizer->Add(max_flow_sizer);
500 m_top_sizer->Add(info_sizer, 0, wxEXPAND | wxLEFT | wxRIGHT, FromDIP(20));
501
502 m_top_sizer->AddSpacer(FromDIP(10));
503}
#define CALIBRATION_TEXT_MAX_LENGTH
Definition CalibrationWizardPage.hpp:40
#define CALIBRATION_FROM_TO_INPUT_SIZE
Definition CalibrationWizardPage.hpp:38
#define _L(s)
Definition OBJ.cpp:34
static wxFont Head_12
Definition Label.hpp:47
static wxFont Body_12
Definition Label.hpp:55
static wxFont Body_14
Definition Label.hpp:53
TextInput * m_nozzle_temp
Definition CalibrationWizardPresetPage.hpp:130
TextInput * m_max_volumetric_speed
Definition CalibrationWizardPresetPage.hpp:132
Label * m_bed_temp
Definition CalibrationWizardPresetPage.hpp:131

References _L, Label::Body_12, Label::Body_14, CALIBRATION_FROM_TO_INPUT_SIZE, CALIBRATION_TEXT_MAX_LENGTH, Label::Head_12, m_bed_temp, m_max_volumetric_speed, m_nozzle_temp, and m_top_sizer.

Referenced by CaliPresetTipsPanel().

Here is the caller graph for this function:

◆ get_params()

void Slic3r::GUI::CaliPresetTipsPanel::get_params ( int & nozzle_temp,
int & bed_temp,
float & max_volumetric )
518{
519 try {
520 nozzle_temp = stoi(m_nozzle_temp->GetTextCtrl()->GetValue().ToStdString());
521 }
522 catch (...) {
523 nozzle_temp = 0;
524 }
525 try {
526 bed_temp = stoi(m_bed_temp->GetLabel().ToStdString());
527 }
528 catch (...) {
529 bed_temp = 0;
530 }
531 try {
532 max_volumetric = stof(m_max_volumetric_speed->GetTextCtrl()->GetValue().ToStdString());
533 }
534 catch (...) {
535 max_volumetric = 0.0f;
536 }
537}

References m_bed_temp, m_max_volumetric_speed, and m_nozzle_temp.

◆ set_params()

void Slic3r::GUI::CaliPresetTipsPanel::set_params ( int nozzle_temp,
int bed_temp,
float max_volumetric )
506{
507 wxString text_nozzle_temp = wxString::Format("%d", nozzle_temp);
508 m_nozzle_temp->GetTextCtrl()->SetValue(text_nozzle_temp);
509
510 std::string bed_temp_text = bed_temp==0 ? "-": std::to_string(bed_temp);
511 m_bed_temp->SetLabel(wxString::FromUTF8(bed_temp_text + "\u2103" /* °C */));
512
513 wxString flow_val_text = wxString::Format("%0.2f", max_volumetric);
514 m_max_volumetric_speed->GetTextCtrl()->SetValue(flow_val_text);
515}

References m_bed_temp, m_max_volumetric_speed, and m_nozzle_temp.

Member Data Documentation

◆ m_bed_temp

Label* Slic3r::GUI::CaliPresetTipsPanel::m_bed_temp
protected

◆ m_max_volumetric_speed

TextInput* Slic3r::GUI::CaliPresetTipsPanel::m_max_volumetric_speed
protected

◆ m_nozzle_temp

TextInput* Slic3r::GUI::CaliPresetTipsPanel::m_nozzle_temp
protected

◆ m_top_sizer

wxBoxSizer* Slic3r::GUI::CaliPresetTipsPanel::m_top_sizer
protected

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