Eeschema Eagle Import: Moved net name correction to a function
This commit is contained in:
parent
b11c876e48
commit
a8e800f571
|
@ -805,8 +805,8 @@ void SCH_EAGLE_PLUGIN::loadSegments( wxXmlNode* aSegmentsNode, const wxString& n
|
||||||
|
|
||||||
if(labelled == false && wire != NULL )
|
if(labelled == false && wire != NULL )
|
||||||
{
|
{
|
||||||
wxString netname = netName;
|
wxString netname = fixNetName( netName );
|
||||||
netname.Replace("!", "~");
|
|
||||||
if(m_NetCounts[netName.ToStdString()]>1){
|
if(m_NetCounts[netName.ToStdString()]>1){
|
||||||
std::unique_ptr<SCH_GLOBALLABEL> glabel( new SCH_GLOBALLABEL );
|
std::unique_ptr<SCH_GLOBALLABEL> glabel( new SCH_GLOBALLABEL );
|
||||||
glabel->SetPosition( wire->MidPoint() );
|
glabel->SetPosition( wire->MidPoint() );
|
||||||
|
@ -884,9 +884,7 @@ SCH_TEXT* SCH_EAGLE_PLUGIN::loadLabel( wxXmlNode* aLabelNode, const wxString& aN
|
||||||
|
|
||||||
wxPoint elabelpos( elabel.x * EUNIT_TO_MIL, -elabel.y * EUNIT_TO_MIL );
|
wxPoint elabelpos( elabel.x * EUNIT_TO_MIL, -elabel.y * EUNIT_TO_MIL );
|
||||||
|
|
||||||
wxString netname = elabel.netname;
|
wxString netname = fixNetName( elabel.netname );
|
||||||
netname.Replace("~", "~~");
|
|
||||||
netname.Replace("!", "~");
|
|
||||||
|
|
||||||
if(m_NetCounts[aNetName.ToStdString()]>1){
|
if(m_NetCounts[aNetName.ToStdString()]>1){
|
||||||
std::unique_ptr<SCH_GLOBALLABEL> glabel( new SCH_GLOBALLABEL );
|
std::unique_ptr<SCH_GLOBALLABEL> glabel( new SCH_GLOBALLABEL );
|
||||||
|
@ -2378,6 +2376,14 @@ void SCH_EAGLE_PLUGIN::addBusEntries()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString SCH_EAGLE_PLUGIN::fixNetName( const wxString& aNetName )
|
||||||
|
{
|
||||||
|
wxString ret( aNetName );
|
||||||
|
ret.Replace( "~", "~~" );
|
||||||
|
ret.Replace( "!", "~" );
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void SCH_EAGLE_PLUGIN::Save( const wxString& aFileName, SCH_SCREEN* aSchematic, KIWAY* aKiway,
|
void SCH_EAGLE_PLUGIN::Save( const wxString& aFileName, SCH_SCREEN* aSchematic, KIWAY* aKiway,
|
||||||
|
|
|
@ -141,6 +141,7 @@ private:
|
||||||
void countNets( wxXmlNode* aSchematicNode );
|
void countNets( wxXmlNode* aSchematicNode );
|
||||||
void moveLabels( SCH_ITEM* wire, wxPoint newendpoint);
|
void moveLabels( SCH_ITEM* wire, wxPoint newendpoint);
|
||||||
void addBusEntries();
|
void addBusEntries();
|
||||||
|
static wxString fixNetName( const wxString& aNetName );
|
||||||
|
|
||||||
SCH_LAYER_ID kicadLayer( int aEagleLayer );
|
SCH_LAYER_ID kicadLayer( int aEagleLayer );
|
||||||
wxPoint findNearestLinePoint(wxPoint aPoint, const DLIST< SCH_LINE >& lines);
|
wxPoint findNearestLinePoint(wxPoint aPoint, const DLIST< SCH_LINE >& lines);
|
||||||
|
|
Loading…
Reference in New Issue