Merge trunk @ 5278

This commit is contained in:
Garth Corral 2014-11-14 09:04:21 -08:00
commit c3a3ac9da2
13 changed files with 68 additions and 37 deletions

View File

@ -33,6 +33,7 @@ IF (WIN32)
NAMES glew glew32 glew32s NAMES glew glew32 glew32s
PATHS PATHS
$ENV{GLEW_ROOT_PATH}/lib $ENV{GLEW_ROOT_PATH}/lib
$ENV{GLEW_ROOT_PATH}/lib/Release/Win32
${OPENGL_LIBRARY_DIR} ${OPENGL_LIBRARY_DIR}
) )

View File

@ -163,20 +163,22 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent )
module = module->Next(); module = module->Next();
} }
// Print list // Print list. Also delete temporary created objects.
for( iter = list.begin(); iter != list.end(); iter++ ) for( size_t ii = list.GetCount(); ii > 0; ii-- )
{ {
cmp* current = *iter; cmp* current = *list.begin(); // Because the first object will be removed
// from list, all objects will be get here
msg.Empty(); msg.Empty();
msg << current->m_Id << wxT( ";\"" ); msg << current->m_Id << wxT( ";\"" );
msg << current->m_Ref << wxT( "\";\"" ); msg << current->m_Ref << wxT( "\";\"" );
msg << FROM_UTF8( current->m_fpid.Format().c_str() ) << wxT( "\";" ); msg << FROM_UTF8( current->m_fpid.GetFootprintName().c_str() ) << wxT( "\";" );
msg << current->m_CmpCount << wxT( ";\"" ); msg << current->m_CmpCount << wxT( ";\"" );
msg << current->m_Val << wxT( "\";;;\n" ); msg << current->m_Val << wxT( "\";;;\n" );
fprintf( fp_bom, "%s", TO_UTF8( msg ) ); fprintf( fp_bom, "%s", TO_UTF8( msg ) );
// We do not need this object, now: remove it from list and delete it
list.DeleteObject( current ); list.DeleteObject( current );
delete (current); delete (current);
} }

View File

@ -2506,6 +2506,8 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets,
pad->SetNetCode( NETINFO_LIST::UNCONNECTED ); pad->SetNetCode( NETINFO_LIST::UNCONNECTED );
} }
m_ratsnest->ProcessBoard();
// Last step: Some tests: // Last step: Some tests:
// verify all pads found in netlist: // verify all pads found in netlist:
// They should exist in footprints, otherwise the footprint is wrong // They should exist in footprints, otherwise the footprint is wrong

View File

