Browse Source

Use node & unconnected count from CONNECTIVITY object

pull/7/merge
Maciej Suminski 9 years ago
parent
commit
f1d650d5be
  1. 10
      pcbnew/class_board.cpp
  2. 26
      pcbnew/class_board.h
  3. 4
      pcbnew/legacy_plugin.cpp
  4. 3
      pcbnew/pcb_parser.cpp

10
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();
}

26
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.
*/
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.
* @return the number of unconnected nets in the current ratsnest.
*/
void SetUnconnectedNetCount( unsigned aCount ) { m_unconnectedNetCount = aCount; }
unsigned GetUnconnectedNetCount() const;
/**
* Function GetPadCount

4
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" ) )

3
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;

Loading…
Cancel
Save