diff --git a/3d-viewer/3d_canvas/board_adapter.cpp b/3d-viewer/3d_canvas/board_adapter.cpp index d4e5ccb416..a766470938 100644 --- a/3d-viewer/3d_canvas/board_adapter.cpp +++ b/3d-viewer/3d_canvas/board_adapter.cpp @@ -238,11 +238,11 @@ void BOARD_ADAPTER::SetFlag( DISPLAY3D_FLG aFlag, bool aState ) m_drawFlags[aFlag] = aState; } -bool BOARD_ADAPTER::ShouldModuleBeDisplayed( MODULE_ATTR_T aModuleAttributs ) const +bool BOARD_ADAPTER::ShouldFPBeDisplayed( FOOTPRINT_ATTR_T aFPAttributes ) const { - if( aModuleAttributs & MOD_SMD ) + if( aFPAttributes & FP_SMD ) return GetFlag( FL_FP_ATTRIBUTES_NORMAL_INSERT ); - else if( aModuleAttributs & MOD_THROUGH_HOLE ) + else if( aFPAttributes & FP_THROUGH_HOLE ) return GetFlag( FL_FP_ATTRIBUTES_NORMAL ); else return GetFlag( FL_FP_ATTRIBUTES_VIRTUAL ); diff --git a/3d-viewer/3d_canvas/board_adapter.h b/3d-viewer/3d_canvas/board_adapter.h index 54eb641950..1437d466ee 100644 --- a/3d-viewer/3d_canvas/board_adapter.h +++ b/3d-viewer/3d_canvas/board_adapter.h @@ -117,7 +117,7 @@ class BOARD_ADAPTER * relation to attributs and the flags * @return true if module should be displayed, false if not */ - bool ShouldModuleBeDisplayed( MODULE_ATTR_T aModuleAttributs ) const; + bool ShouldFPBeDisplayed( FOOTPRINT_ATTR_T aFPAttributes ) const; /** * @brief SetBoard - Set current board to be rendered diff --git a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp index 7e5e5957f9..c1bb93a5fc 100644 --- a/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp +++ b/3d-viewer/3d_rendering/3d_render_ogl_legacy/c3d_render_ogl_legacy.cpp @@ -1287,7 +1287,7 @@ void C3D_RENDER_OGL_LEGACY::render_3D_models_selected( bool aRenderTopOrBot, if( !fp->Models().empty() ) { - if( m_boardAdapter.ShouldModuleBeDisplayed( (MODULE_ATTR_T) fp->GetAttributes() ) ) + if( m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) ) { if( ( aRenderTopOrBot && !fp->IsFlipped() ) || ( !aRenderTopOrBot && fp->IsFlipped() ) ) diff --git a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp index ad28726833..586d2d3e8b 100644 --- a/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp +++ b/3d-viewer/3d_rendering/3d_render_raytracing/c3d_render_createscene.cpp @@ -1403,7 +1403,7 @@ void C3D_RENDER_RAYTRACING::load_3D_models( CCONTAINER &aDstContainer, bool aSki for( MODULE* fp : m_boardAdapter.GetBoard()->Footprints() ) { if( !fp->Models().empty() - && m_boardAdapter.ShouldModuleBeDisplayed( (MODULE_ATTR_T)fp->GetAttributes() ) ) + && m_boardAdapter.ShouldFPBeDisplayed((FOOTPRINT_ATTR_T) fp->GetAttributes()) ) { double zpos = m_boardAdapter.GetModulesZcoord3DIU( fp->IsFlipped() ); diff --git a/pcbnew/dialogs/dialog_board_statistics.cpp b/pcbnew/dialogs/dialog_board_statistics.cpp index 8fab523731..1a8bf0aa68 100644 --- a/pcbnew/dialogs/dialog_board_statistics.cpp +++ b/pcbnew/dialogs/dialog_board_statistics.cpp @@ -134,8 +134,8 @@ void DIALOG_BOARD_STATISTICS::refreshItemsTypes() // If you need some more types to be shown, simply add them to the // corresponding list - m_componentsTypes.push_back( componentsType_t( MOD_THROUGH_HOLE, _( "THT:" ) ) ); - m_componentsTypes.push_back( componentsType_t( MOD_SMD, _( "SMD:" ) ) ); + m_componentsTypes.push_back( componentsType_t( FP_THROUGH_HOLE, _( "THT:" ) ) ); + m_componentsTypes.push_back( componentsType_t( FP_SMD, _( "SMD:" ) ) ); m_padsTypes.clear(); m_padsTypes.push_back( padsType_t( PAD_ATTRIB_PTH, _( "Through hole:" ) ) ); diff --git a/pcbnew/dialogs/dialog_board_statistics.h b/pcbnew/dialogs/dialog_board_statistics.h index 00deb2805e..d6ee5a00ff 100644 --- a/pcbnew/dialogs/dialog_board_statistics.h +++ b/pcbnew/dialogs/dialog_board_statistics.h @@ -73,17 +73,17 @@ public: */ struct componentsType_t { - componentsType_t( MODULE_ATTR_T aAttribute, wxString aTitle ) + componentsType_t( FOOTPRINT_ATTR_T aAttribute, wxString aTitle ) : attribute( aAttribute ), title( aTitle ), frontSideQty( 0 ), backSideQty( 0 ) { } - MODULE_ATTR_T attribute; - wxString title; - int frontSideQty; - int backSideQty; + FOOTPRINT_ATTR_T attribute; + wxString title; + int frontSideQty; + int backSideQty; }; struct drillType_t diff --git a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp index ebc5272a89..86325ee0e6 100644 --- a/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp +++ b/pcbnew/dialogs/dialog_edit_footprint_for_fp_editor.cpp @@ -235,16 +235,16 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataToWindow() m_CostRot90Ctrl->SetValue( m_footprint->GetPlacementCost90() ); m_CostRot180Ctrl->SetValue( m_footprint->GetPlacementCost180() ); - if( m_footprint->GetAttributes() & MOD_THROUGH_HOLE ) + if( m_footprint->GetAttributes() & FP_THROUGH_HOLE ) m_componentType->SetSelection( 0 ); - else if( m_footprint->GetAttributes() & MOD_SMD ) + else if( m_footprint->GetAttributes() & FP_SMD ) m_componentType->SetSelection( 1 ); else m_componentType->SetSelection( 2 ); - m_boardOnly->SetValue( m_footprint->GetAttributes() & MOD_BOARD_ONLY ); - m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ); - m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & MOD_EXCLUDE_FROM_BOM ); + m_boardOnly->SetValue( m_footprint->GetAttributes() & FP_BOARD_ONLY ); + m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ); + m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ); // Local Clearances @@ -650,19 +650,19 @@ bool DIALOG_FOOTPRINT_FP_EDITOR::TransferDataFromWindow() switch( m_componentType->GetSelection() ) { - case 0: attributes |= MOD_THROUGH_HOLE; break; - case 1: attributes |= MOD_SMD; break; - default: break; + case 0: attributes |= FP_THROUGH_HOLE; break; + case 1: attributes |= FP_SMD; break; + default: break; } if( m_boardOnly->GetValue() ) - attributes |= MOD_BOARD_ONLY; + attributes |= FP_BOARD_ONLY; if( m_excludeFromPosFiles->GetValue() ) - attributes |= MOD_EXCLUDE_FROM_POS_FILES; + attributes |= FP_EXCLUDE_FROM_POS_FILES; if( m_excludeFromBOM->GetValue() ) - attributes |= MOD_EXCLUDE_FROM_BOM; + attributes |= FP_EXCLUDE_FROM_BOM; m_footprint->SetAttributes( attributes ); diff --git a/pcbnew/dialogs/dialog_footprint_properties.cpp b/pcbnew/dialogs/dialog_footprint_properties.cpp index 9c846190d2..97b3176706 100644 --- a/pcbnew/dialogs/dialog_footprint_properties.cpp +++ b/pcbnew/dialogs/dialog_footprint_properties.cpp @@ -316,16 +316,16 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataToWindow() m_CostRot90Ctrl->SetValue( m_footprint->GetPlacementCost90() ); m_CostRot180Ctrl->SetValue( m_footprint->GetPlacementCost180() ); - if( m_footprint->GetAttributes() & MOD_THROUGH_HOLE ) + if( m_footprint->GetAttributes() & FP_THROUGH_HOLE ) m_componentType->SetSelection( 0 ); - else if( m_footprint->GetAttributes() & MOD_SMD ) + else if( m_footprint->GetAttributes() & FP_SMD ) m_componentType->SetSelection( 1 ); else m_componentType->SetSelection( 2 ); - m_boardOnly->SetValue( m_footprint->GetAttributes() & MOD_BOARD_ONLY ); - m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ); - m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & MOD_EXCLUDE_FROM_BOM ); + m_boardOnly->SetValue( m_footprint->GetAttributes() & FP_BOARD_ONLY ); + m_excludeFromPosFiles->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ); + m_excludeFromBOM->SetValue( m_footprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ); // Local Clearances @@ -706,19 +706,19 @@ bool DIALOG_FOOTPRINT_PROPERTIES::TransferDataFromWindow() switch( m_componentType->GetSelection() ) { - case 0: attributes |= MOD_THROUGH_HOLE; break; - case 1: attributes |= MOD_SMD; break; - default: break; + case 0: attributes |= FP_THROUGH_HOLE; break; + case 1: attributes |= FP_SMD; break; + default: break; } if( m_boardOnly->GetValue() ) - attributes |= MOD_BOARD_ONLY; + attributes |= FP_BOARD_ONLY; if( m_excludeFromPosFiles->GetValue() ) - attributes |= MOD_EXCLUDE_FROM_POS_FILES; + attributes |= FP_EXCLUDE_FROM_POS_FILES; if( m_excludeFromBOM->GetValue() ) - attributes |= MOD_EXCLUDE_FROM_BOM; + attributes |= FP_EXCLUDE_FROM_BOM; m_footprint->SetAttributes( attributes ); diff --git a/pcbnew/drc/drc_test_provider_lvs.cpp b/pcbnew/drc/drc_test_provider_lvs.cpp index 90c3dbe12c..3a73c8c78d 100644 --- a/pcbnew/drc/drc_test_provider_lvs.cpp +++ b/pcbnew/drc/drc_test_provider_lvs.cpp @@ -193,7 +193,7 @@ void DRC_TEST_PROVIDER_LVS::testFootprints( NETLIST& aNetlist ) if( m_drcEngine->IsErrorLimitExceeded( DRCE_EXTRA_FOOTPRINT ) ) break; - if( footprint->GetAttributes() & MOD_BOARD_ONLY ) + if( footprint->GetAttributes() & FP_BOARD_ONLY ) continue; if( !aNetlist.GetComponentByReference( footprint->GetReference() ) ) diff --git a/pcbnew/exporters/export_footprints_placefile.cpp b/pcbnew/exporters/export_footprints_placefile.cpp index d2fc94ccbc..e4916bcf4f 100644 --- a/pcbnew/exporters/export_footprints_placefile.cpp +++ b/pcbnew/exporters/export_footprints_placefile.cpp @@ -123,7 +123,7 @@ std::string PLACE_FILE_EXPORTER::GenPositionData() continue; } - if( footprint->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ) + if( footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ) continue; if( m_excludeAllTH && footprint->HasThroughHolePads() ) @@ -328,13 +328,13 @@ std::string PLACE_FILE_EXPORTER::GenReportData() buffer += "attribut"; - if(( footprint->GetAttributes() & ( MOD_THROUGH_HOLE | MOD_SMD ) ) == 0 ) + if(( footprint->GetAttributes() & ( FP_THROUGH_HOLE | FP_SMD ) ) == 0 ) buffer += " virtual"; - if( footprint->GetAttributes() & MOD_SMD ) + if( footprint->GetAttributes() & FP_SMD ) buffer += " smd"; - if( footprint->GetAttributes() & MOD_THROUGH_HOLE ) + if( footprint->GetAttributes() & FP_THROUGH_HOLE ) buffer += " none"; buffer += "\n"; diff --git a/pcbnew/exporters/export_gencad.cpp b/pcbnew/exporters/export_gencad.cpp index 490a89d869..d345fc90d8 100644 --- a/pcbnew/exporters/export_gencad.cpp +++ b/pcbnew/exporters/export_gencad.cpp @@ -1144,7 +1144,7 @@ static void FootprintWriteShape( FILE* aFile, MODULE* module, const wxString& aS /* creates header: */ fprintf( aFile, "\nSHAPE \"%s\"\n", TO_UTF8( escapeString( aShapeName ) ) ); - if( module->GetAttributes() & MOD_THROUGH_HOLE ) + if( module->GetAttributes() & FP_THROUGH_HOLE ) fprintf( aFile, "INSERT TH\n" ); else fprintf( aFile, "INSERT SMD\n" ); diff --git a/pcbnew/exporters/gerber_placefile_writer.cpp b/pcbnew/exporters/gerber_placefile_writer.cpp index fd64185d42..916b383b63 100644 --- a/pcbnew/exporters/gerber_placefile_writer.cpp +++ b/pcbnew/exporters/gerber_placefile_writer.cpp @@ -69,7 +69,7 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER for( MODULE* footprint : m_pcb->Footprints() ) { - if( footprint->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ) + if( footprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ) continue; if( footprint->GetLayer() == aLayer ) @@ -146,9 +146,9 @@ int PLACEFILE_GERBER_WRITER::CreatePlaceFile( wxString& aFullFilename, PCB_LAYER pnpAttrib.m_MountType = GBR_CMP_PNP_METADATA::MOUNT_TYPE_UNSPECIFIED; - if( footprint->GetAttributes() & MOD_THROUGH_HOLE ) + if( footprint->GetAttributes() & FP_THROUGH_HOLE ) pnpAttrib.m_MountType = GBR_CMP_PNP_METADATA::MOUNT_TYPE_TH; - else if( footprint->GetAttributes() & MOD_SMD ) + else if( footprint->GetAttributes() & FP_SMD ) pnpAttrib.m_MountType = GBR_CMP_PNP_METADATA::MOUNT_TYPE_SMD; // Add component value info: diff --git a/pcbnew/footprint.cpp b/pcbnew/footprint.cpp index c9d8f2a3e4..f4217e2936 100644 --- a/pcbnew/footprint.cpp +++ b/pcbnew/footprint.cpp @@ -765,13 +765,13 @@ void MODULE::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vectorGetFPID().GetLibNickname().wx_str(); - m_fpname = aModule->GetFPID().GetLibItemName().wx_str(); - m_pad_count = aModule->GetPadCount( DO_NOT_INCLUDE_NPTH ); - m_unique_pad_count = aModule->GetUniquePadCount( DO_NOT_INCLUDE_NPTH ); - m_keywords = aModule->GetKeywords(); - m_doc = aModule->GetDescription(); + m_nickname = aFootprint->GetFPID().GetLibNickname().wx_str(); + m_fpname = aFootprint->GetFPID().GetLibItemName().wx_str(); + m_pad_count = aFootprint->GetPadCount( DO_NOT_INCLUDE_NPTH ); + m_unique_pad_count = aFootprint->GetUniquePadCount( DO_NOT_INCLUDE_NPTH ); + m_keywords = aFootprint->GetKeywords(); + m_doc = aFootprint->GetDescription(); m_loaded = true; } }; -void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aModule ) +void FOOTPRINT_EDIT_FRAME::editFootprintProperties( MODULE* aFootprint ) { - LIB_ID oldFPID = aModule->GetFPID(); + LIB_ID oldFPID = aFootprint->GetFPID(); - DIALOG_FOOTPRINT_FP_EDITOR dialog( this, aModule ); + DIALOG_FOOTPRINT_FP_EDITOR dialog( this, aFootprint ); dialog.ShowModal(); // Update library tree - BASIC_FOOTPRINT_INFO footprintInfo( aModule ); + BASIC_FOOTPRINT_INFO footprintInfo( aFootprint ); wxDataViewItem treeItem = m_adapter->FindItem( oldFPID ); if( treeItem.IsOk() ) // Can be not found in tree if the current footprint is imported diff --git a/pcbnew/microwave/microwave_inductor.cpp b/pcbnew/microwave/microwave_inductor.cpp index 5529be824f..3926b29e44 100644 --- a/pcbnew/microwave/microwave_inductor.cpp +++ b/pcbnew/microwave/microwave_inductor.cpp @@ -416,7 +416,7 @@ MODULE* MICROWAVE_TOOL::createMicrowaveInductor( MICROWAVE_INDUCTOR_PATTERN& aIn MODULE* footprint = editFrame.CreateNewFootprint( msg ); footprint->SetFPID( LIB_ID( wxEmptyString, wxT( "mw_inductor" ) ) ); - footprint->SetAttributes( MOD_EXCLUDE_FROM_POS_FILES | MOD_EXCLUDE_FROM_BOM ); + footprint->SetAttributes( FP_EXCLUDE_FROM_POS_FILES | FP_EXCLUDE_FROM_BOM ); footprint->ClearFlags(); footprint->SetPosition( aInductorPattern.m_End ); diff --git a/pcbnew/netlist_reader/board_netlist_updater.cpp b/pcbnew/netlist_reader/board_netlist_updater.cpp index d874d415ef..f755e862c1 100644 --- a/pcbnew/netlist_reader/board_netlist_updater.cpp +++ b/pcbnew/netlist_reader/board_netlist_updater.cpp @@ -310,19 +310,19 @@ bool BOARD_NETLIST_UPDATER::updateComponentParameters( MODULE* aPcbComponent, } if( ( aNewComponent->GetProperties().count( "exclude_from_bom" ) > 0 ) - != ( ( aPcbComponent->GetAttributes() & MOD_EXCLUDE_FROM_BOM ) > 0 ) ) + != ( ( aPcbComponent->GetAttributes() & FP_EXCLUDE_FROM_BOM ) > 0 ) ) { int attributes = aPcbComponent->GetAttributes(); if( aNewComponent->GetProperties().count( "exclude_from_bom" ) ) { - attributes |= MOD_EXCLUDE_FROM_BOM; + attributes |= FP_EXCLUDE_FROM_BOM; msg.Printf( _( "Setting %s 'exclude from BOM' fabrication attribute." ), aPcbComponent->GetReference() ); } else { - attributes &= ~MOD_EXCLUDE_FROM_BOM; + attributes &= ~FP_EXCLUDE_FROM_BOM; msg.Printf( _( "Removing %s 'exclude from BOM' fabrication attribute." ), aPcbComponent->GetReference() ); } @@ -626,7 +626,7 @@ bool BOARD_NETLIST_UPDATER::deleteUnusedComponents( NETLIST& aNetlist ) for( MODULE* footprint : m_board->Footprints() ) { - if(( footprint->GetAttributes() & MOD_BOARD_ONLY ) > 0 ) + if(( footprint->GetAttributes() & FP_BOARD_ONLY ) > 0 ) continue; if( m_lookupByTimestamp ) diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index b24b84c128..8d1f144462 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -1568,10 +1568,10 @@ void PCB_EDIT_FRAME::ShowFootprintPropertiesDialog( MODULE* aFootprint ) } -int PCB_EDIT_FRAME::ShowExchangeFootprintsDialog( MODULE* aModule, bool updateMode, +int PCB_EDIT_FRAME::ShowExchangeFootprintsDialog( MODULE* aFootprint, bool updateMode, bool selectedMode ) { - DIALOG_EXCHANGE_FOOTPRINTS dialog( this, aModule, updateMode, selectedMode ); + DIALOG_EXCHANGE_FOOTPRINTS dialog( this, aFootprint, updateMode, selectedMode ); return dialog.ShowQuasiModal(); } diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 9725d11b3a..0ffc8f7057 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -736,7 +736,7 @@ public: // Footprint editing (see also PCB_BASE_FRAME) void ShowFootprintPropertiesDialog( MODULE* aFootprint ); - int ShowExchangeFootprintsDialog( MODULE* aModule, bool updateMode, bool selectedMode ); + int ShowExchangeFootprintsDialog( MODULE* aFootprint, bool updateMode, bool selectedMode ); /** * Function Exchange_Module diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 198b682419..9291b54355 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -1299,11 +1299,11 @@ void PCB_PAINTER::draw( const FP_TEXT* aText, int aLayer ) } -void PCB_PAINTER::draw( const MODULE* aModule, int aLayer ) +void PCB_PAINTER::draw( const MODULE* aFootprint, int aLayer ) { if( aLayer == LAYER_ANCHOR ) { - const COLOR4D color = m_pcbSettings.GetColor( aModule, aLayer ); + const COLOR4D color = m_pcbSettings.GetColor( aFootprint, aLayer ); // Keep the size and width constant, not related to the scale because the anchor // is just a marker on screen @@ -1316,14 +1316,14 @@ void PCB_PAINTER::draw( const MODULE* aModule, int aLayer ) m_gal->SetStrokeColor( color ); m_gal->SetLineWidth( anchorThickness ); - VECTOR2D center = aModule->GetPosition(); + VECTOR2D center = aFootprint->GetPosition(); m_gal->DrawLine( center - VECTOR2D( anchorSize, 0 ), center + VECTOR2D( anchorSize, 0 ) ); m_gal->DrawLine( center - VECTOR2D( 0, anchorSize ), center + VECTOR2D( 0, anchorSize ) ); #if 0 // For debug purpose only: draw the footing bounding box double bboxThickness = 1.0 / m_gal->GetWorldScale(); m_gal->SetLineWidth( bboxThickness ); - EDA_RECT rect = aModule->GetBoundingBoxBase(); + EDA_RECT rect = aFootprint->GetBoundingBoxBase(); m_gal->DrawRectangle( VECTOR2D( rect.GetOrigin() ), VECTOR2D( rect.GetEnd() ) ); #endif } diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index eecd320941..c8a3c3299a 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -288,7 +288,7 @@ protected: void draw( const PCB_SHAPE* aSegment, int aLayer ); void draw( const PCB_TEXT* aText, int aLayer ); void draw( const FP_TEXT* aText, int aLayer ); - void draw( const MODULE* aModule, int aLayer ); + void draw( const MODULE* aFootprint, int aLayer ); void draw( const PCB_GROUP* aGroup, int aLayer ); void draw( const ZONE* aZone, int aLayer ); void draw( const DIMENSION_BASE* aDimension, int aLayer ); diff --git a/pcbnew/plugins/kicad/kicad_plugin.cpp b/pcbnew/plugins/kicad/kicad_plugin.cpp index 31746031cc..64b6536fee 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.cpp +++ b/pcbnew/plugins/kicad/kicad_plugin.cpp @@ -61,19 +61,19 @@ using namespace PCB_KEYS_T; class FP_CACHE_ITEM { WX_FILENAME m_filename; - std::unique_ptr m_module; + std::unique_ptr m_footprint; public: - FP_CACHE_ITEM( MODULE* aModule, const WX_FILENAME& aFileName ); + FP_CACHE_ITEM( MODULE* aFootprint, const WX_FILENAME& aFileName ); const WX_FILENAME& GetFileName() const { return m_filename; } - const MODULE* GetModule() const { return m_module.get(); } + const MODULE* GetModule() const { return m_footprint.get(); } }; -FP_CACHE_ITEM::FP_CACHE_ITEM( MODULE* aModule, const WX_FILENAME& aFileName ) : - m_filename( aFileName ), - m_module( aModule ) +FP_CACHE_ITEM::FP_CACHE_ITEM( MODULE* aFootprint, const WX_FILENAME& aFileName ) : + m_filename( aFileName ), + m_footprint( aFootprint ) { } @@ -109,9 +109,9 @@ public: /** * Save the footprint cache or a single module from it to disk * - * @param aModule if set, save only this module, otherwise, save the full library + * @param aFootprint if set, save only this module, otherwise, save the full library */ - void Save( MODULE* aModule = NULL ); + void Save( MODULE* aFootprint = NULL ); void Load(); @@ -154,7 +154,7 @@ FP_CACHE::FP_CACHE( PCB_IO* aOwner, const wxString& aLibraryPath ) } -void FP_CACHE::Save( MODULE* aModule ) +void FP_CACHE::Save( MODULE* aFootprint ) { m_cache_timestamp = 0; @@ -172,7 +172,7 @@ void FP_CACHE::Save( MODULE* aModule ) for( MODULE_ITER it = m_modules.begin(); it != m_modules.end(); ++it ) { - if( aModule && aModule != it->second->GetModule() ) + if( aFootprint && aFootprint != it->second->GetModule() ) continue; WX_FILENAME fn = it->second->GetFileName(); @@ -216,7 +216,7 @@ void FP_CACHE::Save( MODULE* aModule ) m_cache_timestamp += m_lib_path.GetModificationTime().GetValue().GetValue(); // If we've saved the full cache, we clear the dirty flag. - if( !aModule ) + if( !aFootprint ) m_cache_dirty = false; } @@ -846,39 +846,39 @@ void PCB_IO::format( PCB_SHAPE* aShape, int aNestLevel ) const } -void PCB_IO::format( FP_SHAPE* aModuleDrawing, int aNestLevel ) const +void PCB_IO::format( FP_SHAPE* aFPShape, int aNestLevel ) const { - switch( aModuleDrawing->GetShape() ) + switch( aFPShape->GetShape() ) { case S_SEGMENT: // Line m_out->Print( aNestLevel, "(fp_line (start %s) (end %s)", - FormatInternalUnits( aModuleDrawing->GetStart0() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetEnd0() ).c_str() ); + FormatInternalUnits( aFPShape->GetStart0() ).c_str(), + FormatInternalUnits( aFPShape->GetEnd0() ).c_str() ); break; case S_RECT: // Rectangle m_out->Print( aNestLevel, "(fp_rect (start %s) (end %s)", - FormatInternalUnits( aModuleDrawing->GetStart0() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetEnd0() ).c_str() ); + FormatInternalUnits( aFPShape->GetStart0() ).c_str(), + FormatInternalUnits( aFPShape->GetEnd0() ).c_str() ); break; case S_CIRCLE: // Circle m_out->Print( aNestLevel, "(fp_circle (center %s) (end %s)", - FormatInternalUnits( aModuleDrawing->GetStart0() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetEnd0() ).c_str() ); + FormatInternalUnits( aFPShape->GetStart0() ).c_str(), + FormatInternalUnits( aFPShape->GetEnd0() ).c_str() ); break; case S_ARC: // Arc m_out->Print( aNestLevel, "(fp_arc (start %s) (end %s) (angle %s)", - FormatInternalUnits( aModuleDrawing->GetStart0() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetEnd0() ).c_str(), - FormatAngle( aModuleDrawing->GetAngle() ).c_str() ); + FormatInternalUnits( aFPShape->GetStart0() ).c_str(), + FormatInternalUnits( aFPShape->GetEnd0() ).c_str(), + FormatAngle( aFPShape->GetAngle() ).c_str() ); break; case S_POLYGON: // Polygonal segment - if( aModuleDrawing->IsPolyShapeValid() ) + if( aFPShape->IsPolyShapeValid() ) { - SHAPE_POLY_SET& poly = aModuleDrawing->GetPolyShape(); + SHAPE_POLY_SET& poly = aFPShape->GetPolyShape(); SHAPE_LINE_CHAIN& outline = poly.Outline( 0 ); int pointsCount = outline.PointCount(); @@ -909,23 +909,23 @@ void PCB_IO::format( FP_SHAPE* aModuleDrawing, int aNestLevel ) const case S_CURVE: // Bezier curve m_out->Print( aNestLevel, "(fp_curve (pts (xy %s) (xy %s) (xy %s) (xy %s))", - FormatInternalUnits( aModuleDrawing->GetStart0() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetBezier0_C1() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetBezier0_C2() ).c_str(), - FormatInternalUnits( aModuleDrawing->GetEnd0() ).c_str() ); + FormatInternalUnits( aFPShape->GetStart0() ).c_str(), + FormatInternalUnits( aFPShape->GetBezier0_C1() ).c_str(), + FormatInternalUnits( aFPShape->GetBezier0_C2() ).c_str(), + FormatInternalUnits( aFPShape->GetEnd0() ).c_str() ); break; default: wxFAIL_MSG( "PCB_IO::format cannot format unknown FP_SHAPE shape:" - + PCB_SHAPE_TYPE_T_asString( aModuleDrawing->GetShape() ) ); + + PCB_SHAPE_TYPE_T_asString( aFPShape->GetShape() ) ); return; }; - formatLayer( aModuleDrawing ); + formatLayer( aFPShape ); - m_out->Print( 0, " (width %s)", FormatInternalUnits( aModuleDrawing->GetWidth() ).c_str() ); + m_out->Print( 0, " (width %s)", FormatInternalUnits( aFPShape->GetWidth() ).c_str() ); - m_out->Print( 0, " (tstamp %s)", TO_UTF8( aModuleDrawing->m_Uuid.AsString() ) ); + m_out->Print( 0, " (tstamp %s)", TO_UTF8( aFPShape->m_Uuid.AsString() ) ); m_out->Print( 0, ")\n" ); } @@ -949,11 +949,11 @@ void PCB_IO::format( PCB_TARGET* aTarget, int aNestLevel ) const } -void PCB_IO::format( MODULE* aModule, int aNestLevel ) const +void PCB_IO::format( MODULE* aFootprint, int aNestLevel ) const { if( !( m_ctl & CTL_OMIT_INITIAL_COMMENTS ) ) { - const wxArrayString* initial_comments = aModule->GetInitialComments(); + const wxArrayString* initial_comments = aFootprint->GetInitialComments(); if( initial_comments ) { @@ -966,45 +966,45 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const if( m_ctl & CTL_OMIT_LIBNAME ) m_out->Print( aNestLevel, "(module %s", - m_out->Quotes( aModule->GetFPID().GetLibItemNameAndRev() ).c_str() ); + m_out->Quotes( aFootprint->GetFPID().GetLibItemNameAndRev() ).c_str() ); else m_out->Print( aNestLevel, "(module %s", - m_out->Quotes( aModule->GetFPID().Format() ).c_str() ); + m_out->Quotes( aFootprint->GetFPID().Format() ).c_str() ); - if( aModule->IsLocked() ) + if( aFootprint->IsLocked() ) m_out->Print( 0, " locked" ); - if( aModule->IsPlaced() ) + if( aFootprint->IsPlaced() ) m_out->Print( 0, " placed" ); - formatLayer( aModule ); + formatLayer( aFootprint ); - m_out->Print( 0, " (tedit %lX)", (unsigned long)aModule->GetLastEditTime() ); + m_out->Print( 0, " (tedit %lX)", (unsigned long)aFootprint->GetLastEditTime() ); if( !( m_ctl & CTL_OMIT_TSTAMPS ) ) - m_out->Print( 0, " (tstamp %s)", TO_UTF8( aModule->m_Uuid.AsString() ) ); + m_out->Print( 0, " (tstamp %s)", TO_UTF8( aFootprint->m_Uuid.AsString() ) ); m_out->Print( 0, "\n" ); if( !( m_ctl & CTL_OMIT_AT ) ) { - m_out->Print( aNestLevel+1, "(at %s", FormatInternalUnits( aModule->GetPosition() ).c_str() ); + m_out->Print( aNestLevel+1, "(at %s", FormatInternalUnits( aFootprint->GetPosition() ).c_str() ); - if( aModule->GetOrientation() != 0.0 ) - m_out->Print( 0, " %s", FormatAngle( aModule->GetOrientation() ).c_str() ); + if( aFootprint->GetOrientation() != 0.0 ) + m_out->Print( 0, " %s", FormatAngle( aFootprint->GetOrientation() ).c_str() ); m_out->Print( 0, ")\n" ); } - if( !aModule->GetDescription().IsEmpty() ) + if( !aFootprint->GetDescription().IsEmpty() ) m_out->Print( aNestLevel+1, "(descr %s)\n", - m_out->Quotew( aModule->GetDescription() ).c_str() ); + m_out->Quotew( aFootprint->GetDescription() ).c_str() ); - if( !aModule->GetKeywords().IsEmpty() ) + if( !aFootprint->GetKeywords().IsEmpty() ) m_out->Print( aNestLevel+1, "(tags %s)\n", - m_out->Quotew( aModule->GetKeywords() ).c_str() ); + m_out->Quotew( aFootprint->GetKeywords() ).c_str() ); - const std::map& props = aModule->GetProperties(); + const std::map& props = aFootprint->GetProperties(); for( const std::pair& prop : props ) { @@ -1013,78 +1013,78 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const m_out->Quotew( prop.second ).c_str() ); } - if( !( m_ctl & CTL_OMIT_PATH ) && !aModule->GetPath().empty() ) + if( !( m_ctl & CTL_OMIT_PATH ) && !aFootprint->GetPath().empty() ) m_out->Print( aNestLevel+1, "(path %s)\n", - m_out->Quotew( aModule->GetPath().AsString() ).c_str() ); + m_out->Quotew( aFootprint->GetPath().AsString() ).c_str() ); - if( aModule->GetPlacementCost90() != 0 ) - m_out->Print( aNestLevel+1, "(autoplace_cost90 %d)\n", aModule->GetPlacementCost90() ); + if( aFootprint->GetPlacementCost90() != 0 ) + m_out->Print( aNestLevel+1, "(autoplace_cost90 %d)\n", aFootprint->GetPlacementCost90() ); - if( aModule->GetPlacementCost180() != 0 ) - m_out->Print( aNestLevel+1, "(autoplace_cost180 %d)\n", aModule->GetPlacementCost180() ); + if( aFootprint->GetPlacementCost180() != 0 ) + m_out->Print( aNestLevel+1, "(autoplace_cost180 %d)\n", aFootprint->GetPlacementCost180() ); - if( aModule->GetLocalSolderMaskMargin() != 0 ) + if( aFootprint->GetLocalSolderMaskMargin() != 0 ) m_out->Print( aNestLevel+1, "(solder_mask_margin %s)\n", - FormatInternalUnits( aModule->GetLocalSolderMaskMargin() ).c_str() ); + FormatInternalUnits( aFootprint->GetLocalSolderMaskMargin() ).c_str() ); - if( aModule->GetLocalSolderPasteMargin() != 0 ) + if( aFootprint->GetLocalSolderPasteMargin() != 0 ) m_out->Print( aNestLevel+1, "(solder_paste_margin %s)\n", - FormatInternalUnits( aModule->GetLocalSolderPasteMargin() ).c_str() ); + FormatInternalUnits( aFootprint->GetLocalSolderPasteMargin() ).c_str() ); - if( aModule->GetLocalSolderPasteMarginRatio() != 0 ) + if( aFootprint->GetLocalSolderPasteMarginRatio() != 0 ) m_out->Print( aNestLevel+1, "(solder_paste_ratio %s)\n", - Double2Str( aModule->GetLocalSolderPasteMarginRatio() ).c_str() ); + Double2Str( aFootprint->GetLocalSolderPasteMarginRatio() ).c_str() ); - if( aModule->GetLocalClearance() != 0 ) + if( aFootprint->GetLocalClearance() != 0 ) m_out->Print( aNestLevel+1, "(clearance %s)\n", - FormatInternalUnits( aModule->GetLocalClearance() ).c_str() ); + FormatInternalUnits( aFootprint->GetLocalClearance() ).c_str() ); - if( aModule->GetZoneConnection() != ZONE_CONNECTION::INHERITED ) + if( aFootprint->GetZoneConnection() != ZONE_CONNECTION::INHERITED ) m_out->Print( aNestLevel+1, "(zone_connect %d)\n", - static_cast( aModule->GetZoneConnection() ) ); + static_cast( aFootprint->GetZoneConnection() ) ); - if( aModule->GetThermalWidth() != 0 ) + if( aFootprint->GetThermalWidth() != 0 ) m_out->Print( aNestLevel+1, "(thermal_width %s)\n", - FormatInternalUnits( aModule->GetThermalWidth() ).c_str() ); + FormatInternalUnits( aFootprint->GetThermalWidth() ).c_str() ); - if( aModule->GetThermalGap() != 0 ) + if( aFootprint->GetThermalGap() != 0 ) m_out->Print( aNestLevel+1, "(thermal_gap %s)\n", - FormatInternalUnits( aModule->GetThermalGap() ).c_str() ); + FormatInternalUnits( aFootprint->GetThermalGap() ).c_str() ); // Attributes - if( aModule->GetAttributes() ) + if( aFootprint->GetAttributes() ) { m_out->Print( aNestLevel+1, "(attr" ); - if( aModule->GetAttributes() & MOD_SMD ) + if( aFootprint->GetAttributes() & FP_SMD ) m_out->Print( 0, " smd" ); - if( aModule->GetAttributes() & MOD_THROUGH_HOLE ) + if( aFootprint->GetAttributes() & FP_THROUGH_HOLE ) m_out->Print( 0, " through_hole" ); - if( aModule->GetAttributes() & MOD_BOARD_ONLY ) + if( aFootprint->GetAttributes() & FP_BOARD_ONLY ) m_out->Print( 0, " board_only" ); - if( aModule->GetAttributes() & MOD_EXCLUDE_FROM_POS_FILES ) + if( aFootprint->GetAttributes() & FP_EXCLUDE_FROM_POS_FILES ) m_out->Print( 0, " exclude_from_pos_files" ); - if( aModule->GetAttributes() & MOD_EXCLUDE_FROM_BOM ) + if( aFootprint->GetAttributes() & FP_EXCLUDE_FROM_BOM ) m_out->Print( 0, " exclude_from_bom" ); m_out->Print( 0, ")\n" ); } - Format( (BOARD_ITEM*) &aModule->Reference(), aNestLevel+1 ); - Format( (BOARD_ITEM*) &aModule->Value(), aNestLevel+1 ); + Format((BOARD_ITEM*) &aFootprint->Reference(), aNestLevel + 1 ); + Format((BOARD_ITEM*) &aFootprint->Value(), aNestLevel + 1 ); - std::set sorted_pads( aModule->Pads().begin(), - aModule->Pads().end() ); - std::set sorted_drawings( aModule->GraphicalItems().begin(), - aModule->GraphicalItems().end() ); - std::set sorted_zones( aModule->Zones().begin(), - aModule->Zones().end() ); - std::set sorted_groups( aModule->Groups().begin(), - aModule->Groups().end() ); + std::set sorted_pads( aFootprint->Pads().begin(), + aFootprint->Pads().end() ); + std::set sorted_drawings( aFootprint->GraphicalItems().begin(), + aFootprint->GraphicalItems().end() ); + std::set sorted_zones( aFootprint->Zones().begin(), + aFootprint->Zones().end() ); + std::set sorted_groups( aFootprint->Groups().begin(), + aFootprint->Groups().end() ); // Save drawing elements. @@ -1104,8 +1104,8 @@ void PCB_IO::format( MODULE* aModule, int aNestLevel ) const Format( group, aNestLevel + 1 ); // Save 3D info. - auto bs3D = aModule->Models().begin(); - auto es3D = aModule->Models().end(); + auto bs3D = aFootprint->Models().begin(); + auto es3D = aFootprint->Models().end(); while( bs3D != es3D ) { diff --git a/pcbnew/plugins/kicad/kicad_plugin.h b/pcbnew/plugins/kicad/kicad_plugin.h index 5ad1d3cad3..3115f9cb82 100644 --- a/pcbnew/plugins/kicad/kicad_plugin.h +++ b/pcbnew/plugins/kicad/kicad_plugin.h @@ -260,7 +260,7 @@ private: void format( DIMENSION_BASE* aDimension, int aNestLevel = 0 ) const; - void format( FP_SHAPE* aModuleDrawing, int aNestLevel = 0 ) const; + void format( FP_SHAPE* aFPShape, int aNestLevel = 0 ) const; void format( PCB_GROUP* aGroup, int aNestLevel = 0 ) const; @@ -268,7 +268,7 @@ private: void format( PCB_TARGET* aTarget, int aNestLevel = 0 ) const; - void format( MODULE* aModule, int aNestLevel = 0 ) const; + void format( MODULE* aFootprint, int aNestLevel = 0 ) const; void format( PAD* aPad, int aNestLevel = 0 ) const; diff --git a/pcbnew/plugins/kicad/pcb_parser.cpp b/pcbnew/plugins/kicad/pcb_parser.cpp index f9ffd6d94c..bc31ae9596 100644 --- a/pcbnew/plugins/kicad/pcb_parser.cpp +++ b/pcbnew/plugins/kicad/pcb_parser.cpp @@ -2951,27 +2951,27 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) switch( token ) { case T_virtual: // legacy token prior to version 20200826 - attributes |= MOD_EXCLUDE_FROM_POS_FILES | MOD_EXCLUDE_FROM_BOM; + attributes |= FP_EXCLUDE_FROM_POS_FILES | FP_EXCLUDE_FROM_BOM; break; case T_through_hole: - attributes |= MOD_THROUGH_HOLE; + attributes |= FP_THROUGH_HOLE; break; case T_smd: - attributes |= MOD_SMD; + attributes |= FP_SMD; break; case T_board_only: - attributes |= MOD_BOARD_ONLY; + attributes |= FP_BOARD_ONLY; break; case T_exclude_from_pos_files: - attributes |= MOD_EXCLUDE_FROM_POS_FILES; + attributes |= FP_EXCLUDE_FROM_POS_FILES; break; case T_exclude_from_bom: - attributes |= MOD_EXCLUDE_FROM_BOM; + attributes |= FP_EXCLUDE_FROM_BOM; break; default: @@ -3082,7 +3082,7 @@ MODULE* PCB_PARSER::parseMODULE_unchecked( wxArrayString* aInitialComments ) // files. We probably don't want to get into that game so we'll just include them by // default and let the user change it if required. if( m_requiredVersion < 20200826 && attributes == 0 ) - attributes |= MOD_THROUGH_HOLE; + attributes |= FP_THROUGH_HOLE; module->SetAttributes( attributes ); diff --git a/pcbnew/plugins/legacy/legacy_plugin.cpp b/pcbnew/plugins/legacy/legacy_plugin.cpp index b1452e8b59..662a53939d 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.cpp +++ b/pcbnew/plugins/legacy/legacy_plugin.cpp @@ -1297,11 +1297,11 @@ void LEGACY_PLUGIN::loadFOOTPRINT( MODULE* aFootprint ) data = line + SZ( "At" ); if( strstr( data, "SMD" ) ) - attrs |= MOD_SMD; + attrs |= FP_SMD; else if( strstr( data, "VIRTUAL" ) ) - attrs |= MOD_EXCLUDE_FROM_POS_FILES | MOD_EXCLUDE_FROM_BOM; + attrs |= FP_EXCLUDE_FROM_POS_FILES | FP_EXCLUDE_FROM_BOM; else - attrs |= MOD_THROUGH_HOLE | MOD_EXCLUDE_FROM_POS_FILES; + attrs |= FP_THROUGH_HOLE | FP_EXCLUDE_FROM_POS_FILES; aFootprint->SetAttributes( attrs ); } @@ -3017,10 +3017,10 @@ void LEGACY_PLUGIN::init( const PROPERTIES* aProperties ) } -void LEGACY_PLUGIN::SaveModule3D( const MODULE* me ) const +void LEGACY_PLUGIN::SaveFP3DModels( const MODULE* aFootprint ) const { - auto sM = me->Models().begin(); - auto eM = me->Models().end(); + auto sM = aFootprint->Models().begin(); + auto eM = aFootprint->Models().end(); while( sM != eM ) { diff --git a/pcbnew/plugins/legacy/legacy_plugin.h b/pcbnew/plugins/legacy/legacy_plugin.h index ca8bf79396..0a7dc18f7a 100644 --- a/pcbnew/plugins/legacy/legacy_plugin.h +++ b/pcbnew/plugins/legacy/legacy_plugin.h @@ -102,7 +102,7 @@ public: void SetReader( LINE_READER* aReader ) { m_reader = aReader; } void SetFilePtr( FILE* aFile ) { m_fp = aFile; } - void SaveModule3D( const MODULE* aModule ) const; + void SaveFP3DModels( const MODULE* aFootprint ) const; // return the new .kicad_pcb layer id from the old (legacy) layer id static PCB_LAYER_ID leg_layer2new( int cu_count, LAYER_NUM aLayerNum );