KiCad PCB EDA Suite
PANEL_BOARD_CLASS Class Reference

#include <panel_board_class.h>

Inheritance diagram for PANEL_BOARD_CLASS:
PANEL_BOARD_CLASS_BASE CALCULATOR_PANEL

Public Member Functions

 PANEL_BOARD_CLASS (wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)
 
 ~PANEL_BOARD_CLASS ()
 
void LoadSettings (PCB_CALCULATOR_SETTINGS *aCfg) override
 Load the settings into the panel. More...
 
void SaveSettings (PCB_CALCULATOR_SETTINGS *aCfg) override
 Save the settings from the panel. More...
 
void ThemeChanged () override
 Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appropriate for the new theme. More...
 
void OnBoardClassesUnitsSelection (wxCommandEvent &event) override
 
void BoardClassesUpdateData (double aUnitScale)
 

Protected Attributes

UNIT_SELECTOR_LENm_BoardClassesUnitsSelector
 
wxStaticText * m_staticTextBrdClass
 
wxGrid * m_gridClassesValuesDisplay
 
wxPanel * m_panelShowClassPrms
 

Detailed Description

Definition at line 28 of file panel_board_class.h.

Constructor & Destructor Documentation

◆ PANEL_BOARD_CLASS()

PANEL_BOARD_CLASS::PANEL_BOARD_CLASS ( wxWindow *  parent,
wxWindowID  id = wxID_ANY,
const wxPoint &  pos = wxDefaultPosition,
const wxSize &  size = wxDefaultSize,
long  style = wxTAB_TRAVERSAL,
const wxString &  name = wxEmptyString 
)

Definition at line 26 of file panel_board_class.cpp.

27 :
28 PANEL_BOARD_CLASS_BASE( parent, id, pos, size, style, name )
29{
30 // Autosize the row label column to be sure label are not truncated
31 m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
32
33 // Needed on wxWidgets 3.0 to ensure sizers are correctly set
34 GetSizer()->SetSizeHints( this );
35}
const char * name
Definition: DXF_plotter.cpp:56
PANEL_BOARD_CLASS_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL, const wxString &name=wxEmptyString)

References PANEL_BOARD_CLASS_BASE::m_gridClassesValuesDisplay.

◆ ~PANEL_BOARD_CLASS()

PANEL_BOARD_CLASS::~PANEL_BOARD_CLASS ( )

Definition at line 38 of file panel_board_class.cpp.

39{
40}

Member Function Documentation

◆ BoardClassesUpdateData()

void PANEL_BOARD_CLASS::BoardClassesUpdateData ( double  aUnitScale)

Definition at line 126 of file panel_board_class.cpp.

127{
128 wxString txt;
129 #define FMT wxT("%g")
130 #define NO_VALUE wxT("--")
131
132 for( int ii = 0; ii < BRDCLASS_COUNT; ii ++ )
133 {
134 // Display min tracks width
135 if( clist[ii].m_Lines > -1.0 )
136 txt.Printf( FMT, clist[ii].m_Lines / aUnitScale);
137 else
138 txt = NO_VALUE;
139 m_gridClassesValuesDisplay->SetCellValue(0, ii, txt );
140
141 // Display min clearance
142 if( clist[ii].m_Clearance > -1.0 )
143 txt.Printf( FMT, clist[ii].m_Clearance / aUnitScale);
144 else
145 txt = NO_VALUE;
146
147 m_gridClassesValuesDisplay->SetCellValue(1, ii, txt );
148
149 // Display min Via diam diff
150 if( clist[ii].m_ViaDiamDiff > -1.0 )
151 txt.Printf( FMT, clist[ii].m_ViaDiamDiff / aUnitScale);
152 else
153 txt = NO_VALUE;
154
155 m_gridClassesValuesDisplay->SetCellValue(2, ii, txt );
156
157 // Display min Pad diam diff (plated)
158 if( clist[ii].m_PadDiamDiffPlated > -1.0 )
159 txt.Printf( FMT, clist[ii].m_PadDiamDiffPlated / aUnitScale);
160 else
161 txt = NO_VALUE;
162
163 m_gridClassesValuesDisplay->SetCellValue(3, ii, txt );
164
165 // Display min Pad diam diff (non plated)
166 if( clist[ii].m_PadDiamDiffNotPlated > -1.0 )
167 txt.Printf( FMT, clist[ii].m_PadDiamDiffNotPlated / aUnitScale);
168 else
169 txt = NO_VALUE;
170
171 m_gridClassesValuesDisplay->SetCellValue(4, ii, txt );
172 }
173}
#define NO_VALUE
#define BRDCLASS_COUNT
#define FMT
static BOARD_MIN_SIZE_VALUES clist[BRDCLASS_COUNT]

References BRDCLASS_COUNT, clist, FMT, PANEL_BOARD_CLASS_BASE::m_gridClassesValuesDisplay, and NO_VALUE.

Referenced by LoadSettings(), and OnBoardClassesUnitsSelection().

◆ LoadSettings()

void PANEL_BOARD_CLASS::LoadSettings ( PCB_CALCULATOR_SETTINGS aCfg)
overridevirtual

Load the settings into the panel.

Parameters
aCfgis the settings structure to load from

Implements CALCULATOR_PANEL.

Definition at line 55 of file panel_board_class.cpp.

56{
59}
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector
void BoardClassesUpdateData(double aUnitScale)
double GetUnitScale() override
Function GetUnitScale.

References BoardClassesUpdateData(), UNIT_SELECTOR_LEN::GetUnitScale(), PANEL_BOARD_CLASS_BASE::m_BoardClassesUnitsSelector, and PCB_CALCULATOR_SETTINGS::m_BoardClassUnits.

◆ OnBoardClassesUnitsSelection()

void PANEL_BOARD_CLASS::OnBoardClassesUnitsSelection ( wxCommandEvent &  event)
overridevirtual

◆ SaveSettings()

void PANEL_BOARD_CLASS::SaveSettings ( PCB_CALCULATOR_SETTINGS aCfg)
overridevirtual

Save the settings from the panel.

Parameters
aCfgis the settings structure to save to

Implements CALCULATOR_PANEL.

Definition at line 49 of file panel_board_class.cpp.

50{
51 aCfg->m_BoardClassUnits = m_BoardClassesUnitsSelector->GetSelection();
52}

References PANEL_BOARD_CLASS_BASE::m_BoardClassesUnitsSelector, and PCB_CALCULATOR_SETTINGS::m_BoardClassUnits.

◆ ThemeChanged()

void PANEL_BOARD_CLASS::ThemeChanged ( )
overridevirtual

Update UI elements of the panel when the theme changes to ensure the images and fonts/colors are appropriate for the new theme.

Implements CALCULATOR_PANEL.

Definition at line 43 of file panel_board_class.cpp.

44{
45 // TODO: Only the grid needs updating, but it isn't done automatically (https://trac.wxwidgets.org/ticket/19279)
46}

Member Data Documentation

◆ m_BoardClassesUnitsSelector

UNIT_SELECTOR_LEN* PANEL_BOARD_CLASS_BASE::m_BoardClassesUnitsSelector
protectedinherited

◆ m_gridClassesValuesDisplay

wxGrid* PANEL_BOARD_CLASS_BASE::m_gridClassesValuesDisplay
protectedinherited

◆ m_panelShowClassPrms

wxPanel* PANEL_BOARD_CLASS_BASE::m_panelShowClassPrms
protectedinherited

◆ m_staticTextBrdClass

wxStaticText* PANEL_BOARD_CLASS_BASE::m_staticTextBrdClass
protectedinherited

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