There are 3 courtyard DRC checks, not 2.
This commit is contained in:
parent
10614a9ebc
commit
058108dd6d
|
@ -229,7 +229,7 @@ set( PCBNEW_MICROWAVE_SRCS
|
|||
)
|
||||
|
||||
set( PCBNEW_DRC_SRCS
|
||||
drc/courtyard_overlap.cpp
|
||||
drc/drc_courtyard_tester.cpp
|
||||
drc/drc.cpp
|
||||
drc/drc_clearance_test_functions.cpp
|
||||
)
|
||||
|
|
|
@ -52,7 +52,7 @@
|
|||
#include <board_commit.h>
|
||||
#include <geometry/shape_arc.h>
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/courtyard_overlap.h>
|
||||
#include <drc/drc_courtyard_tester.h>
|
||||
#include <tools/zone_filler_tool.h>
|
||||
|
||||
DRC::DRC() :
|
||||
|
@ -469,9 +469,10 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
|
||||
testCopperTextAndGraphics();
|
||||
|
||||
// find overlapping courtyard ares.
|
||||
// test courtyards
|
||||
if( !m_pcb->GetDesignSettings().Ignore( DRCE_OVERLAPPING_FOOTPRINTS )
|
||||
&& !m_pcb->GetDesignSettings().Ignore( DRCE_MISSING_COURTYARD_IN_FOOTPRINT ) )
|
||||
|| !m_pcb->GetDesignSettings().Ignore( DRCE_MISSING_COURTYARD_IN_FOOTPRINT )
|
||||
|| !m_pcb->GetDesignSettings().Ignore( DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT ) )
|
||||
{
|
||||
if( aMessages )
|
||||
{
|
||||
|
@ -479,7 +480,7 @@ void DRC::RunTests( wxTextCtrl* aMessages )
|
|||
aMessages->Refresh();
|
||||
}
|
||||
|
||||
doOverlappingCourtyardsDrc();
|
||||
doCourtyardsDrc();
|
||||
}
|
||||
|
||||
for( DRC_ITEM* footprintItem : m_footprints )
|
||||
|
@ -1604,9 +1605,9 @@ bool DRC::doPadToPadsDrc( D_PAD* aRefPad, D_PAD** aStart, D_PAD** aEnd, int x_li
|
|||
}
|
||||
|
||||
|
||||
void DRC::doOverlappingCourtyardsDrc()
|
||||
void DRC::doCourtyardsDrc()
|
||||
{
|
||||
DRC_COURTYARD_OVERLAP drc_overlap( [&]( MARKER_PCB* aMarker ) { addMarkerToPcb( aMarker ); } );
|
||||
DRC_COURTYARD_TESTER drc_overlap( [&]( MARKER_PCB* aMarker ) { addMarkerToPcb( aMarker ); } );
|
||||
|
||||
drc_overlap.RunDRC( *m_pcb );
|
||||
}
|
||||
|
|
|
@ -267,7 +267,7 @@ private:
|
|||
/**
|
||||
* Test for footprint courtyard overlaps.
|
||||
*/
|
||||
void doOverlappingCourtyardsDrc();
|
||||
void doCourtyardsDrc();
|
||||
|
||||
//-----<single tests>----------------------------------------------
|
||||
|
||||
|
|
|
@ -1,13 +1,9 @@
|
|||
/**
|
||||
* @file drc_marker_functions.cpp
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2010 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2004-2017 Jean-Pierre Charras, jp.charras at wanadoo.fr
|
||||
* Copyright (C) 2018 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 2018-2020 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -28,7 +24,7 @@
|
|||
*/
|
||||
|
||||
|
||||
#include <drc/courtyard_overlap.h>
|
||||
#include <drc/drc_courtyard_tester.h>
|
||||
|
||||
#include <class_module.h>
|
||||
#include <drc/drc.h>
|
||||
|
@ -47,13 +43,13 @@
|
|||
static const wxChar* DRC_COURTYARD_TRACE = wxT( "KICAD_DRC_COURTYARD" );
|
||||
|
||||
|
||||
DRC_COURTYARD_OVERLAP::DRC_COURTYARD_OVERLAP( MARKER_HANDLER aMarkerHandler ) :
|
||||
DRC_COURTYARD_TESTER::DRC_COURTYARD_TESTER( MARKER_HANDLER aMarkerHandler ) :
|
||||
DRC_TEST_PROVIDER( aMarkerHandler )
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
bool DRC_COURTYARD_OVERLAP::RunDRC( BOARD& aBoard ) const
|
||||
bool DRC_COURTYARD_TESTER::RunDRC( BOARD& aBoard ) const
|
||||
{
|
||||
wxLogTrace( DRC_COURTYARD_TRACE, "Running DRC: Courtyard" );
|
||||
|
||||
|
@ -65,26 +61,31 @@ bool DRC_COURTYARD_OVERLAP::RunDRC( BOARD& aBoard ) const
|
|||
// Update courtyard polygons, and test for missing courtyard definition:
|
||||
for( MODULE* footprint : aBoard.Modules() )
|
||||
{
|
||||
bool is_ok = footprint->BuildPolyCourtyard();
|
||||
|
||||
if( !is_ok && !aBoard.GetDesignSettings().Ignore( DRCE_OVERLAPPING_FOOTPRINTS ) )
|
||||
if( footprint->BuildPolyCourtyard() )
|
||||
{
|
||||
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT );
|
||||
drcItem->SetItems( footprint );
|
||||
HandleMarker( new MARKER_PCB( drcItem, footprint->GetPosition() ) );
|
||||
success = false;
|
||||
if( !aBoard.GetDesignSettings().Ignore( DRCE_MISSING_COURTYARD_IN_FOOTPRINT ) )
|
||||
{
|
||||
int outlineCount = footprint->GetPolyCourtyardFront().OutlineCount()
|
||||
+ footprint->GetPolyCourtyardBack().OutlineCount();
|
||||
|
||||
if( outlineCount == 0 )
|
||||
{
|
||||
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_MISSING_COURTYARD_IN_FOOTPRINT );
|
||||
drcItem->SetItems( footprint );
|
||||
HandleMarker( new MARKER_PCB( drcItem, footprint->GetPosition() ) );
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( aBoard.GetDesignSettings().Ignore( DRCE_MISSING_COURTYARD_IN_FOOTPRINT ) )
|
||||
continue;
|
||||
|
||||
if( footprint->GetPolyCourtyardFront().OutlineCount() == 0
|
||||
&& footprint->GetPolyCourtyardBack().OutlineCount() == 0 && is_ok )
|
||||
else
|
||||
{
|
||||
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_MISSING_COURTYARD_IN_FOOTPRINT );
|
||||
drcItem->SetItems( footprint );
|
||||
HandleMarker( new MARKER_PCB( drcItem, footprint->GetPosition() ) );
|
||||
success = false;
|
||||
if( !aBoard.GetDesignSettings().Ignore( DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT ) )
|
||||
{
|
||||
DRC_ITEM* drcItem = new DRC_ITEM( DRCE_MALFORMED_COURTYARD_IN_FOOTPRINT );
|
||||
drcItem->SetItems( footprint );
|
||||
HandleMarker( new MARKER_PCB( drcItem, footprint->GetPosition() ) );
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -32,12 +32,12 @@
|
|||
/**
|
||||
* A class that provides the courtyard-based DRC checks.
|
||||
*/
|
||||
class DRC_COURTYARD_OVERLAP : public DRC_TEST_PROVIDER
|
||||
class DRC_COURTYARD_TESTER : public DRC_TEST_PROVIDER
|
||||
{
|
||||
public:
|
||||
DRC_COURTYARD_OVERLAP( MARKER_HANDLER aMarkerHandler );
|
||||
DRC_COURTYARD_TESTER( MARKER_HANDLER aMarkerHandler );
|
||||
|
||||
virtual ~DRC_COURTYARD_OVERLAP() {};
|
||||
virtual ~DRC_COURTYARD_TESTER() {};
|
||||
|
||||
bool RunDRC( BOARD& aBoard ) const override;
|
||||
};
|
|
@ -29,7 +29,7 @@
|
|||
#include <class_module.h>
|
||||
#include <drc/drc.h>
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/courtyard_overlap.h>
|
||||
#include <drc/drc_courtyard_tester.h>
|
||||
#include <widgets/ui_common.h>
|
||||
|
||||
#include "../board_test_utils.h"
|
||||
|
@ -307,7 +307,7 @@ void DoCourtyardInvalidTest(
|
|||
// list of markers to collect
|
||||
std::vector<std::unique_ptr<MARKER_PCB>> markers;
|
||||
|
||||
DRC_COURTYARD_OVERLAP drc_overlap(
|
||||
DRC_COURTYARD_TESTER drc_overlap(
|
||||
[&]( MARKER_PCB* aMarker )
|
||||
{
|
||||
markers.push_back( std::unique_ptr<MARKER_PCB>( aMarker ) );
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include <class_module.h>
|
||||
#include <drc/drc.h>
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/courtyard_overlap.h>
|
||||
#include <drc/drc_courtyard_tester.h>
|
||||
#include <widgets/ui_common.h>
|
||||
|
||||
#include "../board_test_utils.h"
|
||||
|
@ -473,7 +473,7 @@ static void DoCourtyardOverlapTest(
|
|||
// list of markers to collect
|
||||
std::vector<std::unique_ptr<MARKER_PCB>> markers;
|
||||
|
||||
DRC_COURTYARD_OVERLAP drc_overlap(
|
||||
DRC_COURTYARD_TESTER drc_overlap(
|
||||
[&]( MARKER_PCB* aMarker )
|
||||
{
|
||||
markers.push_back( std::unique_ptr<MARKER_PCB>( aMarker ) );
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
#include <pcbnew_utils/board_file_utils.h>
|
||||
#include <widgets/ui_common.h>
|
||||
#include <pcbnew/drc/drc.h>
|
||||
#include <drc/courtyard_overlap.h>
|
||||
#include <drc/drc_courtyard_tester.h>
|
||||
|
||||
#include <qa_utils/utility_registry.h>
|
||||
|
||||
|
@ -169,7 +169,7 @@ private:
|
|||
std::unique_ptr<DRC_TEST_PROVIDER> createDrcProvider(
|
||||
BOARD& aBoard, DRC_TEST_PROVIDER::MARKER_HANDLER aHandler ) override
|
||||
{
|
||||
return std::make_unique<DRC_COURTYARD_OVERLAP>( aHandler );
|
||||
return std::make_unique<DRC_COURTYARD_TESTER>( aHandler );
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -206,7 +206,7 @@ private:
|
|||
std::unique_ptr<DRC_TEST_PROVIDER> createDrcProvider(
|
||||
BOARD& aBoard, DRC_TEST_PROVIDER::MARKER_HANDLER aHandler ) override
|
||||
{
|
||||
return std::make_unique<DRC_COURTYARD_OVERLAP>( aHandler );
|
||||
return std::make_unique<DRC_COURTYARD_TESTER>( aHandler );
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue