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

wxStaticBitmap * m_bitmapWarning
 
wxStaticText * m_staticTextInfoMaskMinWidth
 
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_staticTextInfoPaste
 

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::PANEL_SETUP_MASK_AND_PASTE ( PAGED_DIALOG aParent,
PCB_EDIT_FRAME aFrame 
)

Definition at line 31 of file panel_setup_mask_and_paste.cpp.

32  :
36  true ),
38 {
39  m_Frame = aFrame;
41 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
wxTreebook * GetTreebook()
Definition: paged_dialog.h:50
BOARD_DESIGN_SETTINGS * m_BrdSettings
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, const wxString &name=wxEmptyString)
BOARD * GetBoard() const

References PCB_BASE_FRAME::GetBoard(), BOARD::GetDesignSettings(), m_BrdSettings, and m_Frame.

◆ ~PANEL_SETUP_MASK_AND_PASTE()

PANEL_SETUP_MASK_AND_PASTE::~PANEL_SETUP_MASK_AND_PASTE ( )
inline

Definition at line 50 of file panel_setup_mask_and_paste.h.

50 { };

Member Function Documentation

◆ ImportSettingsFrom()

void PANEL_SETUP_MASK_AND_PASTE::ImportSettingsFrom ( BOARD aBoard)

Definition at line 94 of file panel_setup_mask_and_paste.cpp.

95 {
96  BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
97 
98  m_BrdSettings = &aBoard->GetDesignSettings();
100 
101  m_BrdSettings = savedSettings;
102 }
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.h:574
BOARD_DESIGN_SETTINGS * m_BrdSettings
Container for design settings for a BOARD object.

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

Referenced by DIALOG_BOARD_SETUP::OnAuxiliaryAction().

◆ TransferDataFromWindow()

bool PANEL_SETUP_MASK_AND_PASTE::TransferDataFromWindow ( )
override

Definition at line 69 of file panel_setup_mask_and_paste.cpp.

70 {
71  // These are all stored in project file, not board, so no need for OnModify()
74 
76 
77  double dtmp = 0.0;
78  wxString msg = m_SolderPasteMarginRatioCtrl->GetValue();
79  msg.ToDouble( &dtmp );
80 
81  // A margin ratio de -50% means no paste on a pad, the ratio must be >= 50 %
82  if( dtmp < -50 )
83  dtmp = -50;
84 
85  if( dtmp > +100 )
86  dtmp = +100;
87 
89 
90  return true;
91 }
BOARD_DESIGN_SETTINGS * m_BrdSettings
virtual long long int GetValue()
Function GetValue Returns the current value in Internal Units.

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.

◆ TransferDataToWindow()

bool PANEL_SETUP_MASK_AND_PASTE::TransferDataToWindow ( )
override

Definition at line 44 of file panel_setup_mask_and_paste.cpp.

45 {
49 
50  // Prefer "-0" to "0" for normally negative values
52  m_PasteMarginCtrl->SetValue( wxT( "-" ) + m_PasteMarginCtrl->GetValue() );
53 
54  // Add solder paste margin ratio in percent
55  // for the usual default value 0.0, display -0.0 (or -0,0 in some countries)
56  wxString msg;
57  msg.Printf( wxT( "%f" ), m_BrdSettings->m_SolderPasteMarginRatio * 100.0 );
58 
59  // Sometimes Printf adds a sign if the value is small
60  if( m_BrdSettings->m_SolderPasteMarginRatio == 0.0 && msg[0] == '0' )
61  m_SolderPasteMarginRatioCtrl->SetValue( wxT( "-" ) + msg );
62  else
63  m_SolderPasteMarginRatioCtrl->SetValue( msg );
64 
65  return true;
66 }
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...

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().

Member Data Documentation

◆ m_bitmapWarning

wxStaticBitmap* PANEL_SETUP_MASK_AND_PASTE_BASE::m_bitmapWarning
protectedinherited

◆ m_BrdSettings

BOARD_DESIGN_SETTINGS* PANEL_SETUP_MASK_AND_PASTE::m_BrdSettings
private

◆ m_Frame

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().

◆ m_maskMargin

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().

◆ m_MaskMarginCtrl

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginCtrl
protectedinherited

◆ m_MaskMarginLabel

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginLabel
protectedinherited

◆ m_MaskMarginUnits

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMarginUnits
protectedinherited

◆ m_maskMinWidth

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().

◆ m_MaskMinWidthCtrl

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthCtrl
protectedinherited

◆ m_MaskMinWidthLabel

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthLabel
protectedinherited

◆ m_MaskMinWidthUnits

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_MaskMinWidthUnits
protectedinherited

◆ m_pasteMargin

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().

◆ m_PasteMarginCtrl

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginCtrl
protectedinherited

◆ m_PasteMarginLabel

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginLabel
protectedinherited

◆ m_PasteMarginUnits

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_PasteMarginUnits
protectedinherited

◆ m_SolderPasteMarginRatioCtrl

wxTextCtrl* PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteMarginRatioCtrl
protectedinherited

◆ m_SolderPasteRatioMarginUnits

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_SolderPasteRatioMarginUnits
protectedinherited

◆ m_staticTextInfoMaskMinWidth

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoMaskMinWidth
protectedinherited

◆ m_staticTextInfoPaste

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextInfoPaste
protectedinherited

◆ m_staticTextRatio

wxStaticText* PANEL_SETUP_MASK_AND_PASTE_BASE::m_staticTextRatio
protectedinherited

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