Don't add global labels when a power symbol is connected.

Fixes https://gitlab.com/kicad/code/kicad/issues/7497
This commit is contained in:
Jeff Young 2021-09-20 19:54:47 +01:00
parent 04aff93248
commit 469d3ea329
2 changed files with 15 additions and 2 deletions

View File

@ -1081,8 +1081,16 @@ void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& n
else if( nodeName == "pinref" )
{
segmentAttribute->GetAttribute( "gate" ); // REQUIRED
segmentAttribute->GetAttribute( "part" ); // REQUIRED
segmentAttribute->GetAttribute( "pin" ); // REQUIRED
wxString part = segmentAttribute->GetAttribute( "part" ); // REQUIRED
wxString pin = segmentAttribute->GetAttribute( "pin" ); // REQUIRED
auto powerPort = m_powerPorts.find( "#" + part );
if( powerPort != m_powerPorts.end()
&& powerPort->second == EscapeString( pin, CTX_NETNAME ) )
{
labelled = true;
}
}
else if( nodeName == "wire" )
{
@ -1460,6 +1468,9 @@ void SCH_EAGLE_PLUGIN::loadInstance( wxXmlNode* aInstanceNode )
for( const LIB_PIN* pin : pins )
m_connPoints[symbol->GetPinPhysicalPosition( pin )].emplace( pin );
if( part->IsPower() )
m_powerPorts[ reference ] = symbol->GetField( VALUE_FIELD )->GetText();
symbol->ClearFlags();
screen->Append( symbol.release() );

View File

@ -234,6 +234,8 @@ private:
std::map<wxString, int> m_netCounts;
std::map<int, SCH_LAYER_ID> m_layerMap;
std::map<wxString, wxString> m_powerPorts; ///< map from symbol reference to global
///< label equivalent
///< Wire intersection points, used for quick checks whether placing a net label in a particular
///< place would short two nets.