diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 5dd60414a6..af2bab6877 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -1019,9 +1019,17 @@ int BOARD::GetNumSegmZone() const } -unsigned BOARD::GetNodesCount() const +unsigned BOARD::GetNodesCount() { - return m_connectivity->GetPadCount(); + unsigned retval = 0; + for( auto mod : Modules() ) + { + for( auto pad : mod->Pads() ) + if( pad->GetNetCode() > 0 ) + retval++; + } + + return retval; } @@ -2941,9 +2949,15 @@ const std::vector BOARD::GetPads() } -unsigned BOARD::GetPadCount() const +unsigned BOARD::GetPadCount() { - return m_connectivity->GetPadCount(); + unsigned retval = 0; + for( auto mod : Modules() ) + { + retval += mod->Pads().Size(); + } + + return retval; } diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index 7a83b699db..95a2a223b1 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -691,7 +691,7 @@ public: * Function GetNodesCount * @return the number of pads members of nets (i.e. with netcode > 0) */ - unsigned GetNodesCount() const; + unsigned GetNodesCount(); /** * Function GetUnconnectedNetCount @@ -703,7 +703,7 @@ public: * Function GetPadCount * @return the number of pads in board */ - unsigned GetPadCount() const; + unsigned GetPadCount(); /** * Function GetPad