New net membership controls for more efficient operation.

(cherry picked from commit f7c5a54)
This commit is contained in:
Jeff Young 2018-07-17 07:52:33 +01:00
parent 977f27f3c4
commit e6b55c9ae5
15 changed files with 2625 additions and 1436 deletions

View File

@ -169,6 +169,8 @@ set( PCBNEW_DIALOGS
dialogs/panel_setup_netclasses_base.cpp
dialogs/panel_setup_text_and_graphics.cpp
dialogs/panel_setup_text_and_graphics_base.cpp
dialogs/panel_setup_tracks_and_vias.cpp
dialogs/panel_setup_tracks_and_vias_base.cpp
footprint_wizard.cpp
footprint_wizard_frame.cpp
footprint_wizard_frame_functions.cpp

View File

@ -22,10 +22,8 @@
#include <panel_setup_text_and_graphics.h>
#include <panel_setup_feature_constraints.h>
#include <panel_setup_netclasses.h>
#include <panel_setup_tracks_and_vias.h>
#include <panel_setup_mask_and_paste.h>
#include <wildcards_and_files_ext.h>
#include <confirm.h>
#include <project.h>
#include <kiface_i.h>
#include "dialog_import_settings.h"
@ -39,6 +37,7 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_textAndGraphics = new PANEL_SETUP_TEXT_AND_GRAPHICS( this, aFrame );
m_constraints = new PANEL_SETUP_FEATURE_CONSTRAINTS( this, aFrame );
m_netclasses = new PANEL_SETUP_NETCLASSES( this, aFrame, m_constraints );
m_tracksAndVias = new PANEL_SETUP_TRACKS_AND_VIAS( this, aFrame, m_constraints );
m_maskAndPaste = new PANEL_SETUP_MASK_AND_PASTE( this, aFrame );
m_treebook->AddPage( m_layers, _( "Layers" ) );
@ -46,8 +45,8 @@ DIALOG_BOARD_SETUP::DIALOG_BOARD_SETUP( PCB_EDIT_FRAME* aFrame ) :
m_treebook->AddPage( m_constraints, _( "Design Rules" ) );
m_treebook->AddSubPage( m_netclasses, _( "Net Classes" ) );
m_treebook->AddSubPage( m_tracksAndVias, _( "Tracks & Vias" ) );
m_treebook->AddSubPage( m_maskAndPaste, _( "Solder Mask/Paste" ) );
}

View File

@ -23,12 +23,12 @@
#include <widgets/paged_dialog.h>
class PCB_EDIT_FRAME;
class PANEL_SETUP_FEATURE_CONSTRAINTS;
class PANEL_SETUP_LAYERS;
class PANEL_SETUP_TEXT_AND_GRAPHICS;
class PANEL_SETUP_NETCLASSES;
class PANEL_SETUP_TRACKS_AND_VIAS;
class PANEL_SETUP_MASK_AND_PASTE;
@ -46,6 +46,7 @@ protected:
PANEL_SETUP_LAYERS* m_layers;
PANEL_SETUP_TEXT_AND_GRAPHICS* m_textAndGraphics;
PANEL_SETUP_NETCLASSES* m_netclasses;
PANEL_SETUP_TRACKS_AND_VIAS* m_tracksAndVias;
PANEL_SETUP_MASK_AND_PASTE* m_maskAndPaste;
};

View File

@ -27,20 +27,16 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
sbFeatureRules->Add( 0, 0, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
m_OptRequireCourtyards = new wxCheckBox( this, wxID_ANY, _("Require courtyard definitions in footprints"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptRequireCourtyards->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) );
sbFeatureRules->Add( m_OptRequireCourtyards, 0, wxTOP|wxRIGHT, 5 );
m_OptOverlappingCourtyards = new wxCheckBox( this, wxID_ANY, _("Prohibit overlapping courtyards"), wxDefaultPosition, wxDefaultSize, 0 );
m_OptOverlappingCourtyards->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) );
sbFeatureRules->Add( m_OptOverlappingCourtyards, 0, wxTOP|wxBOTTOM|wxRIGHT, 5 );
bMainSizer->Add( sbFeatureRules, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
bMainSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 15 );
bMainSizer->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 25 );
wxBoxSizer* sbFeatureConstraints;
sbFeatureConstraints = new wxBoxSizer( wxVERTICAL );
@ -56,7 +52,9 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_TrackMinWidthTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT|wxBOTTOM, 5 );
m_TrackMinWidthCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_TrackMinWidthCtrl, 0, wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxBOTTOM|wxLEFT, 5 );
m_TrackMinWidthCtrl->SetMinSize( wxSize( 120,-1 ) );
fgFeatureConstraints->Add( m_TrackMinWidthCtrl, 0, wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_TrackMinWidthUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_TrackMinWidthUnits->Wrap( -1 );
@ -76,7 +74,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_ViaMinTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_SetViasMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxLEFT, 5 );
fgFeatureConstraints->Add( m_SetViasMinSizeCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_ViaMinUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_ViaMinUnits->Wrap( -1 );
@ -87,7 +85,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_ViaMinDrillTitle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_SetViasMinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_SetViasMinDrillCtrl, 0, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
fgFeatureConstraints->Add( m_SetViasMinDrillCtrl, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_ViaMinDrillUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_ViaMinDrillUnits->Wrap( -1 );
@ -107,7 +105,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_uviaMinSizeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_uviaMinSizeCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_uviaMinSizeCtrl, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
fgFeatureConstraints->Add( m_uviaMinSizeCtrl, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
m_uviaMinSizeUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_uviaMinSizeUnits->Wrap( -1 );
@ -118,7 +116,7 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
fgFeatureConstraints->Add( m_uviaMinDrillLabel, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_LEFT, 5 );
m_uviaMinDrillCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
fgFeatureConstraints->Add( m_uviaMinDrillCtrl, 0, wxEXPAND|wxLEFT, 5 );
fgFeatureConstraints->Add( m_uviaMinDrillCtrl, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_uviaMinDrillUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, wxALIGN_LEFT );
m_uviaMinDrillUnits->Wrap( -1 );
@ -135,14 +133,10 @@ PANEL_SETUP_FEATURE_CONSTRAINTS_BASE::PANEL_SETUP_FEATURE_CONSTRAINTS_BASE( wxWi
m_HoleToHoleTitle = new wxStaticText( this, wxID_ANY, _("Minimum hole to hole:"), wxDefaultPosition, wxDefaultSize, 0 );
m_HoleToHoleTitle->Wrap( -1 );
m_HoleToHoleTitle->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) );
fgFeatureConstraints->Add( m_HoleToHoleTitle, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxTOP, 5 );
m_SetHoleToHoleCtrl = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
m_SetHoleToHoleCtrl->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) );
fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 );
fgFeatureConstraints->Add( m_SetHoleToHoleCtrl, 0, wxEXPAND|wxALL, 5 );
m_HoleToHoleUnits = new wxStaticText( this, wxID_ANY, _("mm"), wxDefaultPosition, wxDefaultSize, 0 );
m_HoleToHoleUnits->Wrap( -1 );

View File

@ -292,7 +292,7 @@
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg">wxSYS_COLOUR_INFOBK</property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
@ -380,7 +380,7 @@
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg">wxSYS_COLOUR_INFOBK</property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
@ -457,7 +457,7 @@
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">15</property>
<property name="border">25</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="spacer" expanded="1">
@ -576,7 +576,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxBOTTOM|wxLEFT</property>
<property name="flag">wxALIGN_LEFT|wxALIGN_TOP|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -612,7 +612,7 @@
<property name="maxlength"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="minimum_size">120,-1</property>
<property name="moveable">1</property>
<property name="name">m_TrackMinWidthCtrl</property>
<property name="pane_border">1</property>
@ -863,7 +863,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1120,7 +1120,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxLEFT</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1407,7 +1407,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxLEFT</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1664,7 +1664,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1880,7 +1880,7 @@
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg">wxSYS_COLOUR_INFOBK</property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
@ -1951,7 +1951,7 @@
</object>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxBOTTOM|wxLEFT</property>
<property name="flag">wxEXPAND|wxALL</property>
<property name="proportion">0</property>
<object class="wxTextCtrl" expanded="0">
<property name="BottomDockable">1</property>
@ -1963,7 +1963,7 @@
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg">wxSYS_COLOUR_INFOBK</property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>

