CADSTAR Schematic Archive Importer: Fix wires (Implied connections)

There is an implied connection between elements in a net even though
there might not be a graphical connection in the file.
This commit is contained in:
Roberto Fernandez Bautista 2021-02-04 17:50:21 +00:00 committed by Wayne Stambaugh
parent 8add7a880d
commit 0841f3ae25
1 changed files with 10 additions and 10 deletions

View File

@ -749,19 +749,19 @@ void CADSTAR_SCH_ARCHIVE_LOADER::loadNets()
if( conn.LayerID == wxT( "NO_SHEET" ) )
continue; // No point loading virtual connections. KiCad handles that internally
if( conn.Path.size() < 2 )
{
//Implied straight line connection between the two elements
POINT start = getLocationOfNetElement( net, conn.StartNode );
POINT end = getLocationOfNetElement( net, conn.EndNode );
if( start.x == UNDEFINED_VALUE || end.x == UNDEFINED_VALUE )
continue;
conn.Path.clear();
conn.Path.push_back( start );
// Connections in CADSTAR are always implied between components even if the route
// doesn't start and end exactly at the connection points
if( conn.Path.size() < 1 || conn.Path.front() != start )
conn.Path.insert( conn.Path.begin(), start );
if( conn.Path.size() < 2 || conn.Path.back() != end )
conn.Path.push_back( end );
}
bool firstPt = true;
bool secondPt = false;