KiCad PCB EDA Suite
PANEL_ELECTRICAL_SPACING_BASE Class Referenceabstract

Class PANEL_ELECTRICAL_SPACING_BASE. More...

#include <panel_electrical_spacing_base.h>

Inheritance diagram for PANEL_ELECTRICAL_SPACING_BASE:
CALCULATOR_PANEL PANEL_ELECTRICAL_SPACING

Public Member Functions

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

Protected Member Functions

virtual void OnElectricalSpacingUnitsSelection (wxCommandEvent &event)
 
virtual void OnElectricalSpacingRefresh (wxCommandEvent &event)
 

Protected Attributes

UNIT_SELECTOR_LENm_ElectricalSpacingUnitsSelector
 
wxStaticLine * m_staticline2
 
wxStaticText * m_staticText891
 
wxTextCtrl * m_ElectricalSpacingVoltage
 
wxButton * m_buttonElectSpacingRefresh
 
wxBoxSizer * m_electricalSpacingSizer
 
wxStaticText * m_staticTextElectricalSpacing
 
wxGrid * m_gridElectricalSpacingValues
 
wxStaticText * m_staticText88
 

Detailed Description

Constructor & Destructor Documentation

◆ PANEL_ELECTRICAL_SPACING_BASE()

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

Definition at line 14 of file panel_electrical_spacing_base.cpp.

