Eeschema ERC now catches errors of unmatched global labels.

This commit is contained in:
unknown 2015-08-31 13:09:47 +02:00 committed by jean-pierre charras
parent 545d127a1c
commit b0241bacf0
5 changed files with 28 additions and 8 deletions

View File

@ -52,6 +52,8 @@ wxString DRC_ITEM::GetErrorText() const
return wxString( _("Mismatch between hierarchical labels and pins sheets"));
case ERCE_NOCONNECT_CONNECTED:
return wxString( _("A no connect symbol is connected to more than 1 pin"));
case ERCE_GLOBLABEL:
return wxString( _("Global label not connected to any other global label") );
default:
return wxString( wxT("Unkown.") );

View File

@ -228,6 +228,11 @@ bool NETLIST_OBJECT::IsLabelConnected( NETLIST_OBJECT* aNetItem )
return true; //connected!
}
}
else if( ( at == NET_GLOBLABEL ) && ( bt == NET_GLOBLABEL ) )
{
if( m_Label == aNetItem->m_Label )
return true; //connected!
}
return false; //these two are unconnected
}

View File

@ -499,7 +499,6 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
case NET_LABEL:
case NET_BUSLABELMEMBER:
case NET_PINLABEL:
case NET_GLOBLABEL:
case NET_GLOBBUSLABELMEMBER:
break;
@ -507,6 +506,7 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
case NET_HIERBUSLABELMEMBER:
case NET_SHEETLABEL:
case NET_SHEETBUSLABELMEMBER:
case NET_GLOBLABEL:
// ERC problems when pin sheets do not match hierarchical labels.
// Each pin sheet must match a hierarchical label

View File

@ -251,18 +251,30 @@ void Diagnose( NETLIST_OBJECT* aNetItemRef, NETLIST_OBJECT* aNetItemTst,
{
msg.Printf( _( "Hierarchical label %s is not connected to a sheet label." ),
GetChars( aNetItemRef->m_Label ) );
marker->SetData( ERCE_HIERACHICAL_LABEL,
aNetItemRef->m_Start,
msg,
aNetItemRef->m_Start );
}
else if( (aNetItemRef->m_Type == NET_GLOBLABEL) )
{
msg.Printf( _( "Global label %s is not connected to any other global label." ),
GetChars( aNetItemRef->m_Label ) );
marker->SetData( ERCE_GLOBLABEL,
aNetItemRef->m_Start,
msg,
aNetItemRef->m_Start );
}
else
{
msg.Printf( _( "Sheet label %s is not connected to a hierarchical label." ),
GetChars( aNetItemRef->m_Label ) );
marker->SetData( ERCE_HIERACHICAL_LABEL,
aNetItemRef->m_Start,
msg,
aNetItemRef->m_Start );
}
marker->SetData( ERCE_HIERACHICAL_LABEL,
aNetItemRef->m_Start,
msg,
aNetItemRef->m_Start );
return;
}

View File

@ -1,9 +1,9 @@
/*
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2009 Jean-Pierre Charras, jaen-pierre.charras@gipsa-lab.inpg.com
* Copyright (C) 2009 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2011 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 2009-2011 KiCad Developers, see change_log.txt for contributors.
* Copyright (C) 2009-2015 KiCad Developers, see change_log.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -57,6 +57,7 @@ extern const wxString CommentERC_V[];
#define ERCE_PIN_TO_PIN_ERROR 5 // pin connected to an other pin: error level
#define ERCE_HIERACHICAL_LABEL 6 // mismatch between hierarchical labels and pins sheets
#define ERCE_NOCONNECT_CONNECTED 7 // a no connect symbol is connected to more than 1 pin
#define ERCE_GLOBLABEL 8 // global label not connected to any other global label
/* Minimal connection table */
#define NPI 4 // Net with Pin isolated, this pin has type Not Connected and must be left N.C.