Gerbview: locate item now does not take in account not visible layers. Remove an unused file

3d viewer: Remove a few ToUTF8() bad  usage (replaced by GetData() )
This commit is contained in:
jean-pierre charras 2016-08-19 09:45:59 +02:00
parent eaa7f3f114
commit 9f46d83175
8 changed files with 46 additions and 16 deletions

View File

@ -225,8 +225,8 @@ bool S3D_FILENAME_RESOLVER::createPathList( void )
while( sPL != ePL ) while( sPL != ePL )
{ {
wxLogTrace( MASK_3D_RESOLVER, " + %s : '%s'\n", (*sPL).m_alias.ToUTF8(), wxLogTrace( MASK_3D_RESOLVER, " + %s : '%s'\n", (*sPL).m_alias.GetData(),
(*sPL).m_pathexp.ToUTF8() ); (*sPL).m_pathexp.GetData() );
++sPL; ++sPL;
} }
#endif #endif
@ -317,7 +317,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
wxString errmsg = "[3D File Resolver] No such path; ensure the environment var is defined"; wxString errmsg = "[3D File Resolver] No such path; ensure the environment var is defined";
errmsg.append( "\n" ); errmsg.append( "\n" );
errmsg.append( tname ); errmsg.append( tname );
wxLogMessage( "%s\n", errmsg.ToUTF8() ); wxLogMessage( errmsg );
} }
return wxEmptyString; return wxEmptyString;
@ -392,7 +392,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
wxString errmsg = "[3D File Resolver] No such path"; wxString errmsg = "[3D File Resolver] No such path";
errmsg.append( "\n" ); errmsg.append( "\n" );
errmsg.append( tname ); errmsg.append( tname );
wxLogTrace( MASK_3D_RESOLVER, "%s\n", errmsg.ToUTF8() ); wxLogTrace( MASK_3D_RESOLVER, errmsg );
} }
return wxEmptyString; return wxEmptyString;
@ -428,7 +428,7 @@ wxString S3D_FILENAME_RESOLVER::ResolvePath( const wxString& aFileName )
wxString errmsg = "[3D File Resolver] No such path; ensure the path alias is defined"; wxString errmsg = "[3D File Resolver] No such path; ensure the path alias is defined";
errmsg.append( "\n" ); errmsg.append( "\n" );
errmsg.append( tname.substr( 1 ) ); errmsg.append( tname.substr( 1 ) );
wxLogTrace( MASK_3D_RESOLVER, "%s\n", errmsg.ToUTF8() ); wxLogTrace( MASK_3D_RESOLVER, errmsg );
} }
return wxEmptyString; return wxEmptyString;

View File

@ -61,7 +61,7 @@ S3D_PLUGIN_MANAGER::S3D_PLUGIN_MANAGER()
while( sM != eM ) while( sM != eM )
{ {
wxLogTrace( MASK_3D_PLUGINMGR, " + '%s' [%s]\n", sM->first.ToUTF8(), wxLogTrace( MASK_3D_PLUGINMGR, " + '%s' [%s]\n", sM->first.GetData(),
sM->second->GetKicadPluginName() ); sM->second->GetKicadPluginName() );
++sM; ++sM;
} }
@ -82,7 +82,7 @@ S3D_PLUGIN_MANAGER::S3D_PLUGIN_MANAGER()
while( sFF != eFF ) while( sFF != eFF )
{ {
wxLogTrace( MASK_3D_PLUGINMGR, " + '%s'\n", (*sFF).ToUTF8() ); wxLogTrace( MASK_3D_PLUGINMGR, " + '%s'\n", (*sFF).GetData() );
++sFF; ++sFF;
} }
} }
@ -348,7 +348,7 @@ void S3D_PLUGIN_MANAGER::checkPluginName( const wxString& aPath,
#ifdef DEBUG #ifdef DEBUG
wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] found 3D plugin '%s'\n", wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] found 3D plugin '%s'\n",
wxpath.ToUTF8() ); wxpath.GetData() );
#endif #endif
return; return;
@ -364,7 +364,7 @@ void S3D_PLUGIN_MANAGER::checkPluginPath( const wxString& aPath,
#ifdef DEBUG #ifdef DEBUG
wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] checking for 3D plugins in '%s'\n", wxLogTrace( MASK_3D_PLUGINMGR, " * [INFO] checking for 3D plugins in '%s'\n",
aPath.ToUTF8() ); aPath.GetData() );
#endif #endif
wxFileName path; wxFileName path;

View File

@ -486,7 +486,7 @@ void CINFO3D_VISU::createBoardPolygon()
errmsg.append( _( "Unable to calculate the board outlines." ) ); errmsg.append( _( "Unable to calculate the board outlines." ) );
errmsg.append( wxT( "\n" ) ); errmsg.append( wxT( "\n" ) );
errmsg.append( _( "Therefore use the board boundary box." ) ); errmsg.append( _( "Therefore use the board boundary box." ) );
wxLogMessage( "%s", errmsg.GetData() ); wxLogMessage( errmsg );
} }
m_board_poly.BooleanSubtract( allLayerHoles, SHAPE_POLY_SET::PM_FAST ); m_board_poly.BooleanSubtract( allLayerHoles, SHAPE_POLY_SET::PM_FAST );

