Commit c3a3ac9d authored by Garth Corral's avatar Garth Corral

Merge trunk @ 5278

parents 7edce2fa 32eb568e
...@@ -33,6 +33,7 @@ IF (WIN32) ...@@ -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}
) )
......
...@@ -163,20 +163,22 @@ void PCB_EDIT_FRAME::RecreateBOMFileFromBoard( wxCommandEvent& aEvent ) ...@@ -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);
} }
......
...@@ -2506,6 +2506,8 @@ void BOARD::ReplaceNetlist( NETLIST& aNetlist, bool aDeleteSinglePadNets, ...@@ -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
......
...@@ -863,6 +863,12 @@ unsigned int MODULE::ViewGetLOD( int aLayer ) const ...@@ -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 ... )
......
...@@ -491,6 +491,9 @@ public: ...@@ -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.
......
...@@ -439,10 +439,13 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule, ...@@ -439,10 +439,13 @@ 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_TOP ); rotz, IDF3::LYR_TOP );
else else
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
{ {
......
...@@ -370,7 +370,7 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -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 ) );
...@@ -381,8 +381,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -381,8 +381,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
_( "&Keepout Area" ), _( "Add keepout areas" ), KiBitmap( add_keepout_area_xpm ) ); _( "&Keepout Area" ), _( "Add keepout areas" ), KiBitmap( add_keepout_area_xpm ) );
AddMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT, AddMenuItem( placeMenu, ID_PCB_ADD_TEXT_BUTT,
_( "Te&xt" ), _( "Add text on copper layers or graphic text" ), _( "Te&xt" ), _( "Add text on copper layers or graphic text" ),
KiBitmap( add_text_xpm ) ); KiBitmap( add_text_xpm ) );
AddMenuItem( placeMenu, ID_PCB_ARC_BUTT, AddMenuItem( placeMenu, ID_PCB_ARC_BUTT,
_( "&Arc" ), _( "Add graphic arc" ),KiBitmap( add_arc_xpm ) ); _( "&Arc" ), _( "Add graphic arc" ),KiBitmap( add_arc_xpm ) );
......
...@@ -198,6 +198,8 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer, ...@@ -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,8 +239,36 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer, ...@@ -237,8 +239,36 @@ void PlotOneBoardLayer( BOARD *aBoard, PLOTTER* aPlotter, LAYER_ID aLayer,
} }
break; break;
// 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 );
break;
default: default:
PlotSilkScreen( aBoard, aPlotter, layer_mask, plotOpt ); 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; break;
} }
} }
...@@ -306,23 +336,6 @@ void PlotStandardLayer( BOARD *aBoard, PLOTTER* aPlotter, ...@@ -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, ...@@ -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;
......
...@@ -306,7 +306,7 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() ...@@ -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)
......
...@@ -308,6 +308,7 @@ int POINT_EDITOR::OnSelectionChange( TOOL_EVENT& aEvent ) ...@@ -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() )
......
...@@ -252,7 +252,8 @@ bool SELECTION_TOOL::selectSingle( const VECTOR2I& aWhere, bool aAllowDisambigua ...@@ -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() ...@@ -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() ...@@ -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 );
......
...@@ -728,7 +728,8 @@ void IDF3_COMP_OUTLINE_DATA::writePlaceData( std::ofstream& aBoardFile, ...@@ -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;
} }
......
...@@ -30,7 +30,7 @@ ...@@ -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>
......
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