Browse Source

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.
6.0.7
Simon Schaak 4 years ago
committed by Wayne Stambaugh
parent
commit
58dceb143f
  1. 11
      utils/kicad2step/pcb/kicadfootprint.cpp
  2. 2
      utils/kicad2step/pcb/kicadfootprint.h

11
utils/kicad2step/pcb/kicadfootprint.cpp

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

2
utils/kicad2step/pcb/kicadfootprint.h

@ -69,6 +69,8 @@ private:
std::string m_refdes;
DOUBLET m_position;
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
std::vector< KICADPAD* > m_pads;

Loading…
Cancel
Save