View File

View File

@ -1,8 +1,8 @@
/* /*
* 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) 2012 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr * Copyright (C) 2016 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 1992-2012 KiCad Developers, see change_log.txt for contributors. * Copyright (C) 1992-2016 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
@ -38,6 +38,7 @@
/* locate a gerber item and return a pointer to it. /* locate a gerber item and return a pointer to it.
* Display info about this item * Display info about this item
* Items on non visible layers are not taken in account
*/ */
GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc ) GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc )
{ {
@ -51,10 +52,11 @@ GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc
int layer = getActiveLayer(); int layer = getActiveLayer();
GERBER_FILE_IMAGE* gerber = GetGbrImage( layer ); GERBER_FILE_IMAGE* gerber = GetGbrImage( layer );
// Search first on active layer
GERBER_DRAW_ITEM* gerb_item = NULL; GERBER_DRAW_ITEM* gerb_item = NULL;
if( gerber ) // A not used graphic layer can be selected. So gerber can be NULL // Search first on active layer
// A not used graphic layer can be selected. So gerber can be NULL
if( gerber && IsLayerVisible( layer ) )
{ {
for( gerb_item = gerber->GetItemsList(); gerb_item; gerb_item = gerb_item->Next() ) for( gerb_item = gerber->GetItemsList(); gerb_item; gerb_item = gerb_item->Next() )
{ {
@ -75,6 +77,9 @@ GERBER_DRAW_ITEM* GERBVIEW_FRAME::Locate( const wxPoint& aPosition, int aTypeloc
if( gerber == NULL ) // Graphic layer not yet used if( gerber == NULL ) // Graphic layer not yet used
continue; continue;
if( !IsLayerVisible( layer ) )
continue;
for( gerb_item = gerber->GetItemsList(); gerb_item; gerb_item = gerb_item->Next() ) for( gerb_item = gerber->GetItemsList(); gerb_item; gerb_item = gerb_item->Next() )
{ {
if( gerb_item->HitTest( ref ) ) if( gerb_item->HitTest( ref ) )

View File

@ -54,11 +54,14 @@ public:
// these members are used in the %TO object attributes command. // these members are used in the %TO object attributes command.
int m_NetAttribType; ///< the type of net info int m_NetAttribType; ///< the type of net info
///< (used to define the gerber string to create) ///< (used to define the gerber string to create)
bool m_NotInNet; ///< true if a pad of a footprint cannot be connected
///< (for instance a mechanical NPTH, ot a not named pad)
///< in this case the pad net name is empty in gerber file
wxString m_Padname; ///< for a flashed pad: the pad name ((TO.P attribute) wxString m_Padname; ///< for a flashed pad: the pad name ((TO.P attribute)
wxString m_Cmpref; ///< the component reference parent of the data wxString m_Cmpref; ///< the component reference parent of the data
wxString m_Netname; ///< for items associated to a net: the netname wxString m_Netname; ///< for items associated to a net: the netname
GBR_NETLIST_METADATA(): m_NetAttribType( GBR_NETINFO_UNSPECIFIED ) GBR_NETLIST_METADATA(): m_NetAttribType( GBR_NETINFO_UNSPECIFIED ), m_NotInNet( false )
{ {
} }

View File

@ -777,6 +777,16 @@ void FOOTPRINT_EDIT_FRAME::updateTitle()
// of libary selection UI. // of libary selection UI.
goto L_none; goto L_none;
} }
// Now, add the full path, for info
if( nickname.size() )
{
FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs();
const FP_LIB_TABLE::ROW* row = libtable->FindRow( nickname );
if( row )
title << " (" << row->GetFullURI( true ) << ")";
}
} }
SetTitle( title ); SetTitle( title );

View File

@ -721,12 +721,24 @@ void FOOTPRINT_VIEWER_FRAME::UpdateTitle()
msg << wxT( " [" ); msg << wxT( " [" );
if( getCurNickname().size() ) if( getCurNickname().size() )
{
msg << getCurNickname(); msg << getCurNickname();
}
else else
msg += _( "no library selected" ); msg += _( "no library selected" );
msg << wxT( "]" ); msg << wxT( "]" );
// Now, add the full path, for info
if( getCurNickname().size() )
{
FP_LIB_TABLE* libtable = Prj().PcbFootprintLibs();
const FP_LIB_TABLE::ROW* row = libtable->FindRow( getCurNickname() );
if( row )
msg << " (" << row->GetFullURI( true ) << ")";
}
SetTitle( msg ); SetTitle( msg );
} }