← Back to team overview

kicad-developers team mailing list archive

[PATCH] Explain how ERC works.

 

---
 eeschema/dialogs/dialog_erc.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/eeschema/dialogs/dialog_erc.cpp b/eeschema/dialogs/dialog_erc.cpp
index 9a850e5..681a4db 100644
--- a/eeschema/dialogs/dialog_erc.cpp
+++ b/eeschema/dialogs/dialog_erc.cpp
@@ -496,6 +496,15 @@ void DIALOG_ERC::TestErc( wxArrayString* aMessagesList )
     unsigned nextItem = lastItem = 0;
     MINIMAL_CONNECTION MinConn    = NOC;
 
+    /** The netlist generated by SCH_EDIT_FRAME::BuildNetListBase is sorted
+     * by net number, which means we can group netlist items into ranges
+     * that live in the same net. The range from nextItem to the current
+     * item (exclusive) needs to be checked against the current item. The
+     * lastItem variable is used as a helper to pass the last item's number
+     * from one loop iteration to the next, which simplifies the initial
+     * pass.
+     */
+
     for( unsigned item = 0; item < objectsConnectedList->size(); item++ )
     {
         if( objectsConnectedList->GetItemNet( lastItem ) !=