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

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

Inheritance diagram for Slic3r::GUI::FilamentComboBox:
Collaboration diagram for Slic3r::GUI::FilamentComboBox:

Public Member Functions

 FilamentComboBox (wxWindow *parent, int index, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
 ~FilamentComboBox ()
void set_select_mode (CalibrationFilamentMode mode)
CalibrationFilamentMode get_select_mode ()
void load_tray_from_ams (int id, DynamicPrintConfig &tray)
void update_from_preset ()
int get_index ()
int get_tray_id ()
bool is_bbl_filament ()
std::string get_tray_name ()
CalibrateFilamentComboBox * GetComboBox ()
CheckBox * GetCheckBox ()
void SetCheckBox (CheckBox *cb)
wxRadioButton * GetRadioBox ()
void SetRadioBox (wxRadioButton *btn)
virtual bool Show (bool show=true)
virtual bool Enable (bool enable)
virtual void SetValue (bool value, bool send_event=true)
void msw_rescale ()
void ShowPanel ()
void HidePanel ()

Protected Attributes

int m_index {0}
int m_tray_id { -1 }
std::string m_tray_name
bool m_is_bbl_filamnet { false }
CheckBox * m_checkBox { nullptr }
wxRadioButton * m_radioBox { nullptr }
CalibrateFilamentComboBox * m_comboBox { nullptr }
CalibrationFilamentMode m_mode { CalibrationFilamentMode::CALI_MODEL_SINGLE }

Detailed Description

Constructor & Destructor Documentation

◆ FilamentComboBox()

Slic3r::GUI::FilamentComboBox::FilamentComboBox ( wxWindow * parent,
int index,
const wxPoint & pos = wxDefaultPosition,
const wxSize & size = wxDefaultSize )
297 : wxPanel(parent, wxID_ANY, pos, size, wxTAB_TRAVERSAL)
298 , m_index(index)
299{
300 SetBackgroundColour(*wxWHITE);
301
302 wxBoxSizer* main_sizer = new wxBoxSizer(wxHORIZONTAL);
303
304 m_comboBox = new CalibrateFilamentComboBox(this);
307 main_sizer->Add(m_comboBox->clr_picker, 0, wxALIGN_CENTER | wxRIGHT, FromDIP(8));
308 main_sizer->Add(m_comboBox, 0, wxALIGN_CENTER);
309
310 this->SetSizer(main_sizer);
311 this->Layout();
312 main_sizer->Fit(this);
313}
#define CALIBRATION_FILAMENT_COMBOX_SIZE
Definition CalibrationWizardPage.hpp:36
CalibrateFilamentComboBox * m_comboBox
Definition CalibrationWizardPage.hpp:128
int m_index
Definition CalibrationWizardPage.hpp:121

References CALIBRATION_FILAMENT_COMBOX_SIZE, m_comboBox, and m_index.

◆ ~FilamentComboBox()

Slic3r::GUI::FilamentComboBox::~FilamentComboBox ( )
inline
97{};

Member Function Documentation

◆ Enable()

bool Slic3r::GUI::FilamentComboBox::Enable ( bool enable)
virtual
374 {
375 if (!enable)
376 SetValue(false);
377
378 if (m_radioBox)
379 m_radioBox->Enable(enable);
380 if (m_checkBox)
381 m_checkBox->Enable(enable);
382 return wxPanel::Enable(enable);
383}
wxRadioButton * m_radioBox
Definition CalibrationWizardPage.hpp:127
virtual void SetValue(bool value, bool send_event=true)
Definition CalibrationWizardPage.cpp:385
CheckBox * m_checkBox
Definition CalibrationWizardPage.hpp:126

References m_checkBox, m_radioBox, and SetValue().

Here is the call graph for this function:

◆ get_index()

int Slic3r::GUI::FilamentComboBox::get_index ( )
inline
103{ return m_index; }

References m_index.

◆ get_select_mode()

CalibrationFilamentMode Slic3r::GUI::FilamentComboBox::get_select_mode ( )
inline
100{ return m_mode; }
CalibrationFilamentMode m_mode
Definition CalibrationWizardPage.hpp:129

References m_mode.

◆ get_tray_id()

int Slic3r::GUI::FilamentComboBox::get_tray_id ( )
inline
104{ return m_tray_id; }
int m_tray_id
Definition CalibrationWizardPage.hpp:122

References m_tray_id.

◆ get_tray_name()

std::string Slic3r::GUI::FilamentComboBox::get_tray_name ( )
inline
106{ return m_tray_name; }
std::string m_tray_name
Definition CalibrationWizardPage.hpp:123

References m_tray_name.

◆ GetCheckBox()

CheckBox * Slic3r::GUI::FilamentComboBox::GetCheckBox ( )
inline
108{ return m_checkBox; }

References m_checkBox.

◆ GetComboBox()

CalibrateFilamentComboBox * Slic3r::GUI::FilamentComboBox::GetComboBox ( )
inline
107{ return m_comboBox; }

References m_comboBox.

◆ GetRadioBox()

wxRadioButton * Slic3r::GUI::FilamentComboBox::GetRadioBox ( )
inline
110{ return m_radioBox; }

References m_radioBox.

◆ HidePanel()

void Slic3r::GUI::FilamentComboBox::HidePanel ( )
322{
323 this->Hide();
324 m_radioBox->Hide();
325 m_checkBox->Hide();
326}

References m_checkBox, and m_radioBox.

◆ is_bbl_filament()

bool Slic3r::GUI::FilamentComboBox::is_bbl_filament ( )
inline
105{ return m_is_bbl_filamnet; }
bool m_is_bbl_filamnet
Definition CalibrationWizardPage.hpp:124

References m_is_bbl_filamnet.

◆ load_tray_from_ams()

void Slic3r::GUI::FilamentComboBox::load_tray_from_ams ( int id,
DynamicPrintConfig & tray )
340{
341 m_comboBox->load_tray(tray);
342
343 m_tray_id = id;
344 m_tray_name = m_comboBox->get_tray_name();
346 Enable(m_comboBox->is_tray_exist());
347
348 if (m_comboBox->is_tray_exist()) {
349 if (!m_comboBox->is_compatible_with_printer()) {
350 SetValue(false);
351 }
352
353 if (m_radioBox)
354 m_radioBox->Enable(m_comboBox->is_compatible_with_printer());
355
356 if (m_checkBox)
357 m_checkBox->Enable(m_comboBox->is_compatible_with_printer());
358
359 }
360
361 // check compatibility
362 wxCommandEvent event(EVT_CALI_TRAY_CHANGED);
363 event.SetEventObject(GetParent());
364 wxPostEvent(GetParent(), event);
365}
static bool IsBBL_Filament(std::string tag_uid)
Definition DevFilaSystem.cpp:367
@ Enable
Definition Config.hpp:245

References Slic3r::Enable, Slic3r::DevFilaSystem::IsBBL_Filament(), m_checkBox, m_comboBox, m_is_bbl_filamnet, m_radioBox, m_tray_id, m_tray_name, and SetValue().

Here is the call graph for this function:

◆ msw_rescale()

void Slic3r::GUI::FilamentComboBox::msw_rescale ( )
404{
405 //m_checkBox->Rescale();
408 m_comboBox->msw_rescale();
409}

References CALIBRATION_FILAMENT_COMBOX_SIZE, and m_comboBox.

◆ set_select_mode()

void Slic3r::GUI::FilamentComboBox::set_select_mode ( CalibrationFilamentMode mode)
329{
330 m_mode = mode;
331 if (m_checkBox)
333 if (m_radioBox)
335
336 Layout();
337}
@ CALI_MODEL_MULITI
Definition CalibrationWizardPage.hpp:60
@ CALI_MODEL_SINGLE
Definition CalibrationWizardPage.hpp:58

References Slic3r::GUI::CALI_MODEL_MULITI, Slic3r::GUI::CALI_MODEL_SINGLE, m_checkBox, m_mode, and m_radioBox.

Referenced by Slic3r::GUI::CalibrationPresetPage::create_filament_list_panel(), Slic3r::GUI::CalibrationPresetPage::create_multi_extruder_filament_list_panel(), and ShowPanel().

Here is the caller graph for this function:

◆ SetCheckBox()

void Slic3r::GUI::FilamentComboBox::SetCheckBox ( CheckBox * cb)
inline
109{ m_checkBox = cb; }

References m_checkBox.

Referenced by Slic3r::GUI::CalibrationPresetPage::create_filament_list_panel(), and Slic3r::GUI::CalibrationPresetPage::create_multi_extruder_filament_list_panel().

Here is the caller graph for this function:

◆ SetRadioBox()

void Slic3r::GUI::FilamentComboBox::SetRadioBox ( wxRadioButton * btn)
inline
111{ m_radioBox = btn; }

References m_radioBox.

Referenced by Slic3r::GUI::CalibrationPresetPage::create_filament_list_panel(), and Slic3r::GUI::CalibrationPresetPage::create_multi_extruder_filament_list_panel().

Here is the caller graph for this function:

◆ SetValue()

void Slic3r::GUI::FilamentComboBox::SetValue ( bool value,
bool send_event = true )
virtual
385 {
386 if (m_radioBox) {
387 if (value == m_radioBox->GetValue()) {
388 if (m_checkBox) {
389 if (value == m_checkBox->GetValue())
390 return;
391 }
392 else {
393 return;
394 }
395 }
396 }
397 if (m_radioBox)
398 m_radioBox->SetValue(value);
399 if (m_checkBox)
400 m_checkBox->SetValue(value);
401}

References m_checkBox, and m_radioBox.

Referenced by Enable(), and load_tray_from_ams().

Here is the caller graph for this function:

◆ Show()

bool Slic3r::GUI::FilamentComboBox::Show ( bool show = true)
virtual
370{
371 return wxPanel::Show(show);
372}

Referenced by ShowPanel().

Here is the caller graph for this function:

◆ ShowPanel()

void Slic3r::GUI::FilamentComboBox::ShowPanel ( )
316{
317 this->Show();
319}
void set_select_mode(CalibrationFilamentMode mode)
Definition CalibrationWizardPage.cpp:328
virtual bool Show(bool show=true)
Definition CalibrationWizardPage.cpp:369

References m_mode, set_select_mode(), and Show().

Here is the call graph for this function:

◆ update_from_preset()

void Slic3r::GUI::FilamentComboBox::update_from_preset ( )
367{ m_comboBox->update(); }

References m_comboBox.

Member Data Documentation

◆ m_checkBox

CheckBox* Slic3r::GUI::FilamentComboBox::m_checkBox { nullptr }
protected

◆ m_comboBox

CalibrateFilamentComboBox* Slic3r::GUI::FilamentComboBox::m_comboBox { nullptr }
protected

◆ m_index

int Slic3r::GUI::FilamentComboBox::m_index {0}
protected
121{0};

Referenced by FilamentComboBox(), and get_index().

◆ m_is_bbl_filamnet

bool Slic3r::GUI::FilamentComboBox::m_is_bbl_filamnet { false }
protected
124{ false };

Referenced by is_bbl_filament(), and load_tray_from_ams().

◆ m_mode

◆ m_radioBox

wxRadioButton* Slic3r::GUI::FilamentComboBox::m_radioBox { nullptr }
protected

◆ m_tray_id

int Slic3r::GUI::FilamentComboBox::m_tray_id { -1 }
protected
122{ -1 };

Referenced by get_tray_id(), and load_tray_from_ams().

◆ m_tray_name

std::string Slic3r::GUI::FilamentComboBox::m_tray_name
protected

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