KiCad PCB EDA Suite
PANEL_SETUP_BOARD_FINISH Class Reference

#include <panel_board_finish.h>

Inheritance diagram for PANEL_SETUP_BOARD_FINISH:
PANEL_SETUP_BOARD_FINISH_BASE

Public Member Functions

 PANEL_SETUP_BOARD_FINISH (PAGED_DIALOG *aParent, BOARD *aBoard)
 
 ~PANEL_SETUP_BOARD_FINISH ()
 
void ImportSettingsFrom (BOARD *aBoard)
 
bool TransferDataFromWindow () override
 

Protected Attributes

wxCheckBox * m_cbCastellatedPads
 
wxCheckBox * m_cbEgdesPlated
 
wxStaticText * m_staticTextFinish
 
wxChoice * m_choiceFinish
 
wxStaticText * m_staticTextEdgeConn
 
wxChoice * m_choiceEdgeConn
 

Private Member Functions

void synchronizeWithBoard ()
 

Private Attributes

PAGED_DIALOGm_parentDialog
 
BOARDm_board
 
BOARD_DESIGN_SETTINGSm_brdSettings
 

Detailed Description

Definition at line 36 of file panel_board_finish.h.

Constructor & Destructor Documentation

◆ PANEL_SETUP_BOARD_FINISH()

PANEL_SETUP_BOARD_FINISH::PANEL_SETUP_BOARD_FINISH ( PAGED_DIALOG aParent,
BOARD aBoard 
)

Definition at line 34 of file panel_board_finish.cpp.

34  :
36 {
37  m_parentDialog = aParent;
38  m_board = aBoard;
40 
41  // Get the translated list of choices and init m_choiceFinish
42  wxArrayString finish_list = GetCopperFinishStandardList( true );
43  m_choiceFinish->Append( finish_list );
44  m_choiceFinish->SetSelection( 0 ); // Will be correctly set later
45 
47 }
BOARD_DESIGN_SETTINGS * m_brdSettings
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:590
wxTreebook * GetTreebook()
Definition: paged_dialog.h:37
wxArrayString GetCopperFinishStandardList(bool aTranslate)
PANEL_SETUP_BOARD_FINISH_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 GetCopperFinishStandardList(), BOARD::GetDesignSettings(), m_board, m_brdSettings, PANEL_SETUP_BOARD_FINISH_BASE::m_choiceFinish, m_parentDialog, and synchronizeWithBoard().

◆ ~PANEL_SETUP_BOARD_FINISH()

PANEL_SETUP_BOARD_FINISH::~PANEL_SETUP_BOARD_FINISH ( )

Definition at line 50 of file panel_board_finish.cpp.

51 {
52 }

Member Function Documentation

◆ ImportSettingsFrom()

void PANEL_SETUP_BOARD_FINISH::ImportSettingsFrom ( BOARD aBoard)

Definition at line 99 of file panel_board_finish.cpp.

100 {
101  BOARD* savedBrd = m_board;
102  BOARD_DESIGN_SETTINGS* savedSettings = m_brdSettings;
103  m_brdSettings = &aBoard->GetDesignSettings();
104 
106 
107  m_brdSettings = savedSettings;
108  m_board = savedBrd;
109 }
BOARD_DESIGN_SETTINGS * m_brdSettings
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:590
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:191
Container for design settings for a BOARD object.

References BOARD::GetDesignSettings(), m_board, m_brdSettings, and synchronizeWithBoard().

◆ synchronizeWithBoard()

void PANEL_SETUP_BOARD_FINISH::synchronizeWithBoard ( )
private

Definition at line 55 of file panel_board_finish.cpp.

56 {
57  const BOARD_STACKUP& brd_stackup = m_brdSettings->GetStackupDescriptor();
58 
59  m_choiceEdgeConn->SetSelection( brd_stackup.m_EdgeConnectorConstraints );
60  m_cbCastellatedPads->SetValue( brd_stackup.m_CastellatedPads );
61  m_cbEgdesPlated->SetValue( brd_stackup.m_EdgePlating );
62 
63  // find the choice depending on the initial finish setting
64  wxArrayString initial_finish_list = GetCopperFinishStandardList( false );
65  unsigned idx;
66 
67  for( idx = 0; idx < initial_finish_list.GetCount(); idx++ )
68  {
69  if( initial_finish_list[idx] == brd_stackup.m_FinishType )
70  break;
71  }
72 
73  // Now init the choice (use last choice: "User defined" if not found )
74  if( idx >= initial_finish_list.GetCount() )
75  idx = initial_finish_list.GetCount()-1;
76 
77  m_choiceFinish->SetSelection( idx );
78 }
BOARD_DESIGN_SETTINGS * m_brdSettings
Manage layers needed to make a physical board.
wxString m_FinishType
The name of external copper finish.
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
bool m_CastellatedPads
True if castellated pads exist.
BOARD_STACKUP & GetStackupDescriptor()
wxArrayString GetCopperFinishStandardList(bool aTranslate)

