kicad2step: fix "ignore virtual components" option

There isn't a "virtual" attribute any more, virtual components are now
saved without the "smd" and "through_hole" attributes.
This commit is contained in:
Simon Schaak 2021-08-28 16:43:06 +02:00 committed by Wayne Stambaugh
parent c8b2e69332
commit 58dceb143f
2 changed files with 12 additions and 1 deletions

View File

@ -46,6 +46,8 @@ KICADFOOTPRINT::KICADFOOTPRINT( KICADPCB* aParent )
m_parent = aParent; m_parent = aParent;
m_side = LAYER_NONE; m_side = LAYER_NONE;
m_rotation = 0.0; m_rotation = 0.0;
m_smd = false;
m_tht = false;
m_virtual = false; m_virtual = false;
return; return;
@ -143,6 +145,9 @@ bool KICADFOOTPRINT::Read( SEXPR::SEXPR* aEntry )
result = parseModel( child ); result = parseModel( child );
} }
if( !m_smd && !m_tht )
m_virtual = true;
return result; return result;
} }
@ -281,7 +286,11 @@ bool KICADFOOTPRINT::parseAttribute( SEXPR::SEXPR* data )
else if( child->IsString() ) else if( child->IsString() )
text = child->GetString(); text = child->GetString();
if( text == "virtual" ) if( text == "smd" )
m_smd = true;
else if( text == "through_hole" )
m_tht = true;
else if( text == "virtual" )
m_virtual = true; m_virtual = true;
return true; return true;

View File

@ -69,6 +69,8 @@ private:
std::string m_refdes; std::string m_refdes;
DOUBLET m_position; DOUBLET m_position;
double m_rotation; // rotation (radians) double m_rotation; // rotation (radians)
bool m_smd; // true for a SMD component
bool m_tht; // true for a through-hole component
bool m_virtual; // true for a virtual (usually mechanical) component bool m_virtual; // true for a virtual (usually mechanical) component
std::vector< KICADPAD* > m_pads; std::vector< KICADPAD* > m_pads;