14  : CALCULATOR_PANEL( parent, id, pos, size, style, name )
15 {
16  wxBoxSizer* bSizerElectricalClearance;
17  bSizerElectricalClearance = new wxBoxSizer( wxHORIZONTAL );
18 
19  wxBoxSizer* bLeftSizerElectricalClearance;
20  bLeftSizerElectricalClearance = new wxBoxSizer( wxVERTICAL );
21 
22  wxArrayString m_ElectricalSpacingUnitsSelectorChoices;
23  m_ElectricalSpacingUnitsSelector = new UNIT_SELECTOR_LEN( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_ElectricalSpacingUnitsSelectorChoices, 0 );
24  m_ElectricalSpacingUnitsSelector->SetSelection( -1 );
25  m_ElectricalSpacingUnitsSelector->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
26 
27  bLeftSizerElectricalClearance->Add( m_ElectricalSpacingUnitsSelector, 0, wxEXPAND|wxALL, 10 );
28 
29  m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
30  bLeftSizerElectricalClearance->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 );
31 
32  m_staticText891 = new wxStaticText( this, wxID_ANY, _("Voltage > 500 V:"), wxDefaultPosition, wxDefaultSize, 0 );
33  m_staticText891->Wrap( -1 );
34  bLeftSizerElectricalClearance->Add( m_staticText891, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
35 
36  m_ElectricalSpacingVoltage = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
37  bLeftSizerElectricalClearance->Add( m_ElectricalSpacingVoltage, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
38 
39  m_buttonElectSpacingRefresh = new wxButton( this, wxID_ANY, _("Update Values"), wxDefaultPosition, wxDefaultSize, 0 );
40  bLeftSizerElectricalClearance->Add( m_buttonElectSpacingRefresh, 0, wxEXPAND|wxALL, 5 );
41 
42 
43  bSizerElectricalClearance->Add( bLeftSizerElectricalClearance, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
44 
45  m_electricalSpacingSizer = new wxBoxSizer( wxVERTICAL );
46 
47  m_staticTextElectricalSpacing = new wxStaticText( this, wxID_ANY, _("Note: Values are minimal values (from IPC 2221)"), wxDefaultPosition, wxDefaultSize, 0 );
49  m_staticTextElectricalSpacing->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), wxFONTFAMILY_DEFAULT, wxFONTSTYLE_ITALIC, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) );
50 
51  m_electricalSpacingSizer->Add( m_staticTextElectricalSpacing, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 );
52 
53  m_gridElectricalSpacingValues = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
54 
55  // Grid
56  m_gridElectricalSpacingValues->CreateGrid( 10, 7 );
57  m_gridElectricalSpacingValues->EnableEditing( false );
58  m_gridElectricalSpacingValues->EnableGridLines( true );
59  m_gridElectricalSpacingValues->EnableDragGridSize( false );
60  m_gridElectricalSpacingValues->SetMargins( 0, 0 );
61 
62  // Columns
63  m_gridElectricalSpacingValues->SetColSize( 0, 100 );
64  m_gridElectricalSpacingValues->SetColSize( 1, 100 );
65  m_gridElectricalSpacingValues->SetColSize( 2, 100 );
66  m_gridElectricalSpacingValues->SetColSize( 3, 100 );
67  m_gridElectricalSpacingValues->SetColSize( 4, 100 );
68  m_gridElectricalSpacingValues->SetColSize( 5, 100 );
69  m_gridElectricalSpacingValues->SetColSize( 6, 100 );
70  m_gridElectricalSpacingValues->EnableDragColMove( false );
71  m_gridElectricalSpacingValues->EnableDragColSize( true );
72  m_gridElectricalSpacingValues->SetColLabelValue( 0, _("B1") );
73  m_gridElectricalSpacingValues->SetColLabelValue( 1, _("B2") );
74  m_gridElectricalSpacingValues->SetColLabelValue( 2, _("B3") );
75  m_gridElectricalSpacingValues->SetColLabelValue( 3, _("B4") );
76  m_gridElectricalSpacingValues->SetColLabelValue( 4, _("A5") );
77  m_gridElectricalSpacingValues->SetColLabelValue( 5, _("A6") );
78  m_gridElectricalSpacingValues->SetColLabelValue( 6, _("A7") );
79  m_gridElectricalSpacingValues->SetColLabelSize( 30 );
80  m_gridElectricalSpacingValues->SetColLabelAlignment( wxALIGN_CENTER, wxALIGN_CENTER );
81 
82  // Rows
83  m_gridElectricalSpacingValues->SetRowSize( 0, 24 );
84  m_gridElectricalSpacingValues->SetRowSize( 1, 24 );
85  m_gridElectricalSpacingValues->SetRowSize( 2, 24 );
86  m_gridElectricalSpacingValues->SetRowSize( 3, 24 );
87  m_gridElectricalSpacingValues->SetRowSize( 4, 24 );
88  m_gridElectricalSpacingValues->SetRowSize( 5, 24 );
89  m_gridElectricalSpacingValues->SetRowSize( 6, 24 );
90  m_gridElectricalSpacingValues->SetRowSize( 7, 24 );
91  m_gridElectricalSpacingValues->SetRowSize( 8, 24 );
92  m_gridElectricalSpacingValues->SetRowSize( 9, 24 );
93  m_gridElectricalSpacingValues->EnableDragRowSize( false );
94  m_gridElectricalSpacingValues->SetRowLabelValue( 0, _("0 .. 15 V") );
95  m_gridElectricalSpacingValues->SetRowLabelValue( 1, _("16 .. 30 V") );
96  m_gridElectricalSpacingValues->SetRowLabelValue( 2, _("31 .. 50 V") );
97  m_gridElectricalSpacingValues->SetRowLabelValue( 3, _("51 .. 100 V") );
98  m_gridElectricalSpacingValues->SetRowLabelValue( 4, _("101 .. 150 V") );
99  m_gridElectricalSpacingValues->SetRowLabelValue( 5, _("151 .. 170 V") );
100  m_gridElectricalSpacingValues->SetRowLabelValue( 6, _("171 .. 250 V") );
101  m_gridElectricalSpacingValues->SetRowLabelValue( 7, _("251 .. 300 V") );
102  m_gridElectricalSpacingValues->SetRowLabelValue( 8, _("301 .. 500 V") );
103  m_gridElectricalSpacingValues->SetRowLabelValue( 9, _(" > 500 V") );
104  m_gridElectricalSpacingValues->SetRowLabelSize( 100 );
105  m_gridElectricalSpacingValues->SetRowLabelAlignment( wxALIGN_RIGHT, wxALIGN_CENTER );
106 
107  // Label Appearance
108 
109  // Cell Defaults
110  m_gridElectricalSpacingValues->SetDefaultCellAlignment( wxALIGN_CENTER, wxALIGN_TOP );
112 
113  m_staticText88 = new wxStaticText( this, wxID_ANY, _("* B1 - Internal Conductors\n* B2 - External Conductors, uncoated, sea level to 3050 m\n* B3 - External Conductors, uncoated, over 3050 m\n* B4 - External Conductors, with permanent polymer coating (any elevation)\n* A5 - External Conductors, with conformal coating over assembly (any elevation)\n* A6 - External Component lead/termination, uncoated\n* A7 - External Component lead termination, with conformal coating (any elevation)"), wxDefaultPosition, wxDefaultSize, 0 );
114  m_staticText88->Wrap( -1 );
115  m_electricalSpacingSizer->Add( m_staticText88, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
116 
117 
118  bSizerElectricalClearance->Add( m_electricalSpacingSizer, 1, wxEXPAND|wxLEFT, 20 );
119 
120 
121  this->SetSizer( bSizerElectricalClearance );
122  this->Layout();
123 
124  // Connect Events
125  m_ElectricalSpacingUnitsSelector->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingUnitsSelection ), NULL, this );
126  m_buttonElectSpacingRefresh->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingRefresh ), NULL, this );
127 }
virtual void OnElectricalSpacingUnitsSelection(wxCommandEvent &event)
virtual void OnElectricalSpacingRefresh(wxCommandEvent &event)
#define _(s)
CALCULATOR_PANEL(wxWindow *aParent, wxWindowID aId, const wxPoint &aPos, const wxSize &aSize, long aStyle, const wxString &aName)
const char * name
Definition: DXF_plotter.cpp:56

References _, m_buttonElectSpacingRefresh, m_electricalSpacingSizer, m_ElectricalSpacingUnitsSelector, m_ElectricalSpacingVoltage, m_gridElectricalSpacingValues, m_staticline2, m_staticText88, m_staticText891, m_staticTextElectricalSpacing, OnElectricalSpacingRefresh(), and OnElectricalSpacingUnitsSelection().

◆ ~PANEL_ELECTRICAL_SPACING_BASE()

PANEL_ELECTRICAL_SPACING_BASE::~PANEL_ELECTRICAL_SPACING_BASE ( )

Definition at line 129 of file panel_electrical_spacing_base.cpp.

130 {
131  // Disconnect Events
132  m_ElectricalSpacingUnitsSelector->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingUnitsSelection ), NULL, this );
133  m_buttonElectSpacingRefresh->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingRefresh ), NULL, this );
134 
135 }
virtual void OnElectricalSpacingUnitsSelection(wxCommandEvent &event)
virtual void OnElectricalSpacingRefresh(wxCommandEvent &event)

References m_buttonElectSpacingRefresh, m_ElectricalSpacingUnitsSelector, OnElectricalSpacingRefresh(), and OnElectricalSpacingUnitsSelection().

Member Function Documentation

◆ LoadSettings()

virtual void CALCULATOR_PANEL::LoadSettings ( PCB_CALCULATOR_SETTINGS aCfg)
pure virtualinherited

Load the settings into the panel.

Parameters
aCfgis the settings structure to load from

Implemented in PANEL_REGULATOR, PANEL_ATTENUATORS, PANEL_COLOR_CODE, PANEL_TRANSLINE, PANEL_BOARD_CLASS, PANEL_ELECTRICAL_SPACING, PANEL_E_SERIE, PANEL_TRACK_WIDTH, and PANEL_VIA_SIZE.

◆ OnElectricalSpacingRefresh()

