Commit a47d36e3 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: fix Bug #1163201. Fix Bug #1162779. Fix incorrect comment in CMakeLists.txt.

parent 41d254fb
...@@ -42,7 +42,7 @@ option(KICAD_STABLE_VERSION ...@@ -42,7 +42,7 @@ option(KICAD_STABLE_VERSION
) )
option(KICAD_TESTING_VERSION option(KICAD_TESTING_VERSION
"set this option to ON to build the stable version of KICAD. mainly used to set version ID (default OFF)" "set this option to ON to build the testing version of KICAD. mainly used to set version ID (default OFF)"
) )
option(KICAD_SCRIPTING option(KICAD_SCRIPTING
......
This diff is collapsed.
...@@ -236,6 +236,7 @@ void NETLIST_READER::TestFootprintsMatchingAndExchange() ...@@ -236,6 +236,7 @@ void NETLIST_READER::TestFootprintsMatchingAndExchange()
break; break;
} }
} }
if( cmp_info == NULL ) // not found in netlist if( cmp_info == NULL ) // not found in netlist
continue; continue;
...@@ -296,9 +297,11 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a ...@@ -296,9 +297,11 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a
int padcount = 0; int padcount = 0;
MODULE* module = m_pcbframe->GetBoard()->FindModuleByReference( aModule ); MODULE* module = m_pcbframe->GetBoard()->FindModuleByReference( aModule );
if( module ) if( module )
{ {
D_PAD * pad = module->FindPadByName( aPadname ); D_PAD * pad = module->FindPadByName( aPadname );
if( pad ) if( pad )
{ {
padcount++; padcount++;
...@@ -316,6 +319,7 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a ...@@ -316,6 +319,7 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a
} }
return padcount; return padcount;
} }
if( m_messageWindow ) if( m_messageWindow )
{ {
wxString msg; wxString msg;
......
...@@ -173,62 +173,104 @@ void NETLIST_READER_KICAD_PARSER::SkipCurrent() throw( IO_ERROR, PARSE_ERROR ) ...@@ -173,62 +173,104 @@ void NETLIST_READER_KICAD_PARSER::SkipCurrent() throw( IO_ERROR, PARSE_ERROR )
void NETLIST_READER_KICAD_PARSER::Parse( BOARD * aBrd ) void NETLIST_READER_KICAD_PARSER::Parse( BOARD * aBrd )
throw( IO_ERROR, PARSE_ERROR ) throw( IO_ERROR, PARSE_ERROR )
{ {
wxString text; int plevel = 0; // the count of ')' to read and end of file,
// after parsing all sections
while( ( token = NextTok() ) != T_EOF ) while( ( token = NextTok() ) != T_EOF )
{ {
if( token == T_LEFT ) if( token == T_LEFT )
token = NextTok(); token = NextTok();
if( token == T_components )
switch( token )
{ {
// The section comp starts here. case T_export: // The netlist starts here.
while( ( token = NextTok() ) != T_RIGHT ) // nothing to do here,
{ // just increment the count of ')' to read and end of file
if( token == T_LEFT ) plevel++;
token = NextTok(); break;
if( token == T_comp )
case T_version: // The netlist starts here.
// version id not yet used: read it but does not use it
NextTok();
NeedRIGHT();
break;
case T_components: // The section comp starts here.
while( ( token = NextTok() ) != T_RIGHT )
{ {
// A comp section if found. Read it if( token == T_LEFT )
COMPONENT_INFO* cmp_info = ParseComp(); token = NextTok();
netlist_reader->AddModuleInfo( cmp_info ); if( token == T_comp ) // A comp section if found. Read it
{
COMPONENT_INFO* cmp_info = ParseComp();
netlist_reader->AddModuleInfo( cmp_info );
}
} }
} if( netlist_reader->BuildModuleListOnlyOpt() )
if( netlist_reader->BuildModuleListOnlyOpt() ) return; // at this point, the module list is read and built.
return; // at this point, the module list is read and built. // Load new footprints
// Load new footprints netlist_reader->InitializeModules();
netlist_reader->InitializeModules(); netlist_reader->TestFootprintsMatchingAndExchange();
netlist_reader->TestFootprintsMatchingAndExchange(); break;
}
case T_nets: // The section nets starts here.
if( token == T_nets ) while( ( token = NextTok() ) != T_RIGHT )
{
// The section nets starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_net )
{ {
// A net section if found. Read it if( token == T_LEFT )
ParseNet( aBrd ); token = NextTok();
if( token == T_net )
{
// A net section if found. Read it
ParseNet( aBrd );
}
} }
} break;
}
if( token == T_libparts && netlist_reader->ReadLibpartSectionOpt() ) case T_libparts: // The section libparts starts here.
{ if( netlist_reader->ReadLibpartSectionOpt() )
// The section libparts starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_libpart )
{ {
// A libpart section if found. Read it while( ( token = NextTok() ) != T_RIGHT )
ParseKicadLibpartList(); {
if( token == T_LEFT )
token = NextTok();
if( token == T_libpart )
{
// A libpart section if found. Read it
ParseKicadLibpartList();
}
}
} }
} else
SkipCurrent();
break;
case T_libraries: // The section libraries starts here.
// List of libraries in use.
// Not used here, just skip it
SkipCurrent();
break;
case T_design: // The section design starts here.
// Not used (mainly thet are comments), just skip it
SkipCurrent();
break;
case T_RIGHT: // The closing parenthesis of the file.
// Not used (mainly thet are comments), just skip it
plevel--;
break;
default:
SkipCurrent();
break;
} }
} }
if( plevel != 0 )
{
wxLogDebug(wxT("NETLIST_READER_KICAD_PARSER::Parse(): bad parenthesis count (count = %d"),
plevel );
}
} }
void NETLIST_READER_KICAD_PARSER::ParseNet( BOARD * aBrd ) void NETLIST_READER_KICAD_PARSER::ParseNet( BOARD * aBrd )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment