From 1b962a16604cd0991e6147235912bdd4dac37950 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Tue, 20 Sep 2022 22:15:41 -0400 Subject: [PATCH] Expand zone info a little Fixes https://gitlab.com/kicad/code/kicad/-/issues/12479 --- pcbnew/widgets/search_handlers.cpp | 23 ++++++++++++++++++++--- pcbnew/zone.cpp | 9 +++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/pcbnew/widgets/search_handlers.cpp b/pcbnew/widgets/search_handlers.cpp index b59277a8a5..9e700b3208 100644 --- a/pcbnew/widgets/search_handlers.cpp +++ b/pcbnew/widgets/search_handlers.cpp @@ -93,7 +93,9 @@ ZONE_SEARCH_HANDLER::ZONE_SEARCH_HANDLER( PCB_EDIT_FRAME* aFrame ) : SEARCH_HANDLER( wxT( "Zones" ) ), m_frame( aFrame ) { m_columnNames.emplace_back( wxT( "Name" ) ); + m_columnNames.emplace_back( wxT( "Net" ) ); m_columnNames.emplace_back( wxT( "Layer" ) ); + m_columnNames.emplace_back( wxT( "Priority" ) ); m_columnNames.emplace_back( wxT( "X" ) ); m_columnNames.emplace_back( wxT( "Y" ) ); } @@ -126,13 +128,28 @@ wxString ZONE_SEARCH_HANDLER::GetResultCell( int row, int col ) { ZONE* zone = m_hitlist[row]; + if( col == 0 ) + return zone->GetZoneName(); + if( col == 1 ) return zone->GetNetname(); - else if( col == 1 ) - return zone->GetLayerName(); else if( col == 2 ) - return m_frame->MessageTextFromValue( zone->GetX() ); + { + wxArrayString layers; + BOARD* board = m_frame->GetBoard(); + + for( PCB_LAYER_ID layer : zone->GetLayerSet().Seq() ) + { + layers.Add( board->GetLayerName( layer ) ); + } + + return wxJoin( layers, ',' ); + } else if( col == 3 ) + return wxString::Format( "%d", zone->GetAssignedPriority() ); + else if( col == 4 ) + return m_frame->MessageTextFromValue( zone->GetX() ); + else if( col == 5 ) return m_frame->MessageTextFromValue( zone->GetY() ); return wxEmptyString; diff --git a/pcbnew/zone.cpp b/pcbnew/zone.cpp index 9e43447e6c..c59fc96827 100644 --- a/pcbnew/zone.cpp +++ b/pcbnew/zone.cpp @@ -42,8 +42,13 @@ ZONE::ZONE( BOARD_ITEM_CONTAINER* aParent, bool aInFP ) : BOARD_CONNECTED_ITEM( aParent, aInFP ? PCB_FP_ZONE_T : PCB_ZONE_T ), - m_area( 0.0 ) + m_area( 0.0 ), + m_outlinearea( 0.0 ) { + m_Poly = new SHAPE_POLY_SET(); // Outlines + m_cornerSmoothingType = ZONE_SETTINGS::SMOOTHING_NONE; + m_cornerRadius = 0; + m_zoneName = wxEmptyString; m_CornerSelection = nullptr; // no corner is selected m_isFilled = false; // fill status : true when the zone is filled m_teardropType = TEARDROP_TYPE::TD_NONE; @@ -53,7 +58,6 @@ ZONE::ZONE( BOARD_ITEM_CONTAINER* aParent, bool aInFP ) : m_priority = 0; SetIsRuleArea( aInFP ); // Zones living in footprints have the rule area option SetLocalFlags( 0 ); // flags temporary used in zone calculations - m_Poly = new SHAPE_POLY_SET(); // Outlines m_fillVersion = 5; // set the "old" way to build filled polygon areas (< 6.0.x) aParent->GetZoneSettings().ExportSetting( *this ); @@ -167,6 +171,7 @@ void ZONE::InitDataFromSrcInCopyCtor( const ZONE& aZone ) m_netinfo = aZone.m_netinfo; m_area = aZone.m_area; + m_outlinearea = aZone.m_outlinearea; }