instance specific zone container clearance and pad treatment

This commit is contained in:
dickelbeck 2008-04-02 16:58:56 +00:00
parent 9d395aa0c5
commit a91f255ccd
3 changed files with 89 additions and 16 deletions

View File

@ -78,6 +78,7 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
int ret;
unsigned corners_count = m_Poly->corner.size();
int outline_hatch;
char padoption;
fprintf( aFile, "$CZONE_OUTLINE\n" );
@ -114,6 +115,25 @@ bool ZONE_CONTAINER::Save( FILE* aFile ) const
if( ret < 2 )
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
for( item_pos = 0; item_pos < corners_count; item_pos++ )
{
@ -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
{
break;
@ -540,7 +591,7 @@ void ZONE_CONTAINER::Display_Infos( WinEDA_DrawFrame* frame )
else
msg = wxT( "<noname>" );
}
else // a netcode <à is an error
else // a netcode < 0 is an error
{
msg = wxT( " [" );
msg << m_Netname + wxT( "]" );

View File

@ -278,6 +278,30 @@ void WinEDA_ZoneFrame::CreateControls()
m_GridCtrl->SetSelection( selection );
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
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_Zone_Container->m_Poly->GetHatchStyle();
}
else
{
switch( s_Zone_Pad_Options )
{
case ZONE_CONTAINER::PAD_NOT_IN_ZONE: // Pads are not covered
@ -290,12 +314,9 @@ void WinEDA_ZoneFrame::CreateControls()
m_FillOpt->SetSelection( 0 );
break;
}
if ( m_Zone_Container )
s_Zone_Hatching = m_Zone_Container->m_Poly->GetHatchStyle();
else
s_Zone_Hatching = m_Parent->m_Parent->m_EDA_Config->Read( ZONE_NET_OUTLINES_HATCH_OPTION_KEY,
(long) CPolyLine::DIAGONAL_EDGE );
}
switch( s_Zone_Hatching )
{

View File

@ -491,7 +491,9 @@ int WinEDA_PcbFrame::Begin_Zone( wxDC* DC )
s_CurrentZone = NULL;
}
ZONE_CONTAINER* zone;
if( m_Pcb->m_CurrentZoneContour == NULL )
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
Affiche_1_Parametre( this, 22, _( "NetName" ), msg, RED );
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;
int error_level = zone_container->Fill_Zone( this, DC, verbose );