From f1d650d5bed38962bcf39bf447919996d7404f6e Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 23 Jun 2017 18:39:42 +0200 Subject: [PATCH] Use node & unconnected count from CONNECTIVITY object --- pcbnew/class_board.cpp | 10 +++++++--- pcbnew/class_board.h | 26 ++------------------------ pcbnew/legacy_plugin.cpp | 4 ++-- pcbnew/pcb_parser.cpp | 3 ++- 4 files changed, 13 insertions(+), 30 deletions(-) diff --git a/pcbnew/class_board.cpp b/pcbnew/class_board.cpp index 6b5ecf6d5b..9958aa8ab2 100644 --- a/pcbnew/class_board.cpp +++ b/pcbnew/class_board.cpp @@ -77,8 +77,6 @@ BOARD::BOARD() : m_Status_Pcb = 0; // Status word: bit 1 = calculate. SetColorsSettings( &g_ColorsSettings ); - m_nodeCount = 0; // Number of connected pads. - m_unconnectedNetCount = 0; // Number of unconnected nets. m_CurrentZoneContour = NULL; // This ZONE_CONTAINER handle the // zone contour currently in progress @@ -1054,7 +1052,13 @@ int BOARD::GetNumSegmZone() const unsigned BOARD::GetNodesCount() const { - return m_nodeCount; + return m_connectivity->GetPadCount(); +} + + +unsigned BOARD::GetUnconnectedNetCount() const +{ + return m_connectivity->GetUnconnectedCount(); } diff --git a/pcbnew/class_board.h b/pcbnew/class_board.h index b2f5cabaee..8f1eca48ee 100644 --- a/pcbnew/class_board.h +++ b/pcbnew/class_board.h @@ -198,12 +198,6 @@ private: TITLE_BLOCK m_titles; ///< text in lower right of screen and plots PCB_PLOT_PARAMS m_plotOptions; - /// Number of pads connected to the current net. - int m_nodeCount; - - /// Number of unconnected nets in the current rats nest. - int m_unconnectedNetCount; - /** * Function chainMarkedSegments * is used by MarkTrace() to set the BUSY flag of connected segments of the trace @@ -712,27 +706,11 @@ public: */ unsigned GetNodesCount() const; - /** - * Function SetNodeCount - * set the number of nodes of the current net to \a aCount. - * - * @param aCount is the number of nodes attached to the current net. - */ - void SetNodeCount( unsigned aCount ) { m_nodeCount = aCount; } - /** * Function GetUnconnectedNetCount - * @return the number of unconnected nets in the current rats nest. + * @return the number of unconnected nets in the current ratsnest. */ - unsigned GetUnconnectedNetCount() const { return m_unconnectedNetCount; } - - /** - * Function SetUnconnectedNetCount - * sets the number of unconnected nets in the current rats nest to \a aCount. - * - * @param aCount is the number of unconneceted nets in the current rats nest. - */ - void SetUnconnectedNetCount( unsigned aCount ) { m_unconnectedNetCount = aCount; } + unsigned GetUnconnectedNetCount() const; /** * Function GetPadCount diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index f4c4f9cec1..a34dc71d4f 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -654,8 +654,8 @@ void LEGACY_PLUGIN::loadGENERAL() else if( TESTLINE( "NoConn" ) ) { - int tmp = intParse( line + SZ( "NoConn" ) ); - m_board->SetUnconnectedNetCount( tmp ); + // ignore + intParse( line + SZ( "NoConn" ) ); } else if( TESTLINE( "Di" ) ) diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index 1437badad1..1f318ac8cc 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -611,7 +611,8 @@ void PCB_PARSER::parseGeneralSection() break; case T_no_connects: - m_board->SetUnconnectedNetCount( parseInt( "no connect count" ) ); + // ignore + parseInt( "no connect count" ); NeedRIGHT(); break;