KiCad PCB EDA Suite
PANEL_SETUP_MASK_AND_PASTE Class Reference

#include <panel_setup_mask_and_paste.h>

Inheritance diagram for PANEL_SETUP_MASK_AND_PASTE:
PANEL_SETUP_MASK_AND_PASTE_BASE

Public Member Functions

 PANEL_SETUP_MASK_AND_PASTE (PAGED_DIALOG *aParent, PCB_EDIT_FRAME *aFrame)
 
 ~PANEL_SETUP_MASK_AND_PASTE ()
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
void ImportSettingsFrom (BOARD *aBoard)
 

Protected Attributes

wxStaticText * m_staticTextInfoValPos
 
wxStaticText * m_staticTextInfoValNeg
 
wxStaticText * m_MaskMarginLabel
 
wxTextCtrl * m_MaskMarginCtrl
 
wxStaticText * m_MaskMarginUnits
 
wxStaticText * m_MaskMinWidthLabel
 
wxTextCtrl * m_MaskMinWidthCtrl
 
wxStaticText * m_MaskMinWidthUnits
 
wxStaticText * m_PasteMarginLabel
 
wxTextCtrl * m_PasteMarginCtrl
 
wxStaticText * m_PasteMarginUnits
 
wxStaticText * m_staticTextRatio
 
wxTextCtrl * m_SolderPasteMarginRatioCtrl
 
wxStaticText * m_SolderPasteRatioMarginUnits
 
wxStaticText * m_staticTextInfoCopper
 

Private Attributes

PCB_EDIT_FRAMEm_Frame
 
BOARD_DESIGN_SETTINGSm_BrdSettings
 
UNIT_BINDER m_maskMargin
 
UNIT_BINDER m_maskMinWidth
 
UNIT_BINDER m_pasteMargin
 

Detailed Description

Definition at line 38 of file panel_setup_mask_and_paste.h.

Constructor & Destructor Documentation

PANEL_SETUP_MASK_AND_PASTE::PANEL_SETUP_MASK_AND_PASTE ( PAGED_DIALOG aParent,
PCB_EDIT_FRAME aFrame 
)

Definition at line 35 of file panel_setup_mask_and_paste.cpp.

References PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), m_BrdSettings, m_Frame, PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoCopper, PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoValNeg, and PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoValPos.

36  :
41 {
42  m_Frame = aFrame;
44 
45  wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT );
46  infoFont.SetSymbolicSize( wxFONTSIZE_SMALL );
47  m_staticTextInfoValPos->SetFont( infoFont );
48  m_staticTextInfoValNeg->SetFont( infoFont );
49  m_staticTextInfoCopper->SetFont( infoFont );
50 }
PANEL_SETUP_MASK_AND_PASTE_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(-1,-1), long style=wxTAB_TRAVERSAL)
BOARD * GetBoard() const
wxTreebook * GetTreebook()
Definition: paged_dialog.h:43
BOARD_DESIGN_SETTINGS * m_BrdSettings
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
PANEL_SETUP_MASK_AND_PASTE::~PANEL_SETUP_MASK_AND_PASTE ( )
inline

Member Function Documentation

void PANEL_SETUP_MASK_AND_PASTE::ImportSettingsFrom ( BOARD aBoard)

Definition at line 102 of file panel_setup_mask_and_paste.cpp.

References BOARD::GetDesignSettings(), m_BrdSettings, and TransferDataToWindow().

Referenced by DIALOG_BOARD_SETUP::OnAuxiliaryAction(), and ~PANEL_SETUP_MASK_AND_PASTE().

103 {
104  BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
105 
106  m_BrdSettings = &aBoard->GetDesignSettings();
108 
109  m_BrdSettings = savedSettings;
110 }
BOARD_DESIGN_SETTINGS * m_BrdSettings
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Function GetDesignSettings.
Definition: class_board.h:538
Class BOARD_DESIGN_SETTINGS contains design settings for a BOARD object.
bool PANEL_SETUP_MASK_AND_PASTE::TransferDataFromWindow ( )
override

Definition at line 78 of file panel_setup_mask_and_paste.cpp.

References UNIT_BINDER::GetValue(), m_BrdSettings, m_maskMargin, m_maskMinWidth, m_pasteMargin, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, and PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteMarginRatioCtrl.

