Eagle importer: convert special characters in net names
Convert '!' to '~' to reflect overbar toggling and change '~' to '~~'. Now it matches the net names in schematics import plugin.
This commit is contained in:
parent
b1f456fade
commit
24fcdb00cc
|
@ -34,6 +34,17 @@
|
||||||
constexpr auto DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT;
|
constexpr auto DEFAULT_ALIGNMENT = ETEXT::BOTTOM_LEFT;
|
||||||
|
|
||||||
|
|
||||||
|
wxString escapeName( const wxString& aNetName )
|
||||||
|
{
|
||||||
|
wxString ret( aNetName );
|
||||||
|
|
||||||
|
ret.Replace( "~", "~~" );
|
||||||
|
ret.Replace( "!", "~" );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<> template<>
|
template<> template<>
|
||||||
OPTIONAL_XML_ATTRIBUTE<wxString>::OPTIONAL_XML_ATTRIBUTE( wxString aData )
|
OPTIONAL_XML_ATTRIBUTE<wxString>::OPTIONAL_XML_ATTRIBUTE( wxString aData )
|
||||||
{
|
{
|
||||||
|
|
|
@ -2295,14 +2295,3 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||||
} // for ( line ..
|
} // for ( line ..
|
||||||
} // for ( bus ..
|
} // for ( bus ..
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
wxString SCH_EAGLE_PLUGIN::escapeName( const wxString& aNetName )
|
|
||||||
{
|
|
||||||
wxString ret( aNetName );
|
|
||||||
|
|
||||||
ret.Replace( "~", "~~" );
|
|
||||||
ret.Replace( "!", "~" );
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
|
@ -145,9 +145,6 @@ private:
|
||||||
/// ends on an Eagle bus segment.
|
/// ends on an Eagle bus segment.
|
||||||
void addBusEntries();
|
void addBusEntries();
|
||||||
|
|
||||||
///> Translates Eagle special characters to their counterparts in KiCad.
|
|
||||||
static wxString escapeName( const wxString& aNetName );
|
|
||||||
|
|
||||||
/// Return the matching layer or return LAYER_NOTES
|
/// Return the matching layer or return LAYER_NOTES
|
||||||
SCH_LAYER_ID kiCadLayer( int aEagleLayer );
|
SCH_LAYER_ID kiCadLayer( int aEagleLayer );
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,9 @@ typedef std::map<wxString, MODULE*> MODULE_MAP;
|
||||||
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
|
typedef std::map<wxString, EINSTANCE*> EINSTANCE_MAP;
|
||||||
typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
|
typedef std::map<wxString, std::unique_ptr<EPART>> EPART_MAP;
|
||||||
|
|
||||||
|
///> Translates Eagle special characters to their counterparts in KiCad.
|
||||||
|
wxString escapeName( const wxString& aNetName );
|
||||||
|
|
||||||
static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
|
static inline wxXmlNode* getChildrenNodes( NODE_MAP& aMap, const wxString& aName )
|
||||||
{
|
{
|
||||||
auto it = aMap.find( aName );
|
auto it = aMap.find( aName );
|
||||||
|
|
|
@ -1717,7 +1717,7 @@ void EAGLE_PLUGIN::loadSignals( wxXmlNode* aSignals )
|
||||||
|
|
||||||
zones.clear();
|
zones.clear();
|
||||||
|
|
||||||
const wxString& netName = net->GetAttribute( "name" );
|
const wxString& netName = escapeName( net->GetAttribute( "name" ) );
|
||||||
m_board->Add( new NETINFO_ITEM( m_board, netName, netCode ) );
|
m_board->Add( new NETINFO_ITEM( m_board, netName, netCode ) );
|
||||||
|
|
||||||
m_xpath->Value( netName.c_str() );
|
m_xpath->Value( netName.c_str() );
|
||||||
|
|
Loading…
Reference in New Issue