@ -863,6 +863,12 @@ unsigned int MODULE::ViewGetLOD( int aLayer ) const
return 30; return 30;
} }
const BOX2I MODULE::ViewBBox() const
{
EDA_RECT fpRect = GetFootprintRect();
return BOX2I( VECTOR2I( fpRect.GetOrigin() ), VECTOR2I( fpRect.GetSize() ) );
}
/* Test for validity of the name in a library of the footprint /* Test for validity of the name in a library of the footprint
* ( no spaces, dir separators ... ) * ( no spaces, dir separators ... )

View File

@ -491,6 +491,9 @@ public:
/// @copydoc VIEW_ITEM::ViewGetLOD() /// @copydoc VIEW_ITEM::ViewGetLOD()
virtual unsigned int ViewGetLOD( int aLayer ) const; virtual unsigned int ViewGetLOD( int aLayer ) const;
/// @copydoc VIEW_ITEM::ViewBBox()
virtual const BOX2I ViewBBox() const;
/** /**
* Function CopyNetlistSettings * Function CopyNetlistSettings
* copies the netlist settings to \a aModule. * copies the netlist settings to \a aModule.

View File

@ -443,6 +443,9 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
comp->SetPosition( aModule->GetPosition().x * scale + dx, comp->SetPosition( aModule->GetPosition().x * scale + dx,
-aModule->GetPosition().y * scale + dy, -aModule->GetPosition().y * scale + dy,
rotz, IDF3::LYR_BOTTOM ); rotz, IDF3::LYR_BOTTOM );
comp->SetPlacement( IDF3::PS_ECAD );
} }
else else
{ {

View File

@ -370,7 +370,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "Add footprints" ), KiBitmap( module_xpm ) ); _( "Add footprints" ), KiBitmap( module_xpm ) );
text = AddHotkeyName( _( "&Track" ), g_Pcbnew_Editor_Hokeys_Descr, text = AddHotkeyName( _( "&Track" ), g_Pcbnew_Editor_Hokeys_Descr,
HK_ADD_NEW_TRACK, IS_COMMENT ); HK_ADD_NEW_TRACK );
AddMenuItem( placeMenu, ID_TRACK_BUTT, text, AddMenuItem( placeMenu, ID_TRACK_BUTT, text,
_( "Add tracks and vias" ), KiBitmap( add_tracks_xpm ) ); _( "Add tracks and vias" ), KiBitmap( add_tracks_xpm ) );

View File

@ -198,6 +198,8 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
break; break;
case B_Adhes:
case F_Adhes:
case B_Paste: case B_Paste:
case F_Paste: case F_Paste:
plotOpt.SetSkipPlotNPTH_Pads( false ); plotOpt.SetSkipPlotNPTH_Pads( false );
@ -237,9 +239,37 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
} }
break; break;
default: // These layers are plotted like silk screen layers.
// Mainly, pads on these layers are not filled.
// This is not necessary the best choice.
case Dwgs_User:
case Cmts_User:
case Eco1_User:
case Eco2_User:
case Edge_Cuts:
case Margin:
case F_CrtYd:
case B_CrtYd:
case F_Fab:
case B_Fab:
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt ); PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt );
break; break;
default:
plotOpt.SetSkipPlotNPTH_Pads( false );
plotOpt.SetDrillMarksType( PCB_PLOT_PARAMS::NO_DRILL_SHAPE );
if( plotOpt.GetFormat() == PLOT_FORMAT_DXF )
PlotLayerOutlines( aBoard, aPlotter, layer_mask, plotOpt );
else
PlotStandardLayer( aBoard, aPlotter, layer_mask, plotOpt );
break;
} }
} }
} }
@ -306,23 +336,6 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
if( ( aLayerMask & LSET::AllCuMask() ).any() ) if( ( aLayerMask & LSET::AllCuMask() ).any() )
width_adj = itemplotter.getFineWidthAdj(); width_adj = itemplotter.getFineWidthAdj();
#if 0 // was:
switch( aLayerMask &
( SOLDERMASK_LAYER_BACK | SOLDERMASK_LAYER_FRONT |
SOLDERPASTE_LAYER_BACK | SOLDERPASTE_LAYER_FRONT ) )
{
case SOLDERMASK_LAYER_FRONT:
case SOLDERMASK_LAYER_BACK:
break;
case SOLDERPASTE_LAYER_FRONT:
case SOLDERPASTE_LAYER_BACK:
break;
default:
break;
}
#else
static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste ); static const LSET speed( 4, B_Mask, F_Mask, B_Paste, F_Paste );
LSET anded = ( speed & aLayerMask ); LSET anded = ( speed & aLayerMask );
@ -335,7 +348,6 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter,
{ {
margin = pad->GetSolderPasteMargin(); margin = pad->GetSolderPasteMargin();
} }
#endif
wxSize padPlotsSize; wxSize padPlotsSize;
padPlotsSize.x = pad->GetSize().x + ( 2 * margin.x ) + width_adj; padPlotsSize.x = pad->GetSize().x + ( 2 * margin.x ) + width_adj;

View File

@ -306,7 +306,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar()
m_mainToolBar->AddSeparator(); m_mainToolBar->AddSeparator();
m_mainToolBar->AddTool( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, wxEmptyString, m_mainToolBar->AddTool( ID_TOOLBARH_PCB_FREEROUTE_ACCESS, wxEmptyString,
KiBitmap( web_support_xpm ), KiBitmap( web_support_xpm ),
_( "Fast access to the Web Based FreeROUTE advanced router" ) ); _( "Fast access to the FreeROUTE external advanced router" ) );
// Access to the scripting console // Access to the scripting console
#if defined(KICAD_SCRIPTING_WXPYTHON) #if defined(KICAD_SCRIPTING_WXPYTHON)

View File

@ -308,6 +308,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent )
controls->SetAutoPan( false ); controls->SetAutoPan( false );
setAltConstraint( false ); setAltConstraint( false );
modified = false; modified = false;
m_toolMgr->PassEvent();
} }
else if( evt->IsCancel() ) else if( evt->IsCancel() )

View File

@ -252,7 +252,8 @@ bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambigua
GENERAL_COLLECTOR collector; GENERAL_COLLECTOR collector;
// Preferred types (they have the priority when if they are covered by a bigger item) // Preferred types (they have the priority when if they are covered by a bigger item)
const KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, PCB_LINE_T, PCB_MODULE_TEXT_T, EOT }; const KICAD_T types[] = { PCB_TRACE_T, PCB_VIA_T, PCB_LINE_T,
PCB_MODULE_EDGE_T, PCB_MODULE_TEXT_T, EOT };
if( m_editModules ) if( m_editModules )
collector.Collect( getModel<BOARD>(), GENERAL_COLLECTOR::ModuleItems, collector.Collect( getModel<BOARD>(), GENERAL_COLLECTOR::ModuleItems,
@ -348,9 +349,6 @@ bool SELECTION_TOOL::selectMultiple()
if( evt->IsMouseUp( BUT_LEFT ) ) if( evt->IsMouseUp( BUT_LEFT ) )
{ {
// End drawing the selection box
m_selArea->ViewSetVisible( false );
// Mark items within the selection box as selected // Mark items within the selection box as selected
std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems; std::vector<KIGFX::VIEW::LAYER_ITEM_PAIR> selectedItems;
BOX2I selectionBox = m_selArea->ViewBBox(); BOX2I selectionBox = m_selArea->ViewBBox();
@ -384,6 +382,8 @@ bool SELECTION_TOOL::selectMultiple()
} }
} }
// Stop drawing the selection box
m_selArea->ViewSetVisible( false );
view->Remove( m_selArea ); view->Remove( m_selArea );
m_multiple = false; // Multiple selection mode is inactive m_multiple = false; // Multiple selection mode is inactive
getViewControls()->SetAutoPan( false ); getViewControls()->SetAutoPan( false );

View File

@ -728,7 +728,8 @@ void IDF3_COMP_OUTLINE_DATA::writePlaceData( std::ofstream& aBoardFile,
if( aPlacement == PS_INVALID ) if( aPlacement == PS_INVALID )
{ {
ERROR_IDF << "placement invalid; defaulting to PLACED\n"; ERROR_IDF << "placement invalid (" << aRefDes << ":";
std::cerr << aPlacement << "); defaulting to PLACED\n";
aPlacement = PS_PLACED; aPlacement = PS_PLACED;
} }

View File

@ -30,7 +30,7 @@
// a closed loop as assumed for all other outlines. // a closed loop as assumed for all other outlines.
// 3. a scheme is needed to tell a castellated edge from a plain board edge // 3. a scheme is needed to tell a castellated edge from a plain board edge
#include <iostream>
#include <sstream> #include <sstream>
#include <string> #include <string>
#include <iomanip> #include <iomanip>