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

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

Inheritance diagram for Slic3r::GUI::FilamentMapAutoPanel:
Collaboration diagram for Slic3r::GUI::FilamentMapAutoPanel:

Public Member Functions

 FilamentMapAutoPanel (wxWindow *parent, FilamentMapMode mode, bool machine_synced)
bool Show (bool show=true) override
FilamentMapMode GetMode () const

Private Member Functions

void OnModeSwitch (FilamentMapMode mode)
void UpdateStatus ()

Private Attributes

FilamentMapBtnPanel * m_flush_panel
FilamentMapBtnPanel * m_match_panel
FilamentMapMode m_mode

Detailed Description

Constructor & Destructor Documentation

◆ FilamentMapAutoPanel()

Slic3r::GUI::FilamentMapAutoPanel::FilamentMapAutoPanel ( wxWindow * parent,
FilamentMapMode mode,
bool machine_synced )
688 : wxPanel(parent)
689{
690 const wxString AutoForFlushDetail = _L("Generates filament grouping for the left and right nozzles based on the most filament-saving principles to minimize waste.");
691
692 const wxString AutoForMatchDetail = _L("Generates filament grouping for the left and right nozzles based on the printer's actual filament status, reducing the need for manual filament adjustment.");
693
694 auto sizer = new wxBoxSizer(wxHORIZONTAL);
695 m_flush_panel = new FilamentMapBtnPanel(this, _L("Filament-Saving Mode"), AutoForFlushDetail, "flush_mode_panel_icon");
696 m_match_panel = new FilamentMapBtnPanel(this, _L("Convenience Mode"), AutoForMatchDetail, "match_mode_panel_icon");
697
698 if (!machine_synced) m_match_panel->Enable(false);
699
700 sizer->AddStretchSpacer();
701 sizer->Add(m_flush_panel, 1, wxEXPAND);
702 sizer->AddSpacer(FromDIP(12));
703 sizer->Add(m_match_panel, 1, wxEXPAND);
704 sizer->AddStretchSpacer();
705
706 m_flush_panel->Bind(wxEVT_LEFT_DOWN, [this](auto& event) {
707 if (m_flush_panel->IsEnabled()) {
709 }
710 });
711
712 m_match_panel->Bind(wxEVT_LEFT_DOWN, [this](auto &event) {
713 if (m_match_panel->IsEnabled()) {
715 }
716 });
717
718 m_mode = mode;
719 UpdateStatus();
720
721 SetSizerAndFit(sizer);
722 Layout();
723 GUI::wxGetApp().UpdateDarkUIWin(this);
724}
#define _L(s)
Definition OBJ.cpp:34
FilamentMapBtnPanel * m_match_panel
Definition FilamentMapPanel.hpp:116
void UpdateStatus()
Definition FilamentMapPanel.cpp:732
FilamentMapMode m_mode
Definition FilamentMapPanel.hpp:117
void OnModeSwitch(FilamentMapMode mode)
Definition FilamentMapPanel.cpp:743
FilamentMapBtnPanel * m_flush_panel
Definition FilamentMapPanel.hpp:115
@ fmmAutoForMatch
Definition PrintConfig.hpp:634
@ fmmAutoForFlush
Definition PrintConfig.hpp:633

References _L, Slic3r::fmmAutoForFlush, Slic3r::fmmAutoForMatch, m_flush_panel, m_match_panel, m_mode, OnModeSwitch(), and UpdateStatus().

Here is the call graph for this function:

Member Function Documentation

◆ GetMode()

FilamentMapMode Slic3r::GUI::FilamentMapAutoPanel::GetMode ( ) const
inline
109{ return m_mode; }

References m_mode.

◆ OnModeSwitch()

void Slic3r::GUI::FilamentMapAutoPanel::OnModeSwitch ( FilamentMapMode mode)
private
744{
745 m_mode = mode;
746 UpdateStatus();
747}

References m_mode, and UpdateStatus().

Referenced by FilamentMapAutoPanel().

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

◆ Show()

bool Slic3r::GUI::FilamentMapAutoPanel::Show ( bool show = true)
override
726{
727 m_flush_panel->Show(show);
728 m_match_panel->Show(show);
729 return wxPanel::Show(show);
730}

References m_flush_panel, and m_match_panel.

◆ UpdateStatus()

void Slic3r::GUI::FilamentMapAutoPanel::UpdateStatus ( )
private
733{
734 if (m_mode == fmmAutoForFlush) {
735 m_flush_panel->Select(true);
736 m_match_panel->Select(false);
737 } else {
738 m_flush_panel->Select(false);
739 m_match_panel->Select(true);
740 }
741}

References Slic3r::fmmAutoForFlush, m_flush_panel, m_match_panel, and m_mode.

Referenced by FilamentMapAutoPanel(), and OnModeSwitch().

Here is the caller graph for this function:

Member Data Documentation

◆ m_flush_panel

FilamentMapBtnPanel* Slic3r::GUI::FilamentMapAutoPanel::m_flush_panel
private

◆ m_match_panel

FilamentMapBtnPanel* Slic3r::GUI::FilamentMapAutoPanel::m_match_panel
private

◆ m_mode

FilamentMapMode Slic3r::GUI::FilamentMapAutoPanel::m_mode
private

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