Cache entries are dependant on setting of aForceNoConnect

Don't use a result cached when aForceNoConnect was false when
aForceNoConnect is true.
This commit is contained in:
Jeff Young 2021-01-21 22:05:08 +00:00
parent f5e35af1a5
commit 10c6e0bc46
2 changed files with 10 additions and 5 deletions

View File

@ -238,8 +238,13 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
std::lock_guard<std::recursive_mutex> lock( m_netmap_mutex );
if( m_net_name_map.count( aPath ) > 0 )
return m_net_name_map.at( aPath );
auto it = m_net_name_map.find( aPath );
if( it != m_net_name_map.end() )
{
if( it->second.second == aForceNoConnect )
return it->second.first;
}
wxString name = "Net-(";
@ -260,7 +265,7 @@ wxString SCH_PIN::GetDefaultNetName( const SCH_SHEET_PATH& aPath, bool aForceNoC
name << "-Pad" << m_libPin->GetNumber() << ")";
if( annotated )
m_net_name_map[ aPath ] = name;
m_net_name_map[ aPath ] = std::make_pair( name, aForceNoConnect );
return name;
}

View File

@ -42,8 +42,8 @@ class SCH_PIN : public SCH_ITEM
bool m_isDangling;
/// The name that this pin connection will drive onto a net
std::recursive_mutex m_netmap_mutex;
std::map<const SCH_SHEET_PATH, wxString> m_net_name_map;
std::recursive_mutex m_netmap_mutex;
std::map<const SCH_SHEET_PATH, std::pair<wxString, bool>> m_net_name_map;
public:
SCH_PIN( LIB_PIN* aLibPin, SCH_COMPONENT* aParentSymbol );