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
)
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
......
This diff is collapsed.
......@@ -236,6 +236,7 @@ void NETLIST_READER::TestFootprintsMatchingAndExchange()
break;
}
}
if( cmp_info == NULL ) // not found in netlist
continue;
......@@ -296,9 +297,11 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a
int padcount = 0;
MODULE* module = m_pcbframe->GetBoard()->FindModuleByReference( aModule );
if( module )
{
D_PAD * pad = module->FindPadByName( aPadname );
if( pad )
{
padcount++;
......@@ -316,6 +319,7 @@ int NETLIST_READER::SetPadsNetName( const wxString & aModule, const wxString & a
}
return padcount;
}
if( m_messageWindow )
{
wxString msg;
......
......@@ -173,62 +173,104 @@ void NETLIST_READER_KICAD_PARSER::SkipCurrent() throw( IO_ERROR, PARSE_ERROR )
void NETLIST_READER_KICAD_PARSER::Parse( BOARD * aBrd )
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 )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_components )
switch( token )
{
// The section comp starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_comp )
case T_export: // The netlist starts here.
// nothing to do here,
// just increment the count of ')' to read and end of file
plevel++;
break;
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
COMPONENT_INFO* cmp_info = ParseComp();
netlist_reader->AddModuleInfo( cmp_info );
if( token == T_LEFT )
token = NextTok();
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() )
return; // at this point, the module list is read and built.
// Load new footprints
netlist_reader->InitializeModules();
netlist_reader->TestFootprintsMatchingAndExchange();
}
if( token == T_nets )
{
// The section nets starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_net )
if( netlist_reader->BuildModuleListOnlyOpt() )
return; // at this point, the module list is read and built.
// Load new footprints
netlist_reader->InitializeModules();
netlist_reader->TestFootprintsMatchingAndExchange();
break;
case T_nets: // The section nets starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
// A net section if found. Read it
ParseNet( aBrd );
if( token == T_LEFT )
token = NextTok();
if( token == T_net )
{
// A net section if found. Read it
ParseNet( aBrd );
}
}
}
}
break;
if( token == T_libparts && netlist_reader->ReadLibpartSectionOpt() )
{
// The section libparts starts here.
while( ( token = NextTok() ) != T_RIGHT )
{
if( token == T_LEFT )
token = NextTok();
if( token == T_libpart )
case T_libparts: // The section libparts starts here.
if( netlist_reader->ReadLibpartSectionOpt() )
{
// A libpart section if found. Read it
ParseKicadLibpartList();
while( ( token = NextTok() ) != T_RIGHT )
{
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 )
......
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