Fix empty label names when importing Eagle schematic.

This commit is contained in:
Wayne Stambaugh 2024-06-21 12:07:06 -04:00
parent ece46223c9
commit b494166b10
3 changed files with 3 additions and 22 deletions

View File

@ -624,22 +624,8 @@ EJUNCTION::EJUNCTION( wxXmlNode* aJunction, IO_BASE* aIo ) :
} }
ELABEL::ELABEL( wxXmlNode* aLabel, const wxString& aNetName, IO_BASE* aIo ) :
EAGLE_BASE( aIo )
{
Parse( aLabel );
netname = aNetName;
}
ELABEL::ELABEL( wxXmlNode* aLabel, IO_BASE* aIo ) : ELABEL::ELABEL( wxXmlNode* aLabel, IO_BASE* aIo ) :
EAGLE_BASE( aIo ) EAGLE_BASE( aIo )
{
Parse( aLabel );
}
void ELABEL::Parse( wxXmlNode* aLabel )
{ {
/* /*
* <!ELEMENT label EMPTY> * <!ELEMENT label EMPTY>

View File

@ -679,12 +679,7 @@ struct ELABEL : public EAGLE_BASE
// TODO Add grouprefs // TODO Add grouprefs
wxString netname;
ELABEL( wxXmlNode* aLabel, const wxString& aNetName, IO_BASE* aIo = nullptr );
ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr ); ELABEL( wxXmlNode* aLabel, IO_BASE* aIo = nullptr );
void Parse( wxXmlNode* aLabel );
}; };

View File

@ -1619,18 +1619,18 @@ SCH_TEXT* SCH_IO_EAGLE::loadLabel( const std::unique_ptr<ELABEL>& aLabel,
else else
{ {
label = std::make_unique<SCH_LABEL>(); label = std::make_unique<SCH_LABEL>();
label->SetText( escapeName( aLabel->netname ) ); label->SetText( escapeName( aNetName ) );
} }
} }
else if( global ) else if( global )
{ {
label = std::make_unique<SCH_GLOBALLABEL>(); label = std::make_unique<SCH_GLOBALLABEL>();
label->SetText( escapeName( aLabel->netname ) ); label->SetText( escapeName( aNetName ) );
} }
else else
{ {
label = std::make_unique<SCH_LABEL>(); label = std::make_unique<SCH_LABEL>();
label->SetText( escapeName( aLabel->netname ) ); label->SetText( escapeName( aNetName ) );
} }
label->SetPosition( elabelpos ); label->SetPosition( elabelpos );