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.

28  :
29  PANEL_BOARD_CLASS_BASE( parent, id, pos, size, style, name )
30 {
31  // Autosize the row label column to be sure label are not truncated
32  m_gridClassesValuesDisplay->SetRowLabelSize( wxGRID_AUTOSIZE );
33 
34  // Needed on wxWidgets 3.0 to ensure sizers are correctly set
35  GetSizer()->SetSizeHints( this );
36 }
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(701, 347), 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 39 of file panel_board_class.cpp.

40 {
41 }

Member Function Documentation

◆ BoardClassesUpdateData()

void PANEL_BOARD_CLASS::BoardClassesUpdateData ( double  aUnitScale)

Definition at line 127 of file panel_board_class.cpp.

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

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 56 of file panel_board_class.cpp.

57 {
58  m_BoardClassesUnitsSelector->SetSelection( aCfg->m_BoardClassUnits );
60 }
void BoardClassesUpdateData(double aUnitScale)
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector

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

Reimplemented from PANEL_BOARD_CLASS_BASE.

Definition at line 121 of file panel_board_class.cpp.

122 {
124 }
void BoardClassesUpdateData(double aUnitScale)
double GetUnitScale() override
Function GetUnitScale.
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector

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

◆ 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 50 of file panel_board_class.cpp.

51 {
52  aCfg->m_BoardClassUnits = m_BoardClassesUnitsSelector->GetSelection();
53 }
UNIT_SELECTOR_LEN * m_BoardClassesUnitsSelector

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 44 of file panel_board_class.cpp.

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

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: