ZONE_CONTAINER, display info: fix incorrect layer of zones on user layers.

Add also display on hatch count and filled polygons corner count, previously removed,
but useful for large and complex zones (that can take a lot of computation time
for DRC and display).
This commit is contained in:
jean-pierre charras 2020-06-10 20:46:38 +02:00
parent ee8cf01ff5
commit 8bd9b26717
2 changed files with 17 additions and 3 deletions

View File

@ -86,7 +86,7 @@ wxString BOARD_ITEM::LayerMaskDescribe( const BOARD* aBoard, LSET aMask )
// Check for copper.
auto layer = aBoard->GetEnabledLayers().AllCuMask() & aMask;
for( int i = 0; i < 2; i++ )
for( int i = 0; i < 3; i++ )
{
for( int bit = PCBNEW_LAYER_ID_START; bit < PCB_LAYER_ID_COUNT; ++bit )
{
@ -101,8 +101,11 @@ wxString BOARD_ITEM::LayerMaskDescribe( const BOARD* aBoard, LSET aMask )
}
}
// No copper; check for technicals.
layer = aBoard->GetEnabledLayers().AllTechMask() & aMask;
// No copper; first, check for technicals and then for all layers.
if( i < 1 ) // first, check for technicals
layer = aBoard->GetEnabledLayers().AllTechMask() & aMask;
else // then check for all other layers
layer = aMask;
}
// No copper, no technicals: no layer

View File

@ -670,6 +670,17 @@ void ZONE_CONTAINER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PA
msg.Printf( _( "Min Clearance: %s" ), MessageTextFromValue( units, clearance, true ) );
msg2.Printf( _( "(from %s)" ), source );
aList.emplace_back( msg, msg2, BLACK );
// Useful for statistics, especially when zones are complex the number of hatches
// and filled polygons can explain the display and DRC calculation time:
msg.Printf( wxT( "%d" ), (int) m_HatchLines.size() );
aList.emplace_back( MSG_PANEL_ITEM( _( "Hatch Lines" ), msg, BLUE ) );
if( !m_FilledPolysList.IsEmpty() )
{
msg.Printf( wxT( "%d" ), m_FilledPolysList.TotalVertices() );
aList.emplace_back( MSG_PANEL_ITEM( _( "Corner Count" ), msg, BLUE ) );
}
}