Pcbnew: drill file generation: always creates a NPTH file in separate files mode (as it was made in initial code) to avoid mistakes (old broken NPTH file after board edition for instance).

Eeschema: prepare case sensitive label comparison in netlist generation.
This commit is contained in:
jean-pierre charras 2015-12-14 09:00:49 +01:00
parent 50c418a332
commit 5d429ed977
2 changed files with 26 additions and 5 deletions

View File

@ -50,6 +50,24 @@
#define IS_WIRE false #define IS_WIRE false
#define IS_BUS true #define IS_BUS true
/** @brief Kicad can use case sensitive or case insensitive comparisons for labels
* Currently, it uses case insensitive.
* Can be changed by defining LABEL_KEEPCASE (uncomment next line).
*/
//#define LABEL_KEEPCASE
/// Compiler controlled string compare function, either case independent or not:
inline int CmpLabel_KEEPCASE( const wxString& aString1, const wxString& aString2 )
{
#ifdef LABEL_KEEPCASE
// case specificity, the normal behavior:
return aString1.Cmp( aString2 );
#else
// case independence (only for guys who want that: not recommended)
return aString1.CmpNoCase( aString2 );
#endif
}
//Imported function: //Imported function:
int TestDuplicateSheetNames( bool aCreateMarker ); int TestDuplicateSheetNames( bool aCreateMarker );
@ -602,7 +620,7 @@ void NETLIST_OBJECT_LIST::sheetLabelConnect( NETLIST_OBJECT* SheetLabel )
if( ObjetNet->GetNet() == SheetLabel->GetNet() ) if( ObjetNet->GetNet() == SheetLabel->GetNet() )
continue; //already connected. continue; //already connected.
if( ObjetNet->m_Label.CmpNoCase( SheetLabel->m_Label ) != 0 ) if( CmpLabel_KEEPCASE( ObjetNet->m_Label, SheetLabel->m_Label ) != 0 )
continue; //different names. continue; //different names.
// Propagate Netcode having all the objects of the same Netcode. // Propagate Netcode having all the objects of the same Netcode.
@ -853,7 +871,7 @@ void NETLIST_OBJECT_LIST::labelConnect( NETLIST_OBJECT* aLabelRef )
// NET_PINLABEL is a kind of global label (generated by a power pin invisible) // NET_PINLABEL is a kind of global label (generated by a power pin invisible)
if( item->IsLabelType() ) if( item->IsLabelType() )
{ {
if( item->m_Label.CmpNoCase( aLabelRef->m_Label ) != 0 ) if( CmpLabel_KEEPCASE( item->m_Label, aLabelRef->m_Label ) != 0 )
continue; continue;
if( item->GetNet() ) if( item->GetNet() )

View File

@ -6,8 +6,9 @@
/* /*
* This program source code file is part of KiCad, a free EDA CAD application. * This program source code file is part of KiCad, a free EDA CAD application.
* *
* Copyright (C) 1992-2012 Jean_Pierre Charras <jp.charras at wanadoo.fr> * Copyright (C) 2015 Jean_Pierre Charras <jp.charras at wanadoo.fr>
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -100,7 +101,9 @@ void EXCELLON_WRITER::CreateDrillandMapFilesSet( const wxString& aPlotDirectory,
BuildHolesList( pair, doing_npth ); BuildHolesList( pair, doing_npth );
if( GetHolesCount() > 0 ) // has holes? // The file is created if it has holes, or if it is the non plated drill file
// to be sure the NPTH file is up to date in separate files mode.
if( GetHolesCount() > 0 || doing_npth )
{ {
fn = drillFileName( pair, doing_npth ); fn = drillFileName( pair, doing_npth );
fn.SetPath( aPlotDirectory ); fn.SetPath( aPlotDirectory );