diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 0a41706d2d..1a2aa94825 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -113,6 +113,8 @@ D_PAD::D_PAD( const D_PAD& aOther ) : SetPinFunction( aOther.GetPinFunction() ); SetSubRatsnest( aOther.GetSubRatsnest() ); m_effectiveBoundingRadius = aOther.m_effectiveBoundingRadius; + m_removeUnconnectedLayer = aOther.m_removeUnconnectedLayer; + m_keepTopBottomLayer = aOther.m_keepTopBottomLayer; } @@ -128,6 +130,8 @@ D_PAD& D_PAD::operator=( const D_PAD &aOther ) SetPinFunction( aOther.GetPinFunction() ); SetSubRatsnest( aOther.GetSubRatsnest() ); m_effectiveBoundingRadius = aOther.m_effectiveBoundingRadius; + m_removeUnconnectedLayer = aOther.m_removeUnconnectedLayer; + m_keepTopBottomLayer = aOther.m_keepTopBottomLayer; return *this; } @@ -1179,14 +1183,14 @@ unsigned int D_PAD::ViewGetLOD( int aLayer, KIGFX::VIEW* aView ) const if( IsFlipped() && !aView->IsLayerVisible( LAYER_MOD_BK ) ) return HIDE; - if( IsFrontLayer( ( PCB_LAYER_ID )aLayer ) && !aView->IsLayerVisible( LAYER_PAD_FR ) ) + if( IsFrontLayer( (PCB_LAYER_ID) aLayer ) && !aView->IsLayerVisible( LAYER_PAD_FR ) ) return HIDE; - if( IsBackLayer( ( PCB_LAYER_ID )aLayer ) && !aView->IsLayerVisible( LAYER_PAD_BK ) ) + if( IsBackLayer( (PCB_LAYER_ID) aLayer ) && !aView->IsLayerVisible( LAYER_PAD_BK ) ) return HIDE; // Only draw the pad if at least one of the layers it crosses is being displayed - if( board && !( board->GetVisibleLayers() & GetLayerSet() ).any() ) + if( board && !IsPadOnLayer( board->GetVisibleLayers() ) ) return HIDE; // Netnames will be shown only if zoom is appropriate diff --git a/pcbnew/dialogs/dialog_pad_properties.cpp b/pcbnew/dialogs/dialog_pad_properties.cpp index 459ace81ba..d3a5ac7f00 100644 --- a/pcbnew/dialogs/dialog_pad_properties.cpp +++ b/pcbnew/dialogs/dialog_pad_properties.cpp @@ -169,6 +169,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP wxFont infoFont = wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ); infoFont.SetSymbolicSize( wxFONTSIZE_SMALL ); + m_copperLayersLabel->SetFont( infoFont ); m_techLayersLabel->SetFont( infoFont ); m_parentInfoLine1->SetFont( infoFont ); m_parentInfoLine2->SetFont( infoFont ); @@ -186,6 +187,7 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( PCB_BASE_FRAME* aParent, D_PAD* aP // Initialize canvas to be able to display the dummy pad: prepareCanvas(); + m_stackupImage->SetBitmap( KiBitmap( pads_remove_unused_xpm ) ); SetInitialFocus( m_PadNumCtrl ); m_sdbSizerOK->SetDefault(); @@ -255,7 +257,7 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas() #else EDA_DRAW_PANEL_GAL::GAL_TYPE backend = EDA_DRAW_PANEL_GAL::GAL_TYPE_CAIRO; #endif - m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( this, -1, wxDefaultPosition, wxDefaultSize, + m_padPreviewGAL = new PCB_DRAW_PANEL_GAL( m_boardViewPanel, -1, wxDefaultPosition, wxDefaultSize, m_parent->GetGalDisplayOptions(), backend ); m_padPreviewSizer->Add( m_padPreviewGAL, 12, wxEXPAND | wxALL, 5 ); @@ -271,9 +273,10 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas() m_padPreviewGAL->UpdateColors(); m_padPreviewGAL->SetStealsFocus( false ); + m_padPreviewGAL->ShowScrollbars( wxSHOW_SB_NEVER, wxSHOW_SB_NEVER ); - m_padPreviewGAL->GetViewControls()->ApplySettings( - m_parent->GetCanvas()->GetViewControls()->GetSettings() ); + KIGFX::VIEW_CONTROLS* parentViewControls = m_parent->GetCanvas()->GetViewControls(); + m_padPreviewGAL->GetViewControls()->ApplySettings( parentViewControls->GetSettings() ); m_padPreviewGAL->Show(); @@ -287,6 +290,8 @@ void DIALOG_PAD_PROPERTIES::prepareCanvas() settings->SetSketchMode( LAYER_PAD_BK, sketchMode ); settings->SetSketchModeGraphicItems( sketchMode ); + settings->SetHighContrast( false ); + // gives a non null grid size (0.001mm) because GAL layer does not like a 0 size grid: double gridsize = 0.001 * IU_PER_MM; view->GetGAL()->SetGridSize( VECTOR2D( gridsize, gridsize ) ); @@ -316,6 +321,9 @@ void DIALOG_PAD_PROPERTIES::updateRoundRectCornerValues() m_tcChamferRatio->ChangeValue( ratio ); m_tcChamferRatio1->ChangeValue( ratio ); } + + m_previewNotebook->ChangeSelection( 0 ); + redraw(); } @@ -339,6 +347,8 @@ void DIALOG_PAD_PROPERTIES::onCornerRadiusChange( wxCommandEvent& event ) auto ratio = wxString::Format( "%.1f", m_dummyPad->GetRoundRectRadiusRatio() * 100 ); m_tcCornerSizeRatio->ChangeValue( ratio ); m_tcCornerSizeRatio1->ChangeValue( ratio ); + + m_previewNotebook->ChangeSelection( 0 ); redraw(); } @@ -422,8 +432,10 @@ void DIALOG_PAD_PROPERTIES::onCornerSizePercentChange( wxCommandEvent& event ) { transferDataToPad( m_dummyPad ); m_cornerRadius.ChangeValue( m_dummyPad->GetRoundRectCornerRadius() ); - redraw(); } + + m_previewNotebook->ChangeSelection( 0 ); + redraw(); } @@ -436,11 +448,6 @@ void DIALOG_PAD_PROPERTIES::initValues() // because nets are living only in the board managed by the board editor m_canEditNetName = m_parent->IsType( FRAME_PCB_EDITOR ); - // Setup layers names from board - // Should be made first, before calling m_rbCopperLayersSel->SetSelection() - m_rbCopperLayersSel->SetString( 0, m_board->GetLayerName( F_Cu ) ); - m_rbCopperLayersSel->SetString( 1, m_board->GetLayerName( B_Cu ) ); - m_PadLayerAdhCmp->SetLabel( m_board->GetLayerName( F_Adhes ) ); m_PadLayerAdhCu->SetLabel( m_board->GetLayerName( B_Adhes ) ); m_PadLayerPateCmp->SetLabel( m_board->GetLayerName( F_Paste ) ); @@ -580,9 +587,6 @@ void DIALOG_PAD_PROPERTIES::initValues() NORMALIZE_ANGLE_180( angle ); // ? normalizing is in D_PAD::SetOrientation() - // Set layers used by this pad: : - setPadLayersList( m_dummyPad->GetLayerSet() ); - // Pad Orient // Note: use ChangeValue() instead of SetValue() so that we don't generate events m_orientation->ChangeValue( StringFromValue( EDA_UNITS::DEGREES, angle ) ); @@ -667,7 +671,8 @@ void DIALOG_PAD_PROPERTIES::initValues() // Update some dialog widgets state (Enable/disable options): wxCommandEvent cmd_event; - setPadLayersList( m_dummyPad->GetLayerSet() ); + setPadLayersList( m_dummyPad->GetLayerSet(), m_dummyPad->GetRemoveUnconnected(), + m_dummyPad->GetKeepTopBottom() ); OnPadShapeSelection( cmd_event ); OnOffsetCheckbox( cmd_event ); @@ -780,6 +785,9 @@ void DIALOG_PAD_PROPERTIES::onChangePadMode( wxCommandEvent& event ) settings->SetSketchMode( LAYER_PAD_BK, m_sketchPreview ); settings->SetSketchModeGraphicItems( m_sketchPreview ); + settings->SetHighContrast( false ); + + m_previewNotebook->ChangeSelection( 0 ); redraw(); } @@ -879,6 +887,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) if( m_MainSizer->GetSize().y < m_MainSizer->GetMinSize().y ) m_MainSizer->SetSizeHints( this ); + m_previewNotebook->ChangeSelection( 0 ); redraw(); } @@ -886,6 +895,7 @@ void DIALOG_PAD_PROPERTIES::OnPadShapeSelection( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event ) { transferDataToPad( m_dummyPad ); + m_previewNotebook->ChangeSelection( 0 ); redraw(); } @@ -893,10 +903,32 @@ void DIALOG_PAD_PROPERTIES::OnDrillShapeSelected( wxCommandEvent& event ) void DIALOG_PAD_PROPERTIES::PadOrientEvent( wxCommandEvent& event ) { transferDataToPad( m_dummyPad ); + m_previewNotebook->ChangeSelection( 0 ); redraw(); } +void DIALOG_PAD_PROPERTIES::UpdateLayersDropdown() +{ + m_rbCopperLayersSel->Clear(); + + if( m_PadType->GetSelection() == 0 || m_PadType->GetSelection() == 3 ) + { + m_rbCopperLayersSel->Append( _( "All copper layers" ) ); + m_rbCopperLayersSel->Append( wxString::Format( _( "%s, %s and connected layers" ), + m_board->GetLayerName( F_Cu ), + m_board->GetLayerName( B_Cu ) ) ); + m_rbCopperLayersSel->Append( _( "Connected layers only" ) ); + m_rbCopperLayersSel->Append( _( "None" ) ); + } + else + { + m_rbCopperLayersSel->Append( m_board->GetLayerName( F_Cu ) ); + m_rbCopperLayersSel->Append( m_board->GetLayerName( B_Cu ) ); + } +} + + void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) { int ii = m_PadType->GetSelection(); @@ -916,8 +948,8 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) case 4: /* Aperture */ hasHole = false; hasConnection = false; hasProperty = true; break; } - LSET layer_mask = std_pad_layers[ii]; - setPadLayersList( layer_mask ); + setPadLayersList( std_pad_layers[ii], m_dummyPad->GetRemoveUnconnected(), + m_dummyPad->GetKeepTopBottom() ); if( !hasHole ) { @@ -947,6 +979,10 @@ void DIALOG_PAD_PROPERTIES::PadTypeSelected( wxCommandEvent& event ) m_choiceFabProperty->Enable( hasProperty ); + m_previewNotebook->SetSelection( hasHole ? 1 : 0 ); + + UpdateLayersDropdown(); + transferDataToPad( m_dummyPad ); redraw(); } @@ -997,18 +1033,49 @@ void DIALOG_PAD_PROPERTIES::OnUpdateUI( wxUpdateUIEvent& event ) } -void DIALOG_PAD_PROPERTIES::setPadLayersList( LSET layer_mask ) +void DIALOG_PAD_PROPERTIES::setPadLayersList( LSET layer_mask, bool remove_unconnected, + bool keep_top_bottom ) { + UpdateLayersDropdown(); + LSET cu_set = layer_mask & LSET::AllCuMask(); - if( cu_set == LSET( F_Cu ) ) - m_rbCopperLayersSel->SetSelection( 0 ); - else if( cu_set == LSET( B_Cu ) ) - m_rbCopperLayersSel->SetSelection( 1 ); - else if( cu_set.any() ) - m_rbCopperLayersSel->SetSelection( 2 ); + if( m_PadType->GetSelection() == 0 || m_PadType->GetSelection() == 3 ) + { + if( !cu_set.any() ) + { + m_rbCopperLayersSel->SetSelection( 3 ); + m_stackupImage->SetBitmap( wxBitmap() ); + } + else if( !remove_unconnected ) + { + m_rbCopperLayersSel->SetSelection( 0 ); + m_stackupImage->SetBitmap( KiBitmap( pads_reset_unused_xpm ) ); + } + else if( keep_top_bottom ) + { + m_rbCopperLayersSel->SetSelection( 1 ); + m_stackupImage->SetBitmap( KiBitmap( pads_remove_unused_keep_bottom_xpm ) ); + } + else + { + m_rbCopperLayersSel->SetSelection( 2 ); + m_stackupImage->SetBitmap( KiBitmap( pads_remove_unused_xpm ) ); + } + } else - m_rbCopperLayersSel->SetSelection( 3 ); + { + if( cu_set == LSET( F_Cu ) ) + { + m_rbCopperLayersSel->SetSelection( 0 ); + m_stackupImage->SetBitmap( wxBitmap() ); + } + else + { + m_rbCopperLayersSel->SetSelection( 1 ); + m_stackupImage->SetBitmap( wxBitmap() ); + } + } m_PadLayerAdhCmp->SetValue( layer_mask[F_Adhes] ); m_PadLayerAdhCu->SetValue( layer_mask[B_Adhes] ); @@ -1029,6 +1096,31 @@ void DIALOG_PAD_PROPERTIES::setPadLayersList( LSET layer_mask ) } +void DIALOG_PAD_PROPERTIES::OnSetCopperLayers( wxCommandEvent& event ) +{ + if( m_PadType->GetSelection() == 0 || m_PadType->GetSelection() == 3 ) + { + m_previewNotebook->ChangeSelection( 1 ); + + switch( event.GetSelection() ) + { + case 0: m_stackupImage->SetBitmap( KiBitmap( pads_reset_unused_xpm ) ); break; + case 1: m_stackupImage->SetBitmap( KiBitmap( pads_remove_unused_keep_bottom_xpm ) ); break; + case 2: m_stackupImage->SetBitmap( KiBitmap( pads_remove_unused_xpm ) ); break; + case 3: m_stackupImage->SetBitmap( wxBitmap() ); break; + } + } + else + { + m_previewNotebook->ChangeSelection( 0 ); + m_stackupImage->SetBitmap( wxBitmap() ); + } + + transferDataToPad( m_dummyPad ); + redraw(); +} + + // Called when select/deselect a layer. void DIALOG_PAD_PROPERTIES::OnSetLayers( wxCommandEvent& event ) { @@ -1687,13 +1779,44 @@ bool DIALOG_PAD_PROPERTIES::transferDataToPad( D_PAD* aPad ) aPad->SetProperty( getSelectedProperty() ); LSET padLayerMask; + int copperLayersChoice = m_rbCopperLayersSel->GetSelection(); - switch( m_rbCopperLayersSel->GetSelection() ) + if( m_PadType->GetSelection() == 0 || m_PadType->GetSelection() == 3 ) { - case 0: padLayerMask.set( F_Cu ); break; - case 1: padLayerMask.set( B_Cu ); break; - case 2: padLayerMask |= LSET::AllCuMask(); break; - case 3: break; // No copper layers + switch( copperLayersChoice ) + { + case 0: + // All copper layers + padLayerMask |= LSET::AllCuMask(); + aPad->SetRemoveUnconnected( false ); + break; + + case 1: + // Front, back and connected + padLayerMask |= LSET::AllCuMask(); + aPad->SetRemoveUnconnected( true ); + aPad->SetKeepTopBottom( true ); + break; + + case 2: + // Connected only + padLayerMask |= LSET::AllCuMask(); + aPad->SetRemoveUnconnected( true ); + aPad->SetKeepTopBottom( false ); + break; + + case 3: + // No copper layers + break; + } + } + else + { + switch( copperLayersChoice ) + { + case 0: padLayerMask.set( F_Cu ); break; + case 1: padLayerMask.set( B_Cu ); break; + } } if( m_PadLayerAdhCmp->GetValue() ) diff --git a/pcbnew/dialogs/dialog_pad_properties.h b/pcbnew/dialogs/dialog_pad_properties.h index 09217a7c68..6bd362d49a 100644 --- a/pcbnew/dialogs/dialog_pad_properties.h +++ b/pcbnew/dialogs/dialog_pad_properties.h @@ -101,7 +101,7 @@ private: * updates the CheckBox states in pad layers list, * @param layer_mask = pad layer mask (ORed layers bit mask) */ - void setPadLayersList( LSET layer_mask ); + void setPadLayersList( LSET layer_mask, bool remove_unconnected, bool keep_top_bottom ); /// Copy values from dialog field to aPad's members bool transferDataToPad( D_PAD* aPad ); @@ -127,6 +127,8 @@ private: void PadOrientEvent( wxCommandEvent& event ) override; void PadTypeSelected( wxCommandEvent& event ) override; + void UpdateLayersDropdown(); + void OnSetCopperLayers( wxCommandEvent& event ) override; void OnSetLayers( wxCommandEvent& event ) override; // Called when corner setup value is changed for rounded rect pads diff --git a/pcbnew/dialogs/dialog_pad_properties_base.cpp b/pcbnew/dialogs/dialog_pad_properties_base.cpp index 70a06f51a8..59f3177e99 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.cpp +++ b/pcbnew/dialogs/dialog_pad_properties_base.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -86,7 +86,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer->Add( gbSizerCommon, 0, wxEXPAND|wxBOTTOM, 5 ); - m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( 0, 5, 0, wxEXPAND, 5 ); m_staticline5 = new wxStaticLine( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_LeftBoxSizer->Add( m_staticline5, 0, wxEXPAND, 5 ); @@ -393,7 +393,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer->Add( gbSizerHole, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - m_LeftBoxSizer->Add( 0, 0, 1, wxEXPAND, 5 ); + m_LeftBoxSizer->Add( 0, 5, 0, wxEXPAND, 5 ); m_staticline7 = new wxStaticLine( m_panelGeneral, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); m_LeftBoxSizer->Add( m_staticline7, 0, wxEXPAND|wxBOTTOM, 5 ); @@ -472,9 +472,6 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LeftBoxSizer->Add( fgSizerPadToDie, 0, wxEXPAND, 5 ); - m_LeftBoxSizer->Add( 0, 3, 1, wxEXPAND, 5 ); - - bGeneralSizer->Add( m_LeftBoxSizer, 0, wxEXPAND|wxALL, 5 ); m_middleBoxSizer = new wxBoxSizer( wxVERTICAL ); @@ -496,21 +493,16 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_LayersSizer->Add( m_FlippedWarningSizer, 0, wxEXPAND|wxBOTTOM, 5 ); - wxBoxSizer* bSizer11; - bSizer11 = new wxBoxSizer( wxHORIZONTAL ); + m_copperLayersLabel = new wxStaticText( m_LayersSizer->GetStaticBox(), wxID_ANY, _("Copper layers:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_copperLayersLabel->Wrap( -1 ); + m_copperLayersLabel->SetFont( wxFont( 11, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL, false, wxEmptyString ) ); - m_staticText511 = new wxStaticText( m_LayersSizer->GetStaticBox(), wxID_ANY, _("Copper:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText511->Wrap( -1 ); - bSizer11->Add( m_staticText511, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxTOP, 4 ); + m_LayersSizer->Add( m_copperLayersLabel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT, 4 ); - wxString m_rbCopperLayersSelChoices[] = { _("Front layer"), _("Back layer"), _("All copper layers"), _("None") }; - int m_rbCopperLayersSelNChoices = sizeof( m_rbCopperLayersSelChoices ) / sizeof( wxString ); - m_rbCopperLayersSel = new wxChoice( m_LayersSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_rbCopperLayersSelNChoices, m_rbCopperLayersSelChoices, 0 ); + wxArrayString m_rbCopperLayersSelChoices; + m_rbCopperLayersSel = new wxChoice( m_LayersSizer->GetStaticBox(), wxID_ANY, wxDefaultPosition, wxDefaultSize, m_rbCopperLayersSelChoices, 0 ); m_rbCopperLayersSel->SetSelection( 0 ); - bSizer11->Add( m_rbCopperLayersSel, 1, wxALL|wxEXPAND|wxTOP, 4 ); - - - m_LayersSizer->Add( bSizer11, 0, wxEXPAND, 5 ); + m_LayersSizer->Add( m_rbCopperLayersSel, 1, wxALL|wxEXPAND|wxTOP, 4 ); m_techLayersLabel = new wxStaticText( m_LayersSizer->GetStaticBox(), wxID_ANY, _("Technical layers:"), wxDefaultPosition, wxDefaultSize, 0 ); m_techLayersLabel->Wrap( -1 ); @@ -847,6 +839,9 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind bSizerUpper->Add( m_notebook, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + m_staticline8 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizerUpper->Add( m_staticline8, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bSizerDisplayPad; bSizerDisplayPad = new wxBoxSizer( wxVERTICAL ); @@ -867,25 +862,49 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind bSizerDisplayPad->Add( m_parentInfoLine2, 0, wxRIGHT, 3 ); - bSizerDisplayPad->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizerDisplayPad->Add( 0, 10, 0, wxEXPAND, 5 ); + m_previewNotebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_previewNotebook->SetMinSize( wxSize( -1,320 ) ); + + m_boardViewPanel = new wxPanel( m_previewNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_padPreviewSizer = new wxBoxSizer( wxVERTICAL ); m_padPreviewSizer->SetMinSize( wxSize( 280,-1 ) ); - bSizerDisplayPad->Add( m_padPreviewSizer, 12, wxEXPAND, 5 ); + m_boardViewPanel->SetSizer( m_padPreviewSizer ); + m_boardViewPanel->Layout(); + m_padPreviewSizer->Fit( m_boardViewPanel ); + m_previewNotebook->AddPage( m_boardViewPanel, _("Board View"), false ); + m_stackupPanel = new wxPanel( m_previewNotebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer30; + bSizer30 = new wxBoxSizer( wxVERTICAL ); + + + bSizer30->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_stackupImage = new wxStaticBitmap( m_stackupPanel, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer30->Add( m_stackupImage, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer30->Add( 0, 0, 1, wxEXPAND, 5 ); + + + m_stackupPanel->SetSizer( bSizer30 ); + m_stackupPanel->Layout(); + bSizer30->Fit( m_stackupPanel ); + m_previewNotebook->AddPage( m_stackupPanel, _("Stackup View"), false ); + + bSizerDisplayPad->Add( m_previewNotebook, 12, wxEXPAND|wxRIGHT, 5 ); m_cbShowPadOutline = new wxCheckBox( this, wxID_ANY, _("Show pad in outline mode"), wxDefaultPosition, wxDefaultSize, 0 ); bSizerDisplayPad->Add( m_cbShowPadOutline, 0, wxBOTTOM|wxRIGHT|wxTOP, 5 ); - - bSizerDisplayPad->Add( 0, 0, 1, wxEXPAND, 5 ); - m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerDisplayPad->Add( m_staticline13, 0, wxEXPAND|wxTOP|wxBOTTOM, 10 ); + bSizerDisplayPad->Add( m_staticline13, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 10 ); - bSizerUpper->Add( bSizerDisplayPad, 1, wxEXPAND|wxTOP|wxRIGHT, 10 ); + bSizerUpper->Add( bSizerDisplayPad, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_MainSizer->Add( bSizerUpper, 1, wxEXPAND, 5 ); @@ -938,7 +957,7 @@ DIALOG_PAD_PROPERTIES_BASE::DIALOG_PAD_PROPERTIES_BASE( wxWindow* parent, wxWind m_offsetXCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_offsetYCtrl->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_padToDieOpt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadToDieCheckbox ), NULL, this ); - m_rbCopperLayersSel->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); + m_rbCopperLayersSel->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetCopperLayers ), NULL, this ); m_PadLayerAdhCmp->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerAdhCu->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerPateCmp->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); @@ -998,7 +1017,7 @@ DIALOG_PAD_PROPERTIES_BASE::~DIALOG_PAD_PROPERTIES_BASE() m_offsetXCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_offsetYCtrl->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnValuesChanged ), NULL, this ); m_padToDieOpt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnPadToDieCheckbox ), NULL, this ); - m_rbCopperLayersSel->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); + m_rbCopperLayersSel->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetCopperLayers ), NULL, this ); m_PadLayerAdhCmp->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerAdhCu->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); m_PadLayerPateCmp->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_PAD_PROPERTIES_BASE::OnSetLayers ), NULL, this ); diff --git a/pcbnew/dialogs/dialog_pad_properties_base.fbp b/pcbnew/dialogs/dialog_pad_properties_base.fbp index 15dbe87798..4e39f78ed2 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.fbp +++ b/pcbnew/dialogs/dialog_pad_properties_base.fbp @@ -14,7 +14,6 @@ dialog_pad_properties_base 1000 none - 1 dialog_pad_properties_base @@ -26,7 +25,6 @@ 1 1 UI - 0 1 0 @@ -74,7 +72,7 @@ 5 wxEXPAND|wxTOP|wxRIGHT|wxLEFT 0 - + 1 1 1 @@ -127,11 +125,11 @@ - + General 1 - + 1 1 1 @@ -183,21 +181,21 @@ wxTAB_TRAVERSAL OnUpdateUI - + bGeneralSizer wxHORIZONTAL none - + 5 wxEXPAND|wxALL 0 - + m_LeftBoxSizer wxVERTICAL protected - + 5 wxEXPAND|wxBOTTOM 0 @@ -997,21 +995,21 @@ - + 5 wxEXPAND - 1 - - 0 + 0 + + 5 protected 0 - + 5 wxEXPAND 0 - + 1 1 1 @@ -1065,17 +1063,17 @@ - + 5 wxEXPAND|wxBOTTOM 0 - + 0 protected 0 - + 5 wxEXPAND|wxTOP 0 @@ -1212,11 +1210,11 @@ - + 20 wxEXPAND|wxLEFT 0 - + 1 1 1 @@ -1267,10 +1265,10 @@ - + a page 0 - + 1 1 1 @@ -1323,10 +1321,10 @@ wxTAB_TRAVERSAL - + a page 0 - + 1 1 1 @@ -1705,10 +1703,10 @@ - + a page 0 - + 1 1 1 @@ -2148,10 +2146,10 @@ - + a page 0 - + 1 1 1 @@ -2739,10 +2737,10 @@ - + a page 0 - + 1 1 1 @@ -3529,7 +3527,7 @@ - + 5 wxEXPAND|wxTOP 0 @@ -4136,21 +4134,21 @@ - + 5 wxEXPAND 1 - + 0 protected 0 - + 5 wxEXPAND|wxBOTTOM 0 - + 1 1 1 @@ -4204,7 +4202,7 @@ - + 5 wxEXPAND|wxTOP|wxBOTTOM 0 @@ -4745,21 +4743,21 @@ - + 5 wxEXPAND - 1 - - 0 + 0 + + 5 protected 0 - + 5 wxEXPAND|wxBOTTOM 0 - + 1 1 1 @@ -4813,20 +4811,20 @@ - + 5 wxEXPAND|wxTOP 0 - + bSizer35 wxHORIZONTAL none - + 5 wxLEFT 0 - + 1 1 1 @@ -4887,11 +4885,11 @@ OnOffsetCheckbox - + 5 wxRIGHT 0 - + 1 1 1 @@ -4950,7 +4948,7 @@ - + 25 wxEXPAND|wxLEFT|wxRESERVE_SPACE_EVEN_IF_HIDDEN 0 @@ -5342,7 +5340,7 @@ - + 5 wxEXPAND 0 @@ -5622,23 +5620,13 @@ - - 5 - wxEXPAND - 1 - - 3 - protected - 0 - - - + 3 wxEXPAND|wxALL 0 - + m_middleBoxSizer wxVERTICAL @@ -5786,140 +5774,129 @@ - 5 - wxEXPAND + 4 + wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT 0 - + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + ,90,90,11,70,0 + 0 + 0 + wxID_ANY + Copper layers: + 0 + + 0 + + + 0 - bSizer11 - wxHORIZONTAL - none - - 4 - wxALIGN_CENTER_VERTICAL|wxALL|wxTOP - 0 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - Copper: - 0 - - 0 - - - 0 - - 1 - m_staticText511 - 1 - - - protected - 1 - - Resizable - 1 - - - - 0 - - - - - -1 - - - - 4 - wxALL|wxEXPAND|wxTOP - 1 - - 1 - 1 - 1 - 1 - - - - - - - - 1 - 0 - "Front layer" "Back layer" "All copper layers" "None" - 1 - - 1 - 0 - Dock - 0 - Left - 1 - - 1 - - 0 - 0 - wxID_ANY - - 0 - - - 0 - - 1 - m_rbCopperLayersSel - 1 - - - protected - 1 - - Resizable - 0 - 1 - - - - 0 - - - wxFILTER_NONE - wxDefaultValidator - - - - - OnSetLayers - - + 1 + m_copperLayersLabel + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + 4 + wxALL|wxEXPAND|wxTOP + 1 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_rbCopperLayersSel + 1 + + + protected + 1 + + Resizable + 0 + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnSetCopperLayers @@ -6761,11 +6738,11 @@ -1 - + 5 wxEXPAND 0 - + 2 protected 0 @@ -6840,11 +6817,11 @@ - + Local Clearance and Settings 0 - + 1 1 1 @@ -6895,25 +6872,25 @@ wxTAB_TRAVERSAL - + bSizerPanelClearance wxVERTICAL none - + 5 wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT 0 - + bSizerClearance wxVERTICAL none - + 5 wxALL|wxEXPAND 0 - + wxID_ANY Clearances @@ -7867,11 +7844,11 @@ - + 5 wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 1 - + 1 1 1 @@ -7923,7 +7900,7 @@ OnUpdateUINonCopperWarning - + a page 0 @@ -8107,7 +8084,7 @@ - + a page 0 @@ -8961,11 +8938,11 @@ - + Custom Shape Primitives 0 - + 1 1 1 @@ -9016,16 +8993,16 @@ wxTAB_TRAVERSAL - + m_bSizerPanelPrimitives wxVERTICAL protected - + 3 wxEXPAND|wxBOTTOM 0 - + bSizerAboveList wxHORIZONTAL @@ -9219,20 +9196,20 @@ OnPrimitiveSelection - + 5 wxEXPAND 0 - + bSizerButtons wxVERTICAL none - + 5 wxEXPAND 0 - + bSizerButtonsUpper wxHORIZONTAL @@ -9529,11 +9506,11 @@ onGeometryTransform - + 5 wxEXPAND 1 - + 0 protected 0 @@ -9621,11 +9598,69 @@ - - 10 - wxEXPAND|wxTOP|wxRIGHT + + 5 + wxEXPAND|wxRIGHT|wxLEFT + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_staticline8 + 1 + + + protected + 1 + + Resizable + 1 + + wxLI_VERTICAL + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND|wxTOP|wxRIGHT|wxLEFT 1 - + 290,-1 bSizerDisplayPad wxVERTICAL @@ -9765,22 +9800,274 @@ 5 wxEXPAND - 1 + 0 - 0 + 10 protected 0 5 - wxEXPAND + wxEXPAND|wxRIGHT 12 - - 280,-1 - m_padPreviewSizer - wxVERTICAL + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + -1,320 + 1 + m_previewNotebook + 1 + + protected + 1 + + Resizable + 1 + + + ; ; forward_declare + 0 + + + + + + + Board View + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_boardViewPanel + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + 280,-1 + m_padPreviewSizer + wxVERTICAL + protected + + + + + + Stackup View + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_stackupPanel + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + wxTAB_TRAVERSAL + + + bSizer30 + wxVERTICAL + none + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + 5 + wxALL|wxALIGN_CENTER_HORIZONTAL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + + 0 + + + 0 + + 1 + m_stackupImage + 1 + + + protected + 1 + + Resizable + 1 + + ; ; forward_declare + 0 + + + + + + + + 5 + wxEXPAND + 1 + + 0 + protected + 0 + + + + + @@ -9848,19 +10135,9 @@ onChangePadMode - - 5 - wxEXPAND - 1 - - 0 - protected - 0 - - 10 - wxEXPAND|wxTOP|wxBOTTOM + wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT 0 1 diff --git a/pcbnew/dialogs/dialog_pad_properties_base.h b/pcbnew/dialogs/dialog_pad_properties_base.h index 9ef2563769..c49613c069 100644 --- a/pcbnew/dialogs/dialog_pad_properties_base.h +++ b/pcbnew/dialogs/dialog_pad_properties_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Jul 10 2019) +// C++ code generated with wxFormBuilder (version Oct 26 2018) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -10,10 +10,8 @@ #include #include #include -class DIALOG_SHIM; class TEXT_CTRL_EVAL; class WX_GRID; -class wxListView; #include "dialog_shim.h" #include @@ -154,7 +152,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxBoxSizer* m_FlippedWarningSizer; wxStaticBitmap* m_FlippedWarningIcon; wxStaticText* m_staticText86; - wxStaticText* m_staticText511; + wxStaticText* m_copperLayersLabel; wxChoice* m_rbCopperLayersSel; wxStaticText* m_techLayersLabel; wxCheckBox* m_PadLayerAdhCmp; @@ -211,9 +209,14 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM wxButton* m_buttonDup; wxButton* m_buttonGeometry; wxButton* m_buttonDel; + wxStaticLine* m_staticline8; wxStaticText* m_parentInfoLine1; wxStaticText* m_parentInfoLine2; + wxNotebook* m_previewNotebook; + wxPanel* m_boardViewPanel; wxBoxSizer* m_padPreviewSizer; + wxPanel* m_stackupPanel; + wxStaticBitmap* m_stackupImage; wxCheckBox* m_cbShowPadOutline; wxStaticLine* m_staticline13; wxStdDialogButtonSizer* m_sdbSizer; @@ -233,6 +236,7 @@ class DIALOG_PAD_PROPERTIES_BASE : public DIALOG_SHIM virtual void OnDrillShapeSelected( wxCommandEvent& event ) { event.Skip(); } virtual void OnOffsetCheckbox( wxCommandEvent& event ) { event.Skip(); } virtual void OnPadToDieCheckbox( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSetCopperLayers( wxCommandEvent& event ) { event.Skip(); } virtual void OnUpdateUINonCopperWarning( wxUpdateUIEvent& event ) { event.Skip(); } virtual void onPrimitiveDClick( wxMouseEvent& event ) { event.Skip(); } virtual void OnPrimitiveSelection( wxListEvent& event ) { event.Skip(); } diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 4bd9f93a39..8c5f2e50ab 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -706,31 +706,14 @@ void PCB_PAINTER::draw( const VIA* aVia, int aLayer ) void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) { - const D_PAD* pad = aPad; - - /// We setup the dummy pad to use in case we need to only draw the hole outline rather - /// than the pad itself - D_PAD dummypad( aPad->GetParent() ); - dummypad.SetNetCode( aPad->GetNetCode() ); - dummypad.SetSize( aPad->GetDrillSize() ); - dummypad.SetOrientation( aPad->GetOrientation() ); - dummypad.SetShape( aPad->GetDrillShape() == PAD_DRILL_SHAPE_OBLONG ? PAD_SHAPE_OVAL - : PAD_SHAPE_CIRCLE ); - dummypad.SetPosition( aPad->GetPosition() ); - - /// Pads not connected to copper are optionally not drawn - /// We draw instead the hole size to ensure we show the proper clearance - if( IsCopperLayer( aLayer ) && !aPad->IsPadOnLayer( aLayer ) ) - pad = &dummypad; - // Draw description layer if( IsNetnameLayer( aLayer ) ) { // Is anything that we can display enabled? if( m_pcbSettings.m_netNamesOnPads || m_pcbSettings.m_padNumbers ) { - bool displayNetname = ( m_pcbSettings.m_netNamesOnPads && !pad->GetNetname().empty() ); - EDA_RECT padBBox = pad->GetBoundingBox(); + bool displayNetname = ( m_pcbSettings.m_netNamesOnPads && !aPad->GetNetname().empty() ); + EDA_RECT padBBox = aPad->GetBoundingBox(); VECTOR2D position = padBBox.Centre(); VECTOR2D padsize = VECTOR2D( padBBox.GetSize() ); @@ -788,7 +771,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) if( displayNetname ) { - wxString netname = UnescapeString( pad->GetShortNetname() ); + wxString netname = UnescapeString( aPad->GetShortNetname() ); // calculate the size of net name text: double tsize = 1.5 * padsize.x / netname.Length(); tsize = std::min( tsize, size ); @@ -803,7 +786,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) if( m_pcbSettings.m_padNumbers ) { - const wxString& padName = pad->GetName(); + const wxString& padName = aPad->GetName(); textpos.y = -textpos.y; double tsize = 1.5 * padsize.x / padName.Length(); tsize = std::min( tsize, size ); @@ -828,10 +811,10 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) // Pad hole color is pad-type-specific: the background color for plated holes and the // pad color for NPTHs. Note the extra check for "should be" NPTHs to keep mis-marked // holes with no annular ring from getting "lost" in the background. - if( ( aLayer == LAYER_PADS_PLATEDHOLES ) && !pad->PadShouldBeNPTH() ) + if( ( aLayer == LAYER_PADS_PLATEDHOLES ) && !aPad->PadShouldBeNPTH() ) color = m_pcbSettings.GetBackgroundColor(); else - color = m_pcbSettings.GetColor( pad, aLayer ); + color = m_pcbSettings.GetColor( aPad, aLayer ); if( m_pcbSettings.m_sketchMode[LAYER_PADS_TH] ) { @@ -852,7 +835,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) // Choose drawing settings depending on if we are drawing a pad itself or a hole if( aLayer == LAYER_PADS_PLATEDHOLES || aLayer == LAYER_NON_PLATEDHOLES ) { - const SHAPE_SEGMENT* seg = pad->GetEffectiveHoleShape(); + const SHAPE_SEGMENT* seg = aPad->GetEffectiveHoleShape(); if( seg->GetSeg().A == seg->GetSeg().B ) // Circular hole m_gal->DrawCircle( seg->GetSeg().A, seg->GetWidth()/2 ); @@ -861,19 +844,19 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) } else { - wxSize pad_size = pad->GetSize(); + wxSize pad_size = aPad->GetSize(); wxSize margin; switch( aLayer ) { case F_Mask: case B_Mask: - margin.x = margin.y = pad->GetSolderMaskMargin(); + margin.x = margin.y = aPad->GetSolderMaskMargin(); break; case F_Paste: case B_Paste: - margin = pad->GetSolderPasteMargin(); + margin = aPad->GetSolderPasteMargin(); break; default: @@ -883,11 +866,11 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) if( margin.x != margin.y ) { - const_cast( pad )->SetSize( pad_size + margin + margin ); + const_cast( aPad )->SetSize( pad_size + margin + margin ); margin.x = margin.y = 0; } - const std::shared_ptr shapes = std::dynamic_pointer_cast( pad->GetEffectiveShape() ); + const std::shared_ptr shapes = std::dynamic_pointer_cast( aPad->GetEffectiveShape() ); if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_SEGMENT ) { @@ -902,12 +885,12 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) else { SHAPE_POLY_SET polySet; - pad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), margin.x ); + aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), margin.x ); m_gal->DrawPolygon( polySet ); } - if( pad->GetSize() != pad_size ) - const_cast( pad )->SetSize( pad_size ); + if( aPad->GetSize() != pad_size ) + const_cast( aPad )->SetSize( pad_size ); } // Clearance outlines @@ -925,7 +908,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) int clearance = aPad->GetClearance( aPad->GetLayer() ); const std::shared_ptr shapes = - std::dynamic_pointer_cast( pad->GetEffectiveShape() ); + std::dynamic_pointer_cast( aPad->GetEffectiveShape() ); if( shapes && shapes->Size() == 1 && shapes->Shapes()[0]->Type() == SH_SEGMENT ) { @@ -940,7 +923,7 @@ void PCB_PAINTER::draw( const D_PAD* aPad, int aLayer ) else { SHAPE_POLY_SET polySet; - pad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), clearance ); + aPad->TransformShapeWithClearanceToPolygon( polySet, ToLAYER_ID( aLayer ), clearance ); m_gal->DrawPolygon( polySet ); } } diff --git a/pcbnew/widgets/appearance_controls.cpp b/pcbnew/widgets/appearance_controls.cpp index 6af6532bb9..e9934fa866 100644 --- a/pcbnew/widgets/appearance_controls.cpp +++ b/pcbnew/widgets/appearance_controls.cpp @@ -285,11 +285,13 @@ const APPEARANCE_CONTROLS::APPEARANCE_SETTING APPEARANCE_CONTROLS::s_objectSetti RR(), RR( _( "Footprints Front" ), LAYER_MOD_FR, _( "Show footprints that are on board's front" ) ), RR( _( "Footprints Back" ), LAYER_MOD_BK, _( "Show footprints that are on board's back" ) ), + RR( _( "Through-hole Pads" ),LAYER_PADS_TH, _( "Show through-hole pads" ) ), RR( _( "Values" ), LAYER_MOD_VALUES, _( "Show footprint values" ) ), RR( _( "References" ), LAYER_MOD_REFERENCES, _( "Show footprint references" ) ), RR( _( "Footprint Text" ), LAYER_MOD_TEXT_FR, _( "Show footprint text" ) ), RR( _( "Hidden Text" ), LAYER_MOD_TEXT_INVISIBLE, _( "Show footprint text marked as invisible" ) ), RR(), + RR(), RR( _( "Ratsnest" ), LAYER_RATSNEST, _( "Show unconnected nets as a ratsnest") ), RR( _( "No-Connects" ), LAYER_NO_CONNECTS, _( "Show a marker on pads which have no net connected" ) ), RR( _( "DRC Warnings" ), LAYER_DRC_WARNING, _( "DRC violations with a Warning severity" ) ),