View File

@ -72,17 +72,14 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, PCB_EDIT_
// all our grids for consistency
m_netclassGrid->SetDefaultRowSize( m_netclassGrid->GetDefaultRowSize() + 4 );
m_membershipGrid->SetDefaultRowSize( m_membershipGrid->GetDefaultRowSize() + 4 );
m_trackWidthsGrid->SetDefaultRowSize( m_trackWidthsGrid->GetDefaultRowSize() + 4 );
m_viaSizesGrid->SetDefaultRowSize( m_viaSizesGrid->GetDefaultRowSize() + 4 );
m_diffPairsGrid->SetDefaultRowSize( m_diffPairsGrid->GetDefaultRowSize() + 4 );
m_textNetFilter->SetHint( _( "Net filter" ) );
// Set up the net name column of the netclass membership grid to read-only
wxGridCellAttr* attr = new wxGridCellAttr;
attr->SetReadOnly( true );
m_membershipGrid->SetColAttr( 0, attr );
m_membershipGrid->SetSelectionMode( wxGrid::wxGridSelectRows );
m_addButton->SetBitmap( KiBitmap( small_plus_xpm ) );
m_removeButton->SetBitmap( KiBitmap( trash_xpm ) );
@ -167,8 +164,6 @@ bool PANEL_SETUP_NETCLASSES::TransferDataToWindow()
addNet( *name, netclass->GetName() );
}
TransferDimensionListsToWindow();
return true;
}
@ -184,44 +179,6 @@ void PANEL_SETUP_NETCLASSES::addNet( wxString netName, const wxString& netclass
}
void PANEL_SETUP_NETCLASSES::TransferDimensionListsToWindow()
{
#define SETCELL( grid, row, col, val ) \
grid->SetCellValue( row, col, StringFromValue( m_Frame->GetUserUnits(), val, true, true ) )
m_trackWidthsGrid->ClearGrid();
m_viaSizesGrid->ClearGrid();
m_diffPairsGrid->ClearGrid();
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_TrackWidthList.size(); ii++ )
{
SETCELL( m_trackWidthsGrid, ii-1, 0, m_BrdSettings->m_TrackWidthList[ii] );
}
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_ViasDimensionsList.size(); ii++ )
{
SETCELL( m_viaSizesGrid, ii-1, 0, m_BrdSettings->m_ViasDimensionsList[ii].m_Diameter );
if( m_BrdSettings->m_ViasDimensionsList[ii].m_Drill > 0 )
SETCELL( m_viaSizesGrid, ii-1, 1, m_BrdSettings->m_ViasDimensionsList[ii].m_Drill );
}
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_DiffPairDimensionsList.size(); ii++ )
{
SETCELL( m_diffPairsGrid, ii-1, 0, m_BrdSettings->m_DiffPairDimensionsList[ii].m_Width );
if( m_BrdSettings->m_DiffPairDimensionsList[ii].m_Gap > 0 )
SETCELL( m_diffPairsGrid, ii-1, 1, m_BrdSettings->m_DiffPairDimensionsList[ii].m_Gap );
if( m_BrdSettings->m_DiffPairDimensionsList[ii].m_ViaGap > 0 )
SETCELL( m_diffPairsGrid, ii-1, 2, m_BrdSettings->m_DiffPairDimensionsList[ii].m_ViaGap );
}
}
/* Populates drop-downs with the list of net classes
*/
void PANEL_SETUP_NETCLASSES::rebuildNetclassDropdowns()
@ -238,6 +195,11 @@ void PANEL_SETUP_NETCLASSES::rebuildNetclassDropdowns()
wxGridCellAttr* attr = new wxGridCellAttr;
attr->SetEditor( new wxGridCellChoiceEditor( netclassNames ) );
m_membershipGrid->SetColAttr( 1, attr );
m_assignNetClass->Set( netclassNames );
netclassNames.Insert( wxEmptyString, 0 );
m_netClassFilter->Set( netclassNames );
}
@ -260,8 +222,11 @@ static void gridRowToNetclass( EDA_UNITS_T aUnits, wxGrid* grid, int row, const
}
void PANEL_SETUP_NETCLASSES::CopyNetclassesToBoard()
bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
{
if( !validateData() )
return false;
NETCLASSES& netclasses = m_BrdSettings->m_NetClasses;
// Remove all netclasses from board. We'll copy new list after
@ -289,86 +254,6 @@ void PANEL_SETUP_NETCLASSES::CopyNetclassesToBoard()
}
m_Pcb->SynchronizeNetsAndNetClasses();
}
void PANEL_SETUP_NETCLASSES::CopyDimensionsListsToBoard()
{
wxString msg;
std::vector<int> trackWidths;
std::vector<VIA_DIMENSION> vias;
std::vector<DIFF_PAIR_DIMENSION> diffPairs;
for( int row = 0; row < m_trackWidthsGrid->GetNumberRows(); ++row )
{
msg = m_trackWidthsGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
trackWidths.push_back( ValueFromString( m_Frame->GetUserUnits(), msg, true ) );
}
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
msg = m_viaSizesGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
{
VIA_DIMENSION via_dim;
via_dim.m_Diameter = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_viaSizesGrid->GetCellValue( row, 1 );
if( !msg.IsEmpty() )
via_dim.m_Drill = ValueFromString( m_Frame->GetUserUnits(), msg, true );
vias.push_back( via_dim );
}
}
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
msg = m_diffPairsGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
{
DIFF_PAIR_DIMENSION diffPair_dim;
diffPair_dim.m_Width = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_diffPairsGrid->GetCellValue( row, 1 );
diffPair_dim.m_Gap = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_diffPairsGrid->GetCellValue( row, 2 );
if( !msg.IsEmpty() )
diffPair_dim.m_ViaGap = ValueFromString( m_Frame->GetUserUnits(), msg, true );
diffPairs.push_back( diffPair_dim );
}
}
// Sort lists by increasing value
sort( trackWidths.begin(), trackWidths.end() );
sort( vias.begin(), vias.end() );
sort( diffPairs.begin(), diffPairs.end() );
trackWidths.insert( trackWidths.begin(), m_BrdSettings->m_TrackWidthList[ 0 ] );
m_BrdSettings->m_TrackWidthList = trackWidths;
vias.insert( vias.begin(), m_BrdSettings->m_ViasDimensionsList[ 0 ] );
m_BrdSettings->m_ViasDimensionsList = vias;
diffPairs.insert( diffPairs.begin(), m_BrdSettings->m_DiffPairDimensionsList[ 0 ] );
m_BrdSettings->m_DiffPairDimensionsList = diffPairs;
}
bool PANEL_SETUP_NETCLASSES::TransferDataFromWindow()
{
if( !validateData() )
return false;
CopyNetclassesToBoard();
CopyDimensionsListsToBoard();
m_BrdSettings->SetCurrentNetClass( NETCLASS::Default );
return true;
@ -511,19 +396,33 @@ void PANEL_SETUP_NETCLASSES::OnSizeMembershipGrid( wxSizeEvent& event )
}
void PANEL_SETUP_NETCLASSES::OnFilterChanged( wxCommandEvent& event )
void PANEL_SETUP_NETCLASSES::doApplyFilters( bool aShowAll )
{
wxString filter = m_textNetFilter->GetValue().MakeLower();
// Commit any pending in-place edits in the membership grid
m_membershipGrid->DisableCellEditControl();
if( filter.IsEmpty() )
filter = wxT( "*" );
else
filter = wxT( "*" ) + filter + wxT( "*" );
wxString netClassFilter = m_netClassFilter->GetStringSelection();
wxString netFilter = m_netNameFilter->GetValue().MakeLower();
if( !netFilter.IsEmpty() )
netFilter = wxT( "*" ) + netFilter + wxT( "*" );
for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
{
if( m_membershipGrid->GetCellValue( row, 0 ).MakeLower().Matches( filter )
|| m_membershipGrid->GetCellValue( row, 1 ).MakeLower().Matches( filter ) )
wxString net = m_membershipGrid->GetCellValue( row, 0 );
wxString netClass = m_membershipGrid->GetCellValue( row, 1 );
bool show = true;
if( !aShowAll )
{
if( !netFilter.IsEmpty() && !net.MakeLower().Matches( netFilter ) )
show = false;
if( !netClassFilter.IsEmpty() && netClass != netClassFilter )
show = false;
}
if( show )
m_membershipGrid->ShowRow( row );
else
m_membershipGrid->HideRow( row );
@ -531,6 +430,26 @@ void PANEL_SETUP_NETCLASSES::OnFilterChanged( wxCommandEvent& event )
}
void PANEL_SETUP_NETCLASSES::doAssignments( bool aAssignAll )
{
// Commit any pending in-place edits in the membership grid
m_membershipGrid->DisableCellEditControl();
wxArrayInt selectedRows = m_membershipGrid->GetSelectedRows();
for( int row = 0; row < m_membershipGrid->GetNumberRows(); ++row )
{
if( !m_membershipGrid->IsRowShown( row ) )
continue;
if( !aAssignAll && selectedRows.Index( row ) == wxNOT_FOUND )
continue;
m_membershipGrid->SetCellValue( row, 1, m_assignNetClass->GetStringSelection() );
}
}
void PANEL_SETUP_NETCLASSES::OnUpdateUI( wxUpdateUIEvent& event )
{
if( m_netclassesDirty )
@ -552,9 +471,6 @@ bool PANEL_SETUP_NETCLASSES::validateData()
// Commit any pending in-place edits and close editors from grid controls
m_netclassGrid->DisableCellEditControl();
m_membershipGrid->DisableCellEditControl();
m_trackWidthsGrid->DisableCellEditControl();
m_viaSizesGrid->DisableCellEditControl();
m_diffPairsGrid->DisableCellEditControl();
wxString msg;
int minViaDia = m_ConstraintsPanel->m_viaMinSize.GetValue();
@ -638,65 +554,6 @@ bool PANEL_SETUP_NETCLASSES::validateData()
}
}
// Test custom tracks
for( int row = 0; row < m_trackWidthsGrid->GetNumberRows(); ++row )
{
wxString tvalue = m_trackWidthsGrid->GetCellValue( row, 0 );
if( tvalue.IsEmpty() )
continue;
if( ValueFromString( m_Frame->GetUserUnits(), tvalue ) < minTrackWidth )
{
msg.Printf( _( "Track width less than minimum track width (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minTrackWidth, true, true ) );
m_Parent->SetError( msg, this, m_trackWidthsGrid, row, 0 );
return false;
}
}
// Test custom vias
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
wxString viaDia = m_viaSizesGrid->GetCellValue( row, 0 );
if( viaDia.IsEmpty() )
continue;
if( ValueFromString( m_Frame->GetUserUnits(), viaDia ) < minViaDia )
{
msg.Printf( _( "Via diameter less than minimum via diameter (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDia, true, true ) );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 0 );
return false;
}
wxString viaDrill = m_viaSizesGrid->GetCellValue( row, 1 );
if( viaDrill.IsEmpty() )
{
msg = _( "No via drill defined." );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill ) < minViaDrill )
{
msg.Printf( _( "Via drill less than minimum via drill (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDrill, true, true ) );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill )
>= ValueFromString( m_Frame->GetUserUnits(), viaDia ) )
{
msg = _( "Via drill larger than via diameter." );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
}
return true;
}

View File

@ -58,21 +58,20 @@ private:
void OnSizeMembershipGrid( wxSizeEvent& event ) override;
void OnUpdateUI( wxUpdateUIEvent &event ) override;
void OnNetclassGridCellChanging( wxGridEvent& event );
void OnFilterChanged( wxCommandEvent& event ) override;
void OnShowAll( wxCommandEvent& event ) override { doApplyFilters( true ); }
void OnApplyFilters( wxCommandEvent& event ) override { doApplyFilters( false ); }
void OnAssignAll( wxCommandEvent& event ) override { doAssignments( true ); }
void OnAssignSelected( wxCommandEvent& event ) override { doAssignments( false ); }
bool validateNetclassName( int aRow, wxString aName, bool focusFirst = true );
bool validateData();
void rebuildNetclassDropdowns();
/* Populates the lists of sizes (Tracks width list and Vias diameters & drill list) */
void TransferDimensionListsToWindow();
void CopyDimensionsListsToBoard( );
int getNetclassValue( int aRow, int aCol );
void CopyNetclassesToBoard();
void addNet( wxString netName, const wxString& netclass );
void doApplyFilters( bool aShowAll );
void doAssignments( bool aAssignAll );
void AdjustNetclassGridColumns( int aWidth );
void AdjustMembershipGridColumns( int aWidth );

View File

@ -16,6 +16,9 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
wxBoxSizer* bpanelNetClassesSizer;
bpanelNetClassesSizer = new wxBoxSizer( wxVERTICAL );
wxBoxSizer* bMargins;
bMargins = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbSizerUpper;
sbSizerUpper = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Classes") ), wxVERTICAL );
@ -31,14 +34,14 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
// Columns
m_netclassGrid->SetColSize( 0, 120 );
m_netclassGrid->SetColSize( 1, 88 );
m_netclassGrid->SetColSize( 2, 88 );
m_netclassGrid->SetColSize( 3, 88 );
m_netclassGrid->SetColSize( 4, 88 );
m_netclassGrid->SetColSize( 5, 88 );
m_netclassGrid->SetColSize( 6, 88 );
m_netclassGrid->SetColSize( 7, 88 );
m_netclassGrid->SetColSize( 8, 88 );
m_netclassGrid->SetColSize( 1, 85 );
m_netclassGrid->SetColSize( 2, 85 );
m_netclassGrid->SetColSize( 3, 85 );
m_netclassGrid->SetColSize( 4, 85 );
m_netclassGrid->SetColSize( 5, 85 );
m_netclassGrid->SetColSize( 6, 85 );
m_netclassGrid->SetColSize( 7, 85 );
m_netclassGrid->SetColSize( 8, 85 );
m_netclassGrid->EnableDragColMove( false );
m_netclassGrid->EnableDragColSize( true );
m_netclassGrid->SetColLabelSize( 22 );
@ -65,7 +68,7 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
m_netclassGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
m_netclassGrid->SetToolTip( _("Net Class parameters") );
sbSizerUpper->Add( m_netclassGrid, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
sbSizerUpper->Add( m_netclassGrid, 1, wxEXPAND, 5 );
wxBoxSizer* buttonBoxSizer;
buttonBoxSizer = new wxBoxSizer( wxHORIZONTAL );
@ -78,22 +81,116 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
m_removeButton = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW );
m_removeButton->SetMinSize( wxSize( 29,29 ) );
buttonBoxSizer->Add( m_removeButton, 0, wxRIGHT, 10 );
buttonBoxSizer->Add( m_removeButton, 0, 0, 10 );
sbSizerUpper->Add( buttonBoxSizer, 0, wxEXPAND|wxALL, 2 );
sbSizerUpper->Add( buttonBoxSizer, 0, wxEXPAND|wxTOP, 2 );
bpanelNetClassesSizer->Add( sbSizerUpper, 4, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bMargins->Add( sbSizerUpper, 4, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerLower;
bSizerLower = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbMembership;
sbMembership = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Class Memberships") ), wxHORIZONTAL );
wxStaticBoxSizer* sbSizerNetSelectMain;
sbSizerNetSelectMain = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Net Class Membership") ), wxVERTICAL );
wxBoxSizer* bLeft;
bLeft = new wxBoxSizer( wxVERTICAL );
m_textNetFilter = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
sbSizerNetSelectMain->Add( m_textNetFilter, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbFilters;
sbFilters = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filter Nets") ), wxVERTICAL );
wxBoxSizer* bSizer9;
bSizer9 = new wxBoxSizer( wxHORIZONTAL );
m_staticText6 = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net class filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText6->Wrap( -1 );
m_staticText6->SetMinSize( wxSize( 120,-1 ) );
bSizer9->Add( m_staticText6, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
wxArrayString m_netClassFilterChoices;
m_netClassFilter = new wxChoice( sbFilters->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_netClassFilterChoices, 0 );
m_netClassFilter->SetSelection( 0 );
bSizer9->Add( m_netClassFilter, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
sbFilters->Add( bSizer9, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxHORIZONTAL );
m_filterLabel = new wxStaticText( sbFilters->GetStaticBox(), wxID_ANY, _("Net name filter:"), wxDefaultPosition, wxDefaultSize, 0 );
m_filterLabel->Wrap( -1 );
m_filterLabel->SetMinSize( wxSize( 120,-1 ) );
bSizer10->Add( m_filterLabel, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
m_netNameFilter = new wxTextCtrl( sbFilters->GetStaticBox(), wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
bSizer10->Add( m_netNameFilter, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxALL, 5 );
sbFilters->Add( bSizer10, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer13;
bSizer13 = new wxBoxSizer( wxHORIZONTAL );
m_showAllButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Show All Nets"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer13->Add( m_showAllButton, 1, wxALL, 5 );
bSizer13->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_filterNetsButton = new wxButton( sbFilters->GetStaticBox(), wxID_ANY, _("Apply Filters"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer13->Add( m_filterNetsButton, 1, wxALL, 5 );
sbFilters->Add( bSizer13, 1, wxEXPAND|wxTOP|wxBOTTOM, 6 );
bLeft->Add( sbFilters, 0, wxEXPAND|wxBOTTOM, 5 );
wxStaticBoxSizer* sbEdit;
sbEdit = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Assign Net Class") ), wxVERTICAL );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxHORIZONTAL );
m_assignLabel = new wxStaticText( sbEdit->GetStaticBox(), wxID_ANY, _("New net class:"), wxDefaultPosition, wxDefaultSize, 0 );
m_assignLabel->Wrap( -1 );
m_assignLabel->SetMinSize( wxSize( 120,-1 ) );
bSizer11->Add( m_assignLabel, 0, wxALL, 5 );
wxArrayString m_assignNetClassChoices;
m_assignNetClass = new wxChoice( sbEdit->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_assignNetClassChoices, 0 );
m_assignNetClass->SetSelection( 0 );
bSizer11->Add( m_assignNetClass, 1, wxALL, 5 );
sbEdit->Add( bSizer11, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxHORIZONTAL );
m_assignAllButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Listed Nets"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer12->Add( m_assignAllButton, 1, wxALL, 5 );
bSizer12->Add( 0, 0, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_assignSelectedButton = new wxButton( sbEdit->GetStaticBox(), wxID_ANY, _("Assign To Selected Nets"), wxDefaultPosition, wxDefaultSize, 0 );
bSizer12->Add( m_assignSelectedButton, 1, wxALL, 5 );
sbEdit->Add( bSizer12, 0, wxEXPAND|wxTOP, 6 );
bLeft->Add( sbEdit, 1, wxEXPAND|wxTOP, 8 );
sbMembership->Add( bLeft, 1, wxEXPAND|wxRIGHT, 5 );
wxBoxSizer* bRight;
bRight = new wxBoxSizer( wxVERTICAL );
m_membershipGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
@ -121,164 +218,16 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
// Cell Defaults
m_membershipGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbSizerNetSelectMain->Add( m_membershipGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bRight->Add( m_membershipGrid, 1, wxEXPAND|wxBOTTOM|wxLEFT, 5 );
bSizerLower->Add( sbSizerNetSelectMain, 1, wxEXPAND|wxTOP|wxRIGHT, 5 );
wxStaticBoxSizer* sbOtherValuesSizer;
sbOtherValuesSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Non-netclass Predefined Values") ), wxHORIZONTAL );
wxBoxSizer* bSizer10;
bSizer10 = new wxBoxSizer( wxVERTICAL );
m_staticText24 = new wxStaticText( this, wxID_ANY, _("Tracks:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText24->Wrap( -1 );
bSizer10->Add( m_staticText24, 0, wxRIGHT|wxLEFT, 5 );
m_trackWidthsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_trackWidthsGrid->CreateGrid( 8, 1 );
m_trackWidthsGrid->EnableEditing( true );
m_trackWidthsGrid->EnableGridLines( true );
m_trackWidthsGrid->EnableDragGridSize( false );
m_trackWidthsGrid->SetMargins( 0, 0 );
// Columns
m_trackWidthsGrid->SetColSize( 0, 78 );
m_trackWidthsGrid->EnableDragColMove( false );
m_trackWidthsGrid->EnableDragColSize( false );
m_trackWidthsGrid->SetColLabelSize( 22 );
m_trackWidthsGrid->SetColLabelValue( 0, _("Width") );
m_trackWidthsGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_trackWidthsGrid->EnableDragRowSize( false );
m_trackWidthsGrid->SetRowLabelSize( 0 );
m_trackWidthsGrid->SetRowLabelValue( 0, _("Track 1") );
m_trackWidthsGrid->SetRowLabelValue( 1, _("Track 2") );
m_trackWidthsGrid->SetRowLabelValue( 2, _("Track 3") );
m_trackWidthsGrid->SetRowLabelValue( 3, _("Track 4") );
m_trackWidthsGrid->SetRowLabelValue( 4, _("Track 5") );
m_trackWidthsGrid->SetRowLabelValue( 5, _("Track 6") );
m_trackWidthsGrid->SetRowLabelValue( 6, _("Track 7") );
m_trackWidthsGrid->SetRowLabelValue( 7, _("Track 8") );
m_trackWidthsGrid->SetRowLabelValue( 8, _("Track 9") );
m_trackWidthsGrid->SetRowLabelValue( 9, _("Track 10") );
m_trackWidthsGrid->SetRowLabelValue( 10, _("Track 11") );
m_trackWidthsGrid->SetRowLabelValue( 11, _("Track 12") );
m_trackWidthsGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_trackWidthsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bSizer10->Add( m_trackWidthsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbMembership->Add( bRight, 1, wxEXPAND|wxLEFT, 5 );
sbOtherValuesSizer->Add( bSizer10, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer11;
bSizer11 = new wxBoxSizer( wxVERTICAL );
m_staticText25 = new wxStaticText( this, wxID_ANY, _("Vias:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText25->Wrap( -1 );
bSizer11->Add( m_staticText25, 0, wxRIGHT|wxLEFT, 5 );
m_viaSizesGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_viaSizesGrid->CreateGrid( 8, 2 );
m_viaSizesGrid->EnableEditing( true );
m_viaSizesGrid->EnableGridLines( true );
m_viaSizesGrid->EnableDragGridSize( false );
m_viaSizesGrid->SetMargins( 0, 0 );
// Columns
m_viaSizesGrid->SetColSize( 0, 78 );
m_viaSizesGrid->SetColSize( 1, 78 );
m_viaSizesGrid->EnableDragColMove( false );
m_viaSizesGrid->EnableDragColSize( false );
m_viaSizesGrid->SetColLabelSize( 22 );
m_viaSizesGrid->SetColLabelValue( 0, _("Size") );
m_viaSizesGrid->SetColLabelValue( 1, _("Drill") );
m_viaSizesGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_viaSizesGrid->EnableDragRowSize( false );
m_viaSizesGrid->SetRowLabelSize( 0 );
m_viaSizesGrid->SetRowLabelValue( 0, _("Via 1") );
m_viaSizesGrid->SetRowLabelValue( 1, _("Via 2") );
m_viaSizesGrid->SetRowLabelValue( 2, _("Via 3") );
m_viaSizesGrid->SetRowLabelValue( 3, _("Via 4") );
m_viaSizesGrid->SetRowLabelValue( 4, _("Via 5") );
m_viaSizesGrid->SetRowLabelValue( 5, _("Via 6") );
m_viaSizesGrid->SetRowLabelValue( 6, _("Via 7") );
m_viaSizesGrid->SetRowLabelValue( 7, _("Via 8") );
m_viaSizesGrid->SetRowLabelValue( 8, _("Via 9") );
m_viaSizesGrid->SetRowLabelValue( 9, _("Via 10") );
m_viaSizesGrid->SetRowLabelValue( 10, _("Via 11") );
m_viaSizesGrid->SetRowLabelValue( 11, _("Via 12") );
m_viaSizesGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_viaSizesGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bSizer11->Add( m_viaSizesGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bMargins->Add( sbMembership, 5, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
sbOtherValuesSizer->Add( bSizer11, 0, wxEXPAND|wxLEFT, 5 );
wxBoxSizer* bSizer12;
bSizer12 = new wxBoxSizer( wxVERTICAL );
m_staticText26 = new wxStaticText( this, wxID_ANY, _("Differential Pairs:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
bSizer12->Add( m_staticText26, 0, wxRIGHT|wxLEFT, 5 );
m_diffPairsGrid = new WX_GRID( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_diffPairsGrid->CreateGrid( 8, 3 );
m_diffPairsGrid->EnableEditing( true );
m_diffPairsGrid->EnableGridLines( true );
m_diffPairsGrid->EnableDragGridSize( false );
m_diffPairsGrid->SetMargins( 0, 0 );
// Columns
m_diffPairsGrid->SetColSize( 0, 78 );
m_diffPairsGrid->SetColSize( 1, 78 );
m_diffPairsGrid->SetColSize( 2, 78 );
m_diffPairsGrid->EnableDragColMove( false );
m_diffPairsGrid->EnableDragColSize( true );
m_diffPairsGrid->SetColLabelSize( 22 );
m_diffPairsGrid->SetColLabelValue( 0, _("Width") );
m_diffPairsGrid->SetColLabelValue( 1, _("Gap") );
m_diffPairsGrid->SetColLabelValue( 2, _("Via Gap") );
m_diffPairsGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_diffPairsGrid->EnableDragRowSize( true );
m_diffPairsGrid->SetRowLabelSize( 0 );
m_diffPairsGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_diffPairsGrid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INFOBK ) );
m_diffPairsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
bSizer12->Add( m_diffPairsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
sbOtherValuesSizer->Add( bSizer12, 0, wxEXPAND|wxLEFT, 5 );
bSizerLower->Add( sbOtherValuesSizer, 0, wxEXPAND|wxTOP|wxLEFT, 5 );
bpanelNetClassesSizer->Add( bSizerLower, 5, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );
bpanelNetClassesSizer->Add( bMargins, 1, wxEXPAND|wxRIGHT, 5 );
this->SetSizer( bpanelNetClassesSizer );
@ -289,7 +238,10 @@ PANEL_SETUP_NETCLASSES_BASE::PANEL_SETUP_NETCLASSES_BASE( wxWindow* parent, wxWi
m_netclassGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
m_addButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
m_textNetFilter->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnFilterChanged ), NULL, this );
m_showAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
m_filterNetsButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
m_assignAllButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
m_assignSelectedButton->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
m_membershipGrid->Connect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
m_membershipGrid->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ), NULL, this );
}
@ -300,7 +252,10 @@ PANEL_SETUP_NETCLASSES_BASE::~PANEL_SETUP_NETCLASSES_BASE()
m_netclassGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeNetclassGrid ), NULL, this );
m_addButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAddNetclassClick ), NULL, this );
m_removeButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnRemoveNetclassClick ), NULL, this );
m_textNetFilter->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnFilterChanged ), NULL, this );
m_showAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnShowAll ), NULL, this );
m_filterNetsButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnApplyFilters ), NULL, this );
m_assignAllButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignAll ), NULL, this );
m_assignSelectedButton->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnAssignSelected ), NULL, this );
m_membershipGrid->Disconnect( wxEVT_SIZE, wxSizeEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnSizeMembershipGrid ), NULL, this );
m_membershipGrid->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( PANEL_SETUP_NETCLASSES_BASE::OnUpdateUI ), NULL, this );

File diff suppressed because it is too large Load Diff

View File

@ -26,8 +26,9 @@ class WX_GRID;
#include <wx/button.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/textctrl.h>
#include <wx/stattext.h>
#include <wx/choice.h>
#include <wx/textctrl.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
@ -43,20 +44,26 @@ class PANEL_SETUP_NETCLASSES_BASE : public wxPanel
WX_GRID* m_netclassGrid;
wxBitmapButton* m_addButton;
wxBitmapButton* m_removeButton;
wxTextCtrl* m_textNetFilter;
wxStaticText* m_staticText6;
wxChoice* m_netClassFilter;
wxStaticText* m_filterLabel;
wxTextCtrl* m_netNameFilter;
wxButton* m_showAllButton;
wxButton* m_filterNetsButton;
wxStaticText* m_assignLabel;
wxChoice* m_assignNetClass;
wxButton* m_assignAllButton;
wxButton* m_assignSelectedButton;
WX_GRID* m_membershipGrid;
wxStaticText* m_staticText24;
WX_GRID* m_trackWidthsGrid;
wxStaticText* m_staticText25;
WX_GRID* m_viaSizesGrid;
wxStaticText* m_staticText26;
WX_GRID* m_diffPairsGrid;
// Virtual event handlers, overide them in your derived class
virtual void OnSizeNetclassGrid( wxSizeEvent& event ) { event.Skip(); }
virtual void OnAddNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnRemoveNetclassClick( wxCommandEvent& event ) { event.Skip(); }
virtual void OnFilterChanged( wxCommandEvent& event ) { event.Skip(); }
virtual void OnShowAll( wxCommandEvent& event ) { event.Skip(); }
virtual void OnApplyFilters( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAssignAll( wxCommandEvent& event ) { event.Skip(); }
virtual void OnAssignSelected( wxCommandEvent& event ) { event.Skip(); }
virtual void OnSizeMembershipGrid( wxSizeEvent& event ) { event.Skip(); }
virtual void OnUpdateUI( wxUpdateUIEvent& event ) { event.Skip(); }

View File

@ -0,0 +1,258 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <fctsys.h>
#include <class_drawpanel.h>
#include <base_units.h>
#include <pcb_edit_frame.h>
#include <board_design_settings.h>
#include <widgets/wx_grid.h>
#include <panel_setup_tracks_and_vias.h>
PANEL_SETUP_TRACKS_AND_VIAS::PANEL_SETUP_TRACKS_AND_VIAS(
PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame,
PANEL_SETUP_FEATURE_CONSTRAINTS* aConstraintsPanel ) :
PANEL_SETUP_TRACKS_AND_VIAS_BASE( aParent->GetTreebook() )
{
m_Parent = aParent;
m_Frame = aFrame;
m_Pcb = m_Frame->GetBoard();
m_BrdSettings = &m_Pcb->GetDesignSettings();
m_ConstraintsPanel = aConstraintsPanel;
// Membership combobox editors require a bit more room, so increase the row size of
// all our grids for consistency
m_trackWidthsGrid->SetDefaultRowSize( m_trackWidthsGrid->GetDefaultRowSize() + 4 );
m_viaSizesGrid->SetDefaultRowSize( m_viaSizesGrid->GetDefaultRowSize() + 4 );
m_diffPairsGrid->SetDefaultRowSize( m_diffPairsGrid->GetDefaultRowSize() + 4 );
}
bool PANEL_SETUP_TRACKS_AND_VIAS::TransferDataToWindow()
{
#define SETCELL( grid, row, col, val ) \
grid->SetCellValue( row, col, StringFromValue( m_Frame->GetUserUnits(), val, true, true ) )
m_trackWidthsGrid->ClearGrid();
m_viaSizesGrid->ClearGrid();
m_diffPairsGrid->ClearGrid();
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_TrackWidthList.size(); ii++ )
{
SETCELL( m_trackWidthsGrid, ii-1, 0, m_BrdSettings->m_TrackWidthList[ii] );
}
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_ViasDimensionsList.size(); ii++ )
{
SETCELL( m_viaSizesGrid, ii-1, 0, m_BrdSettings->m_ViasDimensionsList[ii].m_Diameter );
if( m_BrdSettings->m_ViasDimensionsList[ii].m_Drill > 0 )
SETCELL( m_viaSizesGrid, ii-1, 1, m_BrdSettings->m_ViasDimensionsList[ii].m_Drill );
}
// Skip the first item, which is the current netclass value
for( unsigned ii = 1; ii < m_BrdSettings->m_DiffPairDimensionsList.size(); ii++ )
{
SETCELL( m_diffPairsGrid, ii-1, 0, m_BrdSettings->m_DiffPairDimensionsList[ii].m_Width );
if( m_BrdSettings->m_DiffPairDimensionsList[ii].m_Gap > 0 )
SETCELL( m_diffPairsGrid, ii-1, 1, m_BrdSettings->m_DiffPairDimensionsList[ii].m_Gap );
if( m_BrdSettings->m_DiffPairDimensionsList[ii].m_ViaGap > 0 )
SETCELL( m_diffPairsGrid, ii-1, 2, m_BrdSettings->m_DiffPairDimensionsList[ii].m_ViaGap );
}
return true;
}
bool PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow()
{
if( !validateData() )
return false;
wxString msg;
std::vector<int> trackWidths;
std::vector<VIA_DIMENSION> vias;
std::vector<DIFF_PAIR_DIMENSION> diffPairs;
for( int row = 0; row < m_trackWidthsGrid->GetNumberRows(); ++row )
{
msg = m_trackWidthsGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
trackWidths.push_back( ValueFromString( m_Frame->GetUserUnits(), msg, true ) );
}
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
msg = m_viaSizesGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
{
VIA_DIMENSION via_dim;
via_dim.m_Diameter = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_viaSizesGrid->GetCellValue( row, 1 );
if( !msg.IsEmpty() )
via_dim.m_Drill = ValueFromString( m_Frame->GetUserUnits(), msg, true );
vias.push_back( via_dim );
}
}
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
msg = m_diffPairsGrid->GetCellValue( row, 0 );
if( !msg.IsEmpty() )
{
DIFF_PAIR_DIMENSION diffPair_dim;
diffPair_dim.m_Width = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_diffPairsGrid->GetCellValue( row, 1 );
diffPair_dim.m_Gap = ValueFromString( m_Frame->GetUserUnits(), msg, true );
msg = m_diffPairsGrid->GetCellValue( row, 2 );
if( !msg.IsEmpty() )
diffPair_dim.m_ViaGap = ValueFromString( m_Frame->GetUserUnits(), msg, true );
diffPairs.push_back( diffPair_dim );
}
}
// Sort lists by increasing value
sort( trackWidths.begin(), trackWidths.end() );
sort( vias.begin(), vias.end() );
sort( diffPairs.begin(), diffPairs.end() );
trackWidths.insert( trackWidths.begin(), m_BrdSettings->m_TrackWidthList[ 0 ] );
m_BrdSettings->m_TrackWidthList = trackWidths;
vias.insert( vias.begin(), m_BrdSettings->m_ViasDimensionsList[ 0 ] );
m_BrdSettings->m_ViasDimensionsList = vias;
diffPairs.insert( diffPairs.begin(), m_BrdSettings->m_DiffPairDimensionsList[ 0 ] );
m_BrdSettings->m_DiffPairDimensionsList = diffPairs;
return true;
}
bool PANEL_SETUP_TRACKS_AND_VIAS::validateData()
{
// Commit any pending in-place edits and close editors from grid controls
m_trackWidthsGrid->DisableCellEditControl();
m_viaSizesGrid->DisableCellEditControl();
m_diffPairsGrid->DisableCellEditControl();
wxString msg;
int minViaDia = m_ConstraintsPanel->m_viaMinSize.GetValue();
int minViaDrill = m_ConstraintsPanel->m_viaMinDrill.GetValue();
int minTrackWidth = m_ConstraintsPanel->m_trackMinWidth.GetValue();
// Test tracks
for( int row = 0; row < m_trackWidthsGrid->GetNumberRows(); ++row )
{
wxString tvalue = m_trackWidthsGrid->GetCellValue( row, 0 );
if( tvalue.IsEmpty() )
continue;
if( ValueFromString( m_Frame->GetUserUnits(), tvalue ) < minTrackWidth )
{
msg.Printf( _( "Track width less than minimum track width (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minTrackWidth, true, true ) );
m_Parent->SetError( msg, this, m_trackWidthsGrid, row, 0 );
return false;
}
}
// Test vias
for( int row = 0; row < m_viaSizesGrid->GetNumberRows(); ++row )
{
wxString viaDia = m_viaSizesGrid->GetCellValue( row, 0 );
if( viaDia.IsEmpty() )
continue;
if( ValueFromString( m_Frame->GetUserUnits(), viaDia ) < minViaDia )
{
msg.Printf( _( "Via diameter less than minimum via diameter (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDia, true, true ) );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 0 );
return false;
}
wxString viaDrill = m_viaSizesGrid->GetCellValue( row, 1 );
if( viaDrill.IsEmpty() )
{
msg = _( "No via drill defined." );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill ) < minViaDrill )
{
msg.Printf( _( "Via drill less than minimum via drill (%s)." ),
StringFromValue( m_Frame->GetUserUnits(), minViaDrill, true, true ) );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
if( ValueFromString( m_Frame->GetUserUnits(), viaDrill )
>= ValueFromString( m_Frame->GetUserUnits(), viaDia ) )
{
msg = _( "Via drill larger than via diameter." );
m_Parent->SetError( msg, this, m_viaSizesGrid, row, 1 );
return false;
}
}
return true;
}
void PANEL_SETUP_TRACKS_AND_VIAS::ImportSettingsFrom( BOARD* aBoard )
{
// Note: do not change the board, as we need to get the current nets from it for
// netclass memberships. All the netclass definitions and dimension lists are in
// the BOARD_DESIGN_SETTINGS.
BOARD_DESIGN_SETTINGS* savedSettings = m_BrdSettings;
m_BrdSettings = &aBoard->GetDesignSettings();
TransferDataToWindow();
m_BrdSettings = savedSettings;
}

View File

@ -0,0 +1,657 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="13" />
<object class="Project" expanded="1">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
<property name="disconnect_mode">source_name</property>
<property name="disconnect_php_events">0</property>
<property name="disconnect_python_events">0</property>
<property name="embedded_files_path">res</property>
<property name="encoding">UTF-8</property>
<property name="event_generation">connect</property>
<property name="file">panel_setup_tracks_and_vias_base</property>
<property name="first_id">1000</property>
<property name="help_provider">none</property>
<property name="internationalize">1</property>
<property name="name">panel_setup_tracks_and_vias_base</property>
<property name="namespace"></property>
<property name="path">.</property>
<property name="precompiled_header"></property>
<property name="relative_path">1</property>
<property name="skip_lua_events">1</property>
<property name="skip_php_events">1</property>
<property name="skip_python_events">1</property>
<property name="ui_table">UI</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Panel" expanded="1">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="fg"></property>
<property name="font"></property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="maximum_size"></property>
<property name="minimum_size"></property>
<property name="name">PANEL_SETUP_TRACKS_AND_VIAS_BASE</property>
<property name="pos"></property>
<property name="size">-1,-1</property>
<property name="subclass">; forward_declare</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style">wxTAB_TRAVERSAL</property>
<event name="OnAuiFindManager"></event>
<event name="OnAuiPaneButton"></event>
<event name="OnAuiPaneClose"></event>
<event name="OnAuiPaneMaximize"></event>
<event name="OnAuiPaneRestore"></event>
<event name="OnAuiRender"></event>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnInitDialog"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="1">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Pre-defined track and via dimensions:</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_label</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<property name="wrap">-1</property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">20</property>
<property name="flag">wxEXPAND|wxLEFT</property>
<property name="proportion">5</property>
<object class="wxBoxSizer" expanded="1">
<property name="minimum_size"></property>
<property name="name">bSizerLower</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Tracks</property>
<property name="minimum_size"></property>
<property name="name">sbSizer4</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Width&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">1</property>
<property name="column_sizes">100</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">0</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">0</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_trackWidthsGrid</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_size">30</property>
<property name="row_label_values">&quot;1&quot; &quot;2&quot; &quot;3&quot; &quot;4&quot; &quot;5&quot; &quot;6&quot; &quot;7&quot; &quot;8&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">8</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Vias</property>
<property name="minimum_size"></property>
<property name="name">sbSizer5</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg"></property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Size&quot; &quot;Drill&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">2</property>
<property name="column_sizes">100,100</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">0</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">0</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_viaSizesGrid</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_size">30</property>
<property name="row_label_values">&quot;1&quot; &quot;2&quot; &quot;3&quot; &quot;4&quot; &quot;5&quot; &quot;6&quot; &quot;7&quot; &quot;8&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">8</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxRIGHT|wxLEFT|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Differential Pairs</property>
<property name="minimum_size"></property>
<property name="name">sbSizer6</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<event name="OnUpdateUI"></event>
<object class="sizeritem" expanded="0">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxGrid" expanded="0">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="autosize_cols">0</property>
<property name="autosize_rows">0</property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="cell_bg">wxSYS_COLOUR_WINDOW</property>
<property name="cell_font"></property>
<property name="cell_horiz_alignment">wxALIGN_LEFT</property>
<property name="cell_text"></property>
<property name="cell_vert_alignment">wxALIGN_TOP</property>
<property name="center_pane">0</property>
<property name="close_button">1</property>
<property name="col_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="col_label_size">22</property>
<property name="col_label_values">&quot;Width&quot; &quot;Gap&quot; &quot;Via Gap&quot;</property>
<property name="col_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="cols">3</property>
<property name="column_sizes">100,100,100</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_col_move">0</property>
<property name="drag_col_size">1</property>
<property name="drag_grid_size">0</property>
<property name="drag_row_size">1</property>
<property name="editing">1</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="grid_line_color"></property>
<property name="grid_lines">1</property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label_bg"></property>
<property name="label_font"></property>
<property name="label_text"></property>
<property name="margin_height">0</property>
<property name="margin_width">0</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_diffPairsGrid</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="row_label_horiz_alignment">wxALIGN_CENTRE</property>
<property name="row_label_size">30</property>
<property name="row_label_values">&quot;1&quot; &quot;2&quot; &quot;3&quot; &quot;4&quot; &quot;5&quot; &quot;6&quot; &quot;7&quot; &quot;8&quot;</property>
<property name="row_label_vert_alignment">wxALIGN_CENTRE</property>
<property name="row_sizes"></property>
<property name="rows">8</property>
<property name="show">1</property>
<property name="size"></property>
<property name="subclass">WX_GRID; widgets/wx_grid.h; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
<event name="OnChar"></event>
<event name="OnEnterWindow"></event>
<event name="OnEraseBackground"></event>
<event name="OnGridCellChange"></event>
<event name="OnGridCellLeftClick"></event>
<event name="OnGridCellLeftDClick"></event>
<event name="OnGridCellRightClick"></event>
<event name="OnGridCellRightDClick"></event>
<event name="OnGridCmdCellChange"></event>
<event name="OnGridCmdCellLeftClick"></event>
<event name="OnGridCmdCellLeftDClick"></event>
<event name="OnGridCmdCellRightClick"></event>
<event name="OnGridCmdCellRightDClick"></event>
<event name="OnGridCmdColSize"></event>
<event name="OnGridCmdEditorCreated"></event>
<event name="OnGridCmdEditorHidden"></event>
<event name="OnGridCmdEditorShown"></event>
<event name="OnGridCmdLabelLeftClick"></event>
<event name="OnGridCmdLabelLeftDClick"></event>
<event name="OnGridCmdLabelRightClick"></event>
<event name="OnGridCmdLabelRightDClick"></event>
<event name="OnGridCmdRangeSelect"></event>
<event name="OnGridCmdRowSize"></event>
<event name="OnGridCmdSelectCell"></event>
<event name="OnGridColSize"></event>
<event name="OnGridEditorCreated"></event>
<event name="OnGridEditorHidden"></event>
<event name="OnGridEditorShown"></event>
<event name="OnGridLabelLeftClick"></event>
<event name="OnGridLabelLeftDClick"></event>
<event name="OnGridLabelRightClick"></event>
<event name="OnGridLabelRightDClick"></event>
<event name="OnGridRangeSelect"></event>
<event name="OnGridRowSize"></event>
<event name="OnGridSelectCell"></event>
<event name="OnKeyDown"></event>
<event name="OnKeyUp"></event>
<event name="OnKillFocus"></event>
<event name="OnLeaveWindow"></event>
<event name="OnLeftDClick"></event>
<event name="OnLeftDown"></event>
<event name="OnLeftUp"></event>
<event name="OnMiddleDClick"></event>
<event name="OnMiddleDown"></event>
<event name="OnMiddleUp"></event>
<event name="OnMotion"></event>
<event name="OnMouseEvents"></event>
<event name="OnMouseWheel"></event>
<event name="OnPaint"></event>
<event name="OnRightDClick"></event>
<event name="OnRightDown"></event>
<event name="OnRightUp"></event>
<event name="OnSetFocus"></event>
<event name="OnSize"></event>
<event name="OnUpdateUI"></event>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</object>
</wxFormBuilder_Project>

View File

@ -0,0 +1,63 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2018 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef PANEL_SETUP_TRACKS_AND_VIAS_H
#define PANEL_SETUP_TRACKS_AND_VIAS_H
#include <class_board.h>
#include <widgets/unit_binder.h>
#include <widgets/paged_dialog.h>
#include <panel_setup_tracks_and_vias_base.h>
#include "panel_setup_feature_constraints.h"
class PCB_EDIT_FRAME;
class BOARD_DESIGN_SETTINGS;
class PANEL_SETUP_TRACKS_AND_VIAS : public PANEL_SETUP_TRACKS_AND_VIAS_BASE
{
private:
PAGED_DIALOG* m_Parent;
PCB_EDIT_FRAME* m_Frame;
BOARD* m_Pcb;
BOARD_DESIGN_SETTINGS* m_BrdSettings;
// We must validate against the current m_BrdSettings as they may have been
// changed but not yet committed. Fetch them from the constraints panel.
PANEL_SETUP_FEATURE_CONSTRAINTS* m_ConstraintsPanel;
bool validateData();
public:
PANEL_SETUP_TRACKS_AND_VIAS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* aFrame,
PANEL_SETUP_FEATURE_CONSTRAINTS* aConstraintsPanel );
bool TransferDataToWindow() override;
bool TransferDataFromWindow() override;
void ImportSettingsFrom( BOARD* aBoard );
};
#endif //PANEL_SETUP_TRACKS_AND_VIAS_H

View File

@ -0,0 +1,170 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "widgets/wx_grid.h"
#include "panel_setup_tracks_and_vias_base.h"
///////////////////////////////////////////////////////////////////////////
PANEL_SETUP_TRACKS_AND_VIAS_BASE::PANEL_SETUP_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
{
wxBoxSizer* bMainSizer;
bMainSizer = new wxBoxSizer( wxVERTICAL );
m_label = new wxStaticText( this, wxID_ANY, _("Pre-defined track and via dimensions:"), wxDefaultPosition, wxDefaultSize, 0 );
m_label->Wrap( -1 );
bMainSizer->Add( m_label, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bSizerLower;
bSizerLower = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbSizer4;
sbSizer4 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Tracks") ), wxVERTICAL );
m_trackWidthsGrid = new WX_GRID( sbSizer4->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_trackWidthsGrid->CreateGrid( 8, 1 );
m_trackWidthsGrid->EnableEditing( true );
m_trackWidthsGrid->EnableGridLines( true );
m_trackWidthsGrid->EnableDragGridSize( false );
m_trackWidthsGrid->SetMargins( 0, 0 );
// Columns
m_trackWidthsGrid->SetColSize( 0, 100 );
m_trackWidthsGrid->EnableDragColMove( false );
m_trackWidthsGrid->EnableDragColSize( false );
m_trackWidthsGrid->SetColLabelSize( 22 );
m_trackWidthsGrid->SetColLabelValue( 0, _("Width") );
m_trackWidthsGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_trackWidthsGrid->EnableDragRowSize( false );
m_trackWidthsGrid->SetRowLabelSize( 30 );
m_trackWidthsGrid->SetRowLabelValue( 0, _("1") );
m_trackWidthsGrid->SetRowLabelValue( 1, _("2") );
m_trackWidthsGrid->SetRowLabelValue( 2, _("3") );
m_trackWidthsGrid->SetRowLabelValue( 3, _("4") );
m_trackWidthsGrid->SetRowLabelValue( 4, _("5") );
m_trackWidthsGrid->SetRowLabelValue( 5, _("6") );
m_trackWidthsGrid->SetRowLabelValue( 6, _("7") );
m_trackWidthsGrid->SetRowLabelValue( 7, _("8") );
m_trackWidthsGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_trackWidthsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbSizer4->Add( m_trackWidthsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerLower->Add( sbSizer4, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
wxStaticBoxSizer* sbSizer5;
sbSizer5 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Vias") ), wxVERTICAL );
m_viaSizesGrid = new WX_GRID( sbSizer5->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_viaSizesGrid->CreateGrid( 8, 2 );
m_viaSizesGrid->EnableEditing( true );
m_viaSizesGrid->EnableGridLines( true );
m_viaSizesGrid->EnableDragGridSize( false );
m_viaSizesGrid->SetMargins( 0, 0 );
// Columns
m_viaSizesGrid->SetColSize( 0, 100 );
m_viaSizesGrid->SetColSize( 1, 100 );
m_viaSizesGrid->EnableDragColMove( false );
m_viaSizesGrid->EnableDragColSize( false );
m_viaSizesGrid->SetColLabelSize( 22 );
m_viaSizesGrid->SetColLabelValue( 0, _("Size") );
m_viaSizesGrid->SetColLabelValue( 1, _("Drill") );
m_viaSizesGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_viaSizesGrid->EnableDragRowSize( false );
m_viaSizesGrid->SetRowLabelSize( 30 );
m_viaSizesGrid->SetRowLabelValue( 0, _("1") );
m_viaSizesGrid->SetRowLabelValue( 1, _("2") );
m_viaSizesGrid->SetRowLabelValue( 2, _("3") );
m_viaSizesGrid->SetRowLabelValue( 3, _("4") );
m_viaSizesGrid->SetRowLabelValue( 4, _("5") );
m_viaSizesGrid->SetRowLabelValue( 5, _("6") );
m_viaSizesGrid->SetRowLabelValue( 6, _("7") );
m_viaSizesGrid->SetRowLabelValue( 7, _("8") );
m_viaSizesGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_viaSizesGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbSizer5->Add( m_viaSizesGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerLower->Add( sbSizer5, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxStaticBoxSizer* sbSizer6;
sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Differential Pairs") ), wxVERTICAL );
m_diffPairsGrid = new WX_GRID( sbSizer6->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 );
// Grid
m_diffPairsGrid->CreateGrid( 8, 3 );
m_diffPairsGrid->EnableEditing( true );
m_diffPairsGrid->EnableGridLines( true );
m_diffPairsGrid->EnableDragGridSize( false );
m_diffPairsGrid->SetMargins( 0, 0 );
// Columns
m_diffPairsGrid->SetColSize( 0, 100 );
m_diffPairsGrid->SetColSize( 1, 100 );
m_diffPairsGrid->SetColSize( 2, 100 );
m_diffPairsGrid->EnableDragColMove( false );
m_diffPairsGrid->EnableDragColSize( true );
m_diffPairsGrid->SetColLabelSize( 22 );
m_diffPairsGrid->SetColLabelValue( 0, _("Width") );
m_diffPairsGrid->SetColLabelValue( 1, _("Gap") );
m_diffPairsGrid->SetColLabelValue( 2, _("Via Gap") );
m_diffPairsGrid->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Rows
m_diffPairsGrid->EnableDragRowSize( true );
m_diffPairsGrid->SetRowLabelSize( 30 );
m_diffPairsGrid->SetRowLabelValue( 0, _("1") );
m_diffPairsGrid->SetRowLabelValue( 1, _("2") );
m_diffPairsGrid->SetRowLabelValue( 2, _("3") );
m_diffPairsGrid->SetRowLabelValue( 3, _("4") );
m_diffPairsGrid->SetRowLabelValue( 4, _("5") );
m_diffPairsGrid->SetRowLabelValue( 5, _("6") );
m_diffPairsGrid->SetRowLabelValue( 6, _("7") );
m_diffPairsGrid->SetRowLabelValue( 7, _("8") );
m_diffPairsGrid->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE );
// Label Appearance
// Cell Defaults
m_diffPairsGrid->SetDefaultCellBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) );
m_diffPairsGrid->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP );
sbSizer6->Add( m_diffPairsGrid, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bSizerLower->Add( sbSizer6, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 );
bMainSizer->Add( bSizerLower, 5, wxEXPAND|wxLEFT, 20 );
this->SetSizer( bMainSizer );
this->Layout();
bMainSizer->Fit( this );
}
PANEL_SETUP_TRACKS_AND_VIAS_BASE::~PANEL_SETUP_TRACKS_AND_VIAS_BASE()
{
}

View File

@ -0,0 +1,49 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Dec 30 2017)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __PANEL_SETUP_TRACKS_AND_VIAS_BASE_H__
#define __PANEL_SETUP_TRACKS_AND_VIAS_BASE_H__
#include <wx/artprov.h>
#include <wx/xrc/xmlres.h>
#include <wx/intl.h>
class WX_GRID;
#include <wx/string.h>
#include <wx/stattext.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/grid.h>
#include <wx/sizer.h>
#include <wx/statbox.h>
#include <wx/panel.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class PANEL_SETUP_TRACKS_AND_VIAS_BASE
///////////////////////////////////////////////////////////////////////////////
class PANEL_SETUP_TRACKS_AND_VIAS_BASE : public wxPanel
{
private:
protected:
wxStaticText* m_label;
WX_GRID* m_trackWidthsGrid;
WX_GRID* m_viaSizesGrid;
WX_GRID* m_diffPairsGrid;
public:
PANEL_SETUP_TRACKS_AND_VIAS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL );
~PANEL_SETUP_TRACKS_AND_VIAS_BASE();
};
#endif //__PANEL_SETUP_TRACKS_AND_VIAS_BASE_H__