virtual void PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingRefresh ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_ELECTRICAL_SPACING.

Definition at line 56 of file panel_electrical_spacing_base.h.

56 { event.Skip(); }

Referenced by PANEL_ELECTRICAL_SPACING_BASE(), and ~PANEL_ELECTRICAL_SPACING_BASE().

◆ OnElectricalSpacingUnitsSelection()

virtual void PANEL_ELECTRICAL_SPACING_BASE::OnElectricalSpacingUnitsSelection ( wxCommandEvent &  event)
inlineprotectedvirtual

Reimplemented in PANEL_ELECTRICAL_SPACING.

Definition at line 55 of file panel_electrical_spacing_base.h.

55 { event.Skip(); }

Referenced by PANEL_ELECTRICAL_SPACING_BASE(), and ~PANEL_ELECTRICAL_SPACING_BASE().

◆ SaveSettings()

virtual void CALCULATOR_PANEL::SaveSettings ( PCB_CALCULATOR_SETTINGS aCfg)
pure virtualinherited

Save the settings from the panel.

Parameters
aCfgis the settings structure to save to

Implemented in PANEL_REGULATOR, PANEL_ATTENUATORS, PANEL_COLOR_CODE, PANEL_TRANSLINE, PANEL_BOARD_CLASS, PANEL_ELECTRICAL_SPACING, PANEL_E_SERIE, PANEL_TRACK_WIDTH, and PANEL_VIA_SIZE.

◆ ThemeChanged()

virtual void CALCULATOR_PANEL::ThemeChanged ( )
pure virtualinherited

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

Implemented in PANEL_REGULATOR, PANEL_ATTENUATORS, PANEL_COLOR_CODE, PANEL_TRANSLINE, PANEL_BOARD_CLASS, PANEL_ELECTRICAL_SPACING, PANEL_E_SERIE, PANEL_TRACK_WIDTH, and PANEL_VIA_SIZE.

Member Data Documentation

◆ m_buttonElectSpacingRefresh

wxButton* PANEL_ELECTRICAL_SPACING_BASE::m_buttonElectSpacingRefresh
protected

◆ m_electricalSpacingSizer

wxBoxSizer* PANEL_ELECTRICAL_SPACING_BASE::m_electricalSpacingSizer
protected

Definition at line 49 of file panel_electrical_spacing_base.h.

Referenced by PANEL_ELECTRICAL_SPACING_BASE().

◆ m_ElectricalSpacingUnitsSelector

◆ m_ElectricalSpacingVoltage

wxTextCtrl* PANEL_ELECTRICAL_SPACING_BASE::m_ElectricalSpacingVoltage
protected

◆ m_gridElectricalSpacingValues

wxGrid* PANEL_ELECTRICAL_SPACING_BASE::m_gridElectricalSpacingValues
protected

◆ m_staticline2

wxStaticLine* PANEL_ELECTRICAL_SPACING_BASE::m_staticline2
protected

Definition at line 45 of file panel_electrical_spacing_base.h.

Referenced by PANEL_ELECTRICAL_SPACING_BASE().

◆ m_staticText88

wxStaticText* PANEL_ELECTRICAL_SPACING_BASE::m_staticText88
protected

Definition at line 52 of file panel_electrical_spacing_base.h.

Referenced by PANEL_ELECTRICAL_SPACING_BASE().

◆ m_staticText891

wxStaticText* PANEL_ELECTRICAL_SPACING_BASE::m_staticText891
protected

Definition at line 46 of file panel_electrical_spacing_base.h.

Referenced by PANEL_ELECTRICAL_SPACING_BASE().

◆ m_staticTextElectricalSpacing

wxStaticText* PANEL_ELECTRICAL_SPACING_BASE::m_staticTextElectricalSpacing
protected

Definition at line 50 of file panel_electrical_spacing_base.h.

Referenced by PANEL_ELECTRICAL_SPACING_BASE().


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