Referenced by ~PANEL_SETUP_MASK_AND_PASTE().

79 {
82 
84 
85  double dtmp = 0.0;
86  wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
87  msg.ToDouble( &dtmp );
88 
89  // A margin ratio de -50% means no paste on a pad, the ratio must be >= 50 %
90  if( dtmp < -50 )
91  dtmp = -50;
92 
93  if( dtmp > +100 )
94  dtmp = +100;
95 
97 
98  return true;
99 }
int m_SolderMaskMargin
Solder mask margin.
int m_SolderPasteMargin
Solder paste margin absolute value.
virtual int GetValue()
Function GetValue Returns the current value in Internal Units.
BOARD_DESIGN_SETTINGS * m_BrdSettings
double m_SolderPasteMarginRatio
Solder pask margin ratio value of pad size The final margin is the sum of these 2 values...
int m_SolderMaskMinWidth
Solder mask min width.
bool PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow ( )
override

Definition at line 53 of file panel_setup_mask_and_paste.cpp.

References m_BrdSettings, m_maskMargin, m_maskMinWidth, m_pasteMargin, PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginCtrl, BOARD_DESIGN_SETTINGS::m_SolderMaskMargin, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, BOARD_DESIGN_SETTINGS::m_SolderPasteMargin, BOARD_DESIGN_SETTINGS::m_SolderPasteMarginRatio, PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteMarginRatioCtrl, and UNIT_BINDER::SetValue().

Referenced by ImportSettingsFrom(), and ~PANEL_SETUP_MASK_AND_PASTE().

54 {
58 
59  // Prefer "-0" to "0" for normally negative values
61  m_PasteMarginCtrl->SetValue( wxT( "-" ) + m_PasteMarginCtrl->GetValue() );
62 
63  // Add solder paste margin ratio in per cent
64  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
65  wxString msg;
66  msg.Printf( wxT( "%f" ), m_BrdSettings->m_SolderPasteMarginRatio * 100.0 );
67 
68  // Sometimes Printf adds a sign if the value is small
69  if( m_BrdSettings->m_SolderPasteMarginRatio == 0.0 && msg[0] == '0' )
70  m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
71  else
72  m_SolderPasteMarginRatioCtrl->SetValue( msg );
73 
74  return true;
75 }
int m_SolderMaskMargin
Solder mask margin.
int m_SolderPasteMargin
Solder paste margin absolute value.
BOARD_DESIGN_SETTINGS * m_BrdSettings
virtual void SetValue(int aValue)
Function SetValue Sets new value (in Internal Units) for the text field, taking care of units convers...
double m_SolderPasteMarginRatio
Solder pask margin ratio value of pad size The final margin is the sum of these 2 values...
int m_SolderMaskMinWidth
Solder mask min width.

Member Data Documentation

BOARD_DESIGN_SETTINGS* PANEL_SETUP_MASK_AND_PASTE::m_BrdSettings
private
PCB_EDIT_FRAME* PANEL_SETUP_MASK_AND_PASTE::m_Frame
private

Definition at line 41 of file panel_setup_mask_and_paste.h.

Referenced by PANEL_SETUP_MASK_AND_PASTE().

UNIT_BINDER PANEL_SETUP_MASK_AND_PASTE::m_maskMargin
private

Definition at line 44 of file panel_setup_mask_and_paste.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginCtrl
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginLabel
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginUnits
protectedinherited
UNIT_BINDER PANEL_SETUP_MASK_AND_PASTE::m_maskMinWidth
private

Definition at line 45 of file panel_setup_mask_and_paste.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthCtrl
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthLabel
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthUnits
protectedinherited
UNIT_BINDER PANEL_SETUP_MASK_AND_PASTE::m_pasteMargin
private

Definition at line 46 of file panel_setup_mask_and_paste.h.

Referenced by TransferDataFromWindow(), and TransferDataToWindow().

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginCtrl
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginLabel
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginUnits
protectedinherited
wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteMarginRatioCtrl
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteRatioMarginUnits
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoCopper
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoValNeg
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoValPos
protectedinherited
wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextRatio
protectedinherited

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