References GetCopperFinishStandardList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), m_brdSettings, BOARD_STACKUP::m_CastellatedPads, PANEL_SETUP_BOARD_FINISH_BASE::m_cbCastellatedPads, PANEL_SETUP_BOARD_FINISH_BASE::m_cbEgdesPlated, PANEL_SETUP_BOARD_FINISH_BASE::m_choiceEdgeConn, PANEL_SETUP_BOARD_FINISH_BASE::m_choiceFinish, BOARD_STACKUP::m_EdgeConnectorConstraints, BOARD_STACKUP::m_EdgePlating, and BOARD_STACKUP::m_FinishType.

Referenced by ImportSettingsFrom(), and PANEL_SETUP_BOARD_FINISH().

◆ TransferDataFromWindow()

bool PANEL_SETUP_BOARD_FINISH::TransferDataFromWindow ( )
override

Definition at line 81 of file panel_board_finish.cpp.

82 {
84 
85  wxArrayString finish_list = GetCopperFinishStandardList( false );
86  int finish = m_choiceFinish->GetSelection() >= 0 ? m_choiceFinish->GetSelection() : 0;
87  brd_stackup.m_FinishType = finish_list[finish];
88 
89  int edge = m_choiceEdgeConn->GetSelection();;
91 
92  brd_stackup.m_CastellatedPads = m_cbCastellatedPads->GetValue();
93  brd_stackup.m_EdgePlating = m_cbEgdesPlated->GetValue();
94 
95  return true;
96 }
BS_EDGE_CONNECTOR_CONSTRAINTS
Definition: board_stackup.h:53
BOARD_DESIGN_SETTINGS * m_brdSettings
Manage layers needed to make a physical board.
wxString m_FinishType
The name of external copper finish.
bool m_EdgePlating
True if the edge board is plated.
BS_EDGE_CONNECTOR_CONSTRAINTS m_EdgeConnectorConstraints
If the board has edge connector cards, some constrains can be specified in job file: BS_EDGE_CONNECTO...
bool m_CastellatedPads
True if castellated pads exist.
BOARD_STACKUP & GetStackupDescriptor()
wxArrayString GetCopperFinishStandardList(bool aTranslate)

References GetCopperFinishStandardList(), BOARD_DESIGN_SETTINGS::GetStackupDescriptor(), m_brdSettings, BOARD_STACKUP::m_CastellatedPads, PANEL_SETUP_BOARD_FINISH_BASE::m_cbCastellatedPads, PANEL_SETUP_BOARD_FINISH_BASE::m_cbEgdesPlated, PANEL_SETUP_BOARD_FINISH_BASE::m_choiceEdgeConn, PANEL_SETUP_BOARD_FINISH_BASE::m_choiceFinish, BOARD_STACKUP::m_EdgeConnectorConstraints, BOARD_STACKUP::m_EdgePlating, and BOARD_STACKUP::m_FinishType.

Member Data Documentation

◆ m_board

BOARD* PANEL_SETUP_BOARD_FINISH::m_board
private

Definition at line 52 of file panel_board_finish.h.

Referenced by ImportSettingsFrom(), and PANEL_SETUP_BOARD_FINISH().

◆ m_brdSettings

BOARD_DESIGN_SETTINGS* PANEL_SETUP_BOARD_FINISH::m_brdSettings
private

◆ m_cbCastellatedPads

wxCheckBox* PANEL_SETUP_BOARD_FINISH_BASE::m_cbCastellatedPads
protectedinherited

◆ m_cbEgdesPlated

wxCheckBox* PANEL_SETUP_BOARD_FINISH_BASE::m_cbEgdesPlated
protectedinherited

◆ m_choiceEdgeConn

wxChoice* PANEL_SETUP_BOARD_FINISH_BASE::m_choiceEdgeConn
protectedinherited

◆ m_choiceFinish

wxChoice* PANEL_SETUP_BOARD_FINISH_BASE::m_choiceFinish
protectedinherited

◆ m_parentDialog

PAGED_DIALOG* PANEL_SETUP_BOARD_FINISH::m_parentDialog
private

Definition at line 51 of file panel_board_finish.h.

Referenced by PANEL_SETUP_BOARD_FINISH().

◆ m_staticTextEdgeConn

wxStaticText* PANEL_SETUP_BOARD_FINISH_BASE::m_staticTextEdgeConn
protectedinherited

◆ m_staticTextFinish

wxStaticText* PANEL_SETUP_BOARD_FINISH_BASE::m_staticTextFinish
protectedinherited

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