Commit a91f255c authored by dickelbeck's avatar dickelbeck

instance specific zone container clearance and pad treatment

parent 9d395aa0
...@@ -78,6 +78,7 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const ...@@ -78,6 +78,7 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
int ret; int ret;
unsigned corners_count = m_Poly->corner.size(); unsigned corners_count = m_Poly->corner.size();
int outline_hatch; int outline_hatch;
char padoption;
fprintf( aFile, "$CZONE_OUTLINE\n" ); fprintf( aFile, "$CZONE_OUTLINE\n" );
...@@ -114,6 +115,25 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const ...@@ -114,6 +115,25 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
if( ret < 2 ) if( ret < 2 )
return false; return false;
// Save pad option and clearance
switch( m_PadOption )
{
default:
case PAD_IN_ZONE:
padoption = 'I';
break;
case THERMAL_PAD:
padoption = 'T';
break;
case PAD_NOT_IN_ZONE:
padoption = 'X';
break;
}
ret = fprintf( aFile, "ZClearance %d %c\n", m_ZoneClearance, padoption );
if( ret < 2 )
return false;
// Save the corner list // Save the corner list
for( item_pos = 0; item_pos < corners_count; item_pos++ ) for( item_pos = 0; item_pos < corners_count; item_pos++ )
{ {
...@@ -224,6 +244,37 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum ) ...@@ -224,6 +244,37 @@ int ZONE_CONTAINER::ReadDescr( FILE* aFile, int* aLineNum )
} }
} }
} }
if( strnicmp( Line, "ZClearance", 10 ) == 0 ) // aux info found
{
int clearance = 200;
char padoption;
text = Line + 10;
ret = sscanf( text, "%d %1c", &clearance, &padoption );
if( ret < 2 )
error = true;
else
{
m_ZoneClearance = clearance;
switch( padoption )
{
case 'i':
case 'I':
m_PadOption = PAD_IN_ZONE;
break;
case 't':
case 'T':
m_PadOption = THERMAL_PAD;
break;
case 'x':
case 'X':
m_PadOption = PAD_NOT_IN_ZONE;
break;
}
}
}
if( strnicmp( Line, "$end", 4 ) == 0 ) // end of description if( strnicmp( Line, "$end", 4 ) == 0 ) // end of description
{ {
break; break;
...@@ -540,7 +591,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame ) ...@@ -540,7 +591,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
else else
msg = wxT( "<noname>" ); msg = wxT( "<noname>" );
} }
else // a netcode < is an error else // a netcode < 0 is an error
{ {
msg = wxT( " [" ); msg = wxT( " [" );
msg << m_Netname + wxT( "]" ); msg << m_Netname + wxT( "]" );
......
...@@ -278,7 +278,14 @@ void WinEDA_ZoneFrame::CreateControls() ...@@ -278,7 +278,14 @@ void WinEDA_ZoneFrame::CreateControls()
m_GridCtrl->SetSelection( selection ); m_GridCtrl->SetSelection( selection );
switch( s_Zone_Pad_Options ) if( m_Zone_Container )
{
title = ReturnStringFromValue( g_UnitMetric,
m_Zone_Container->m_ZoneClearance,
m_Parent->m_InternalUnits );
m_ZoneClearanceCtrl->SetValue( title );
switch( m_Zone_Container->m_PadOption )
{ {
case ZONE_CONTAINER::PAD_NOT_IN_ZONE: // Pads are not covered case ZONE_CONTAINER::PAD_NOT_IN_ZONE: // Pads are not covered
m_FillOpt->SetSelection( 2 ); m_FillOpt->SetSelection( 2 );
...@@ -290,12 +297,26 @@ void WinEDA_ZoneFrame::CreateControls() ...@@ -290,12 +297,26 @@ void WinEDA_ZoneFrame::CreateControls()
m_FillOpt->SetSelection( 0 ); m_FillOpt->SetSelection( 0 );
break; break;
} }
if ( m_Zone_Container )
s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle(); s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
}
else else
{
switch( s_Zone_Pad_Options )
{
case ZONE_CONTAINER::PAD_NOT_IN_ZONE: // Pads are not covered
m_FillOpt->SetSelection( 2 );
break;
case ZONE_CONTAINER::THERMAL_PAD: // Use thermal relief for pads
m_FillOpt->SetSelection( 1 );
break;
case ZONE_CONTAINER::PAD_IN_ZONE: // pads are covered by copper
m_FillOpt->SetSelection( 0 );
break;
}
s_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY, s_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) CPolyLine::DIAGONAL_EDGE ); (long) CPolyLine::DIAGONAL_EDGE );
}
switch( s_Zone_Hatching ) switch( s_Zone_Hatching )
{ {
......
...@@ -491,7 +491,9 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC ) ...@@ -491,7 +491,9 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
s_CurrentZone = NULL; s_CurrentZone = NULL;
} }
ZONE_CONTAINER* zone; ZONE_CONTAINER* zone;
if( m_Pcb->m_CurrentZoneContour == NULL ) if( m_Pcb->m_CurrentZoneContour == NULL )
m_Pcb->m_CurrentZoneContour = new ZONE_CONTAINER( m_Pcb ); m_Pcb->m_CurrentZoneContour = new ZONE_CONTAINER( m_Pcb );
...@@ -850,8 +852,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v ...@@ -850,8 +852,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED ); Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED );
wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor) wxBusyCursor dummy; // Shows an hourglass cursor (removed by its destructor)
zone_container->m_PadOption = s_Zone_Pad_Options;
zone_container->m_ZoneClearance = g_DesignSettings.m_ZoneClearence;
zone_container->m_GridFillValue = g_GridRoutingSize; zone_container->m_GridFillValue = g_GridRoutingSize;
int error_level = zone_container->Fill_Zone( this, DC, verbose ); int error_level = zone_container->Fill_Zone( this, DC, verbose );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment