diff --git a/eeschema/class_drc_erc_item.cpp b/eeschema/class_drc_erc_item.cpp index 8e35bfeeeb..9071dc89d4 100644 --- a/eeschema/class_drc_erc_item.cpp +++ b/eeschema/class_drc_erc_item.cpp @@ -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.") ); diff --git a/eeschema/class_netlist_object.cpp b/eeschema/class_netlist_object.cpp index 169a28fee2..5d7ca6b41d 100644 --- a/eeschema/class_netlist_object.cpp +++ b/eeschema/class_netlist_object.cpp @@ -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 } diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp index 4dca4d55d1..c14aa70cfa 100644 --- a/eeschema/dialogs/dialog_erc.cpp +++ b/eeschema/dialogs/dialog_erc.cpp @@ -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 diff --git a/eeschema/erc.cpp b/eeschema/erc.cpp index e4776102b9..099249cf60 100644 --- a/eeschema/erc.cpp +++ b/eeschema/erc.cpp @@ -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; } diff --git a/eeschema/erc.h b/eeschema/erc.h index 1e015155c6..708fb6a4d0 100644 --- a/eeschema/erc.h +++ b/eeschema/erc.h @@ -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 - * 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.