Repair formatting.
This commit is contained in:
parent
1c9cae0b06
commit
a5f5a20722
|
@ -119,11 +119,15 @@ static wxString interpret_text( const wxString& aText )
|
||||||
{
|
{
|
||||||
wxString text;
|
wxString text;
|
||||||
bool sectionOpen = false;
|
bool sectionOpen = false;
|
||||||
for ( wxString::size_type i = 0; i < aText.size(); i++ ) {
|
|
||||||
|
for ( wxString::size_type i = 0; i < aText.size(); i++ )
|
||||||
|
{
|
||||||
// Interpret escaped characters
|
// Interpret escaped characters
|
||||||
if ( aText[ i ] == '\\' ) {
|
if ( aText[ i ] == '\\' )
|
||||||
|
{
|
||||||
if ( i + 1 != aText.size() )
|
if ( i + 1 != aText.size() )
|
||||||
text.Append( aText[ i + 1 ] );
|
text.Append( aText[ i + 1 ] );
|
||||||
|
|
||||||
i++;
|
i++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -136,8 +140,10 @@ static wxString interpret_text( const wxString& aText )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( aText[ i ] == '!' ) {
|
if ( aText[ i ] == '!' )
|
||||||
if ( sectionOpen ) {
|
{
|
||||||
|
if ( sectionOpen )
|
||||||
|
{
|
||||||
text.Append( '~' );
|
text.Append( '~' );
|
||||||
sectionOpen = false;
|
sectionOpen = false;
|
||||||
continue;
|
continue;
|
||||||
|
@ -165,6 +171,7 @@ static wxString interpret_text( const wxString& aText )
|
||||||
|
|
||||||
text.Append( aText[ i ] );
|
text.Append( aText[ i ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -948,9 +955,7 @@ void EAGLE_PLUGIN::loadLibrary( wxXmlNode* aLib, const wxString* aLibName )
|
||||||
// add the templating MODULE to the MODULE template factory "m_templates"
|
// add the templating MODULE to the MODULE template factory "m_templates"
|
||||||
std::pair<MODULE_ITER, bool> r = m_templates.insert( {key, m} );
|
std::pair<MODULE_ITER, bool> r = m_templates.insert( {key, m} );
|
||||||
|
|
||||||
if( !r.second
|
if( !r.second /* && !( m_props && m_props->Value( "ignore_duplicates" ) ) */ )
|
||||||
// && !( m_props && m_props->Value( "ignore_duplicates" ) )
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
wxString lib = aLibName ? *aLibName : m_lib_path;
|
wxString lib = aLibName ? *aLibName : m_lib_path;
|
||||||
const wxString& pkg = pack_ref;
|
const wxString& pkg = pack_ref;
|
||||||
|
@ -1242,8 +1247,9 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
|
||||||
EPOLYGON p( aPolyNode );
|
EPOLYGON p( aPolyNode );
|
||||||
PCB_LAYER_ID layer = kicad_layer( p.layer );
|
PCB_LAYER_ID layer = kicad_layer( p.layer );
|
||||||
ZONE_CONTAINER* zone = nullptr;
|
ZONE_CONTAINER* zone = nullptr;
|
||||||
bool keepout = ( p.layer == EAGLE_LAYER::TRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT
|
bool keepout = ( p.layer == EAGLE_LAYER::TRESTRICT
|
||||||
|| p.layer == EAGLE_LAYER::VRESTRICT );
|
|| p.layer == EAGLE_LAYER::BRESTRICT
|
||||||
|
|| p.layer == EAGLE_LAYER::VRESTRICT );
|
||||||
|
|
||||||
if( !IsCopperLayer( layer ) && !keepout )
|
if( !IsCopperLayer( layer ) && !keepout )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
@ -1971,15 +1977,15 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
|
||||||
|
|
||||||
for( double a = end_angle + angle; fabs( a - end_angle ) > fabs( delta ); a -= delta )
|
for( double a = end_angle + angle; fabs( a - end_angle ) > fabs( delta ); a -= delta )
|
||||||
{
|
{
|
||||||
pts.push_back(
|
pts.push_back( wxPoint( KiROUND( radius * cos( a ) ),
|
||||||
wxPoint( KiROUND( radius * cos( a ) ),
|
KiROUND( radius * sin( a ) ) ) + center );
|
||||||
KiROUND( radius * sin( a ) ) ) + center );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( p.layer == EAGLE_LAYER::TRESTRICT || p.layer == EAGLE_LAYER::BRESTRICT
|
if( p.layer == EAGLE_LAYER::TRESTRICT
|
||||||
|| p.layer == EAGLE_LAYER::VRESTRICT )
|
|| p.layer == EAGLE_LAYER::BRESTRICT
|
||||||
|
|| p.layer == EAGLE_LAYER::VRESTRICT )
|
||||||
{
|
{
|
||||||
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule );
|
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule );
|
||||||
aModule->Add( zone, ADD_MODE::APPEND );
|
aModule->Add( zone, ADD_MODE::APPEND );
|
||||||
|
@ -1990,8 +1996,8 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
|
||||||
outline.SetClosed( true );
|
outline.SetClosed( true );
|
||||||
zone->Outline()->AddOutline( outline );
|
zone->Outline()->AddOutline( outline );
|
||||||
|
|
||||||
zone->SetHatch(
|
zone->SetHatch( ZONE_HATCH_STYLE::DIAGONAL_EDGE, ZONE_CONTAINER::GetDefaultHatchPitch(),
|
||||||
ZONE_HATCH_STYLE::DIAGONAL_EDGE, ZONE_CONTAINER::GetDefaultHatchPitch(), true );
|
true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2007,20 +2013,21 @@ void EAGLE_PLUGIN::packagePolygon( MODULE* aModule, wxXmlNode* aTree ) const
|
||||||
dwg->SetStart0( *pts.begin() );
|
dwg->SetStart0( *pts.begin() );
|
||||||
dwg->SetEnd0( pts.back() );
|
dwg->SetEnd0( pts.back() );
|
||||||
dwg->SetDrawCoord();
|
dwg->SetDrawCoord();
|
||||||
dwg->GetPolyShape().Inflate(
|
dwg->GetPolyShape().Inflate( p.width.ToPcbUnits() / 2, 32,
|
||||||
p.width.ToPcbUnits() / 2, 32, SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS );
|
SHAPE_POLY_SET::ALLOW_ACUTE_CORNERS );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
|
void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
|
||||||
{
|
{
|
||||||
ECIRCLE e( aTree );
|
ECIRCLE e( aTree );
|
||||||
|
|
||||||
int width = e.width.ToPcbUnits();
|
int width = e.width.ToPcbUnits();
|
||||||
int radius = e.radius.ToPcbUnits();
|
int radius = e.radius.ToPcbUnits();
|
||||||
|
|
||||||
if( e.layer == EAGLE_LAYER::TRESTRICT || e.layer == EAGLE_LAYER::BRESTRICT
|
if( e.layer == EAGLE_LAYER::TRESTRICT
|
||||||
|| e.layer == EAGLE_LAYER::VRESTRICT )
|
|| e.layer == EAGLE_LAYER::BRESTRICT
|
||||||
|
|| e.layer == EAGLE_LAYER::VRESTRICT )
|
||||||
{
|
{
|
||||||
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule );
|
MODULE_ZONE_CONTAINER* zone = new MODULE_ZONE_CONTAINER( aModule );
|
||||||
aModule->Add( zone, ADD_MODE::APPEND );
|
aModule->Add( zone, ADD_MODE::APPEND );
|
||||||
|
@ -2049,8 +2056,8 @@ void EAGLE_PLUGIN::packageCircle( MODULE* aModule, wxXmlNode* aTree ) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
zone->SetHatch(
|
zone->SetHatch( ZONE_HATCH_STYLE::DIAGONAL_EDGE, ZONE_CONTAINER::GetDefaultHatchPitch(),
|
||||||
ZONE_HATCH_STYLE::DIAGONAL_EDGE, ZONE_CONTAINER::GetDefaultHatchPitch(), true );
|
true );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -2299,7 +2306,8 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
|
||||||
// If we are curving, we need at least 2 segments otherwise
|
// If we are curving, we need at least 2 segments otherwise
|
||||||
// delta_angle == angle
|
// delta_angle == angle
|
||||||
int segments = std::max( 2, GetArcToSegmentCount( KiROUND( radius ),
|
int segments = std::max( 2, GetArcToSegmentCount( KiROUND( radius ),
|
||||||
ARC_HIGH_DEF, *w.curve ) - 1 );
|
ARC_HIGH_DEF,
|
||||||
|
*w.curve ) - 1 );
|
||||||
delta_angle = angle / segments;
|
delta_angle = angle / segments;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue