Introduce new marker type so we can track DRC errors on the drawing sheet.
Fixes https://gitlab.com/kicad/code/kicad/issues/12221
This commit is contained in:
parent
4b3ac52b1d
commit
1f347582f8
|
@ -293,7 +293,7 @@ bool DS_DRAW_ITEM_POLYPOLYGONS::HitTest( const EDA_RECT& aRect, bool aContained,
|
|||
|
||||
wxString DS_DRAW_ITEM_POLYPOLYGONS::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
{
|
||||
return wxString::Format( _( "Imported Shape" ) );
|
||||
return _( "Imported Shape" );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -378,10 +378,17 @@ void RC_TREE_MODEL::GetValue( wxVariant& aVariant,
|
|||
break;
|
||||
|
||||
case RC_TREE_NODE::MAIN_ITEM:
|
||||
if( rcItem->GetParent()->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
|
||||
{
|
||||
aVariant = _( "Drawing Sheet" );
|
||||
break;
|
||||
}
|
||||
else
|
||||
{
|
||||
EDA_ITEM* item = m_editFrame->GetItem( rcItem->GetMainItemID() );
|
||||
aVariant = item->GetSelectMenuText( m_editFrame->GetUserUnits() );
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case RC_TREE_NODE::AUX_ITEM:
|
||||
|
|
|
@ -191,8 +191,8 @@ SCH_SYMBOL* SCH_PIN::GetParentSymbol() const
|
|||
|
||||
wxString SCH_PIN::GetSelectMenuText( EDA_UNITS aUnits ) const
|
||||
{
|
||||
return wxString::Format( "%s %s",
|
||||
GetParentSymbol()->GetSelectMenuText( aUnits ),
|
||||
return wxString::Format( "Symbol %s %s",
|
||||
GetParentSymbol()->GetField( REFERENCE_FIELD )->GetShownText(),
|
||||
m_libPin->GetSelectMenuText( aUnits ) );
|
||||
}
|
||||
|
||||
|
|
|
@ -53,6 +53,7 @@ public:
|
|||
MARKER_UNSPEC,
|
||||
MARKER_ERC,
|
||||
MARKER_DRC,
|
||||
MARKER_DRAWING_SHEET,
|
||||
MARKER_RATSNEST,
|
||||
MARKER_PARITY,
|
||||
MARKER_SIMUL
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <drc/drc_item.h>
|
||||
#include <connectivity/connectivity_data.h>
|
||||
#include <connectivity/connectivity_algo.h>
|
||||
#include <drawing_sheet/ds_proxy_view_item.h>
|
||||
#include <pcb_edit_frame.h>
|
||||
#include <pcbnew_settings.h>
|
||||
#include <tool/tool_manager.h>
|
||||
|
@ -352,8 +353,6 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
|
|||
{
|
||||
BOARD* board = m_frame->GetBoard();
|
||||
RC_TREE_NODE* node = RC_TREE_MODEL::ToNode( aEvent.GetItem() );
|
||||
const KIID& itemID = node ? RC_TREE_MODEL::ToUUID( aEvent.GetItem() ) : niluuid;
|
||||
BOARD_ITEM* item = board->GetItem( itemID );
|
||||
|
||||
auto getActiveLayers =
|
||||
[]( BOARD_ITEM* aItem ) -> LSET
|
||||
|
@ -377,16 +376,47 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
|
|||
}
|
||||
};
|
||||
|
||||
if( !node )
|
||||
{
|
||||
// list is being freed; don't do anything with null ptrs
|
||||
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_centerMarkerOnIdle )
|
||||
{
|
||||
// we already came from a cross-probe of the marker in the document; don't go
|
||||
// around in circles
|
||||
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
else if( node && item && item != DELETED_BOARD_ITEM::GetInstance() )
|
||||
|
||||
std::shared_ptr<RC_ITEM> rc_item = node->m_RcItem;
|
||||
|
||||
if( rc_item->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
|
||||
&& rc_item->GetParent()->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
|
||||
{
|
||||
m_frame->FocusOnLocation( node->m_RcItem->GetParent()->GetPos() );
|
||||
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
const KIID& itemID = RC_TREE_MODEL::ToUUID( aEvent.GetItem() );
|
||||
BOARD_ITEM* item = board->GetItem( itemID );
|
||||
|
||||
if( !item || item == DELETED_BOARD_ITEM::GetInstance() )
|
||||
{
|
||||
// nothing to highlight / focus on
|
||||
|
||||
aEvent.Skip();
|
||||
return;
|
||||
}
|
||||
|
||||
PCB_LAYER_ID principalLayer;
|
||||
LSET violationLayers;
|
||||
std::shared_ptr<RC_ITEM> rc_item = node->m_RcItem;
|
||||
BOARD_ITEM* a = board->GetItem( rc_item->GetMainItemID() );
|
||||
BOARD_ITEM* b = board->GetItem( rc_item->GetAuxItemID() );
|
||||
BOARD_ITEM* c = board->GetItem( rc_item->GetAuxItem2ID() );
|
||||
|
@ -495,7 +525,6 @@ void DIALOG_DRC::OnDRCItemSelected( wxDataViewEvent& aEvent )
|
|||
{
|
||||
m_frame->FocusOnItem( item, principalLayer );
|
||||
}
|
||||
}
|
||||
|
||||
aEvent.Skip();
|
||||
}
|
||||
|
|
|
@ -1492,7 +1492,7 @@ bool DRC_ENGINE::IsErrorLimitExceeded( int error_code )
|
|||
|
||||
|
||||
void DRC_ENGINE::ReportViolation( const std::shared_ptr<DRC_ITEM>& aItem, const VECTOR2I& aPos,
|
||||
PCB_LAYER_ID aMarkerLayer )
|
||||
int aMarkerLayer )
|
||||
{
|
||||
static std::mutex globalLock;
|
||||
|
||||
|
|
|
@ -63,9 +63,9 @@ class DRC_RULE;
|
|||
class DRC_CONSTRAINT;
|
||||
|
||||
|
||||
typedef
|
||||
std::function<void( const std::shared_ptr<DRC_ITEM>& aItem,
|
||||
const VECTOR2I& aPos, PCB_LAYER_ID aLayer )> DRC_VIOLATION_HANDLER;
|
||||
typedef std::function<void( const std::shared_ptr<DRC_ITEM>& aItem,
|
||||
const VECTOR2I& aPos,
|
||||
int aLayer )> DRC_VIOLATION_HANDLER;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -165,7 +165,7 @@ public:
|
|||
bool RulesValid() { return m_rulesValid; }
|
||||
|
||||
void ReportViolation( const std::shared_ptr<DRC_ITEM>& aItem, const VECTOR2I& aPos,
|
||||
PCB_LAYER_ID aMarkerLayer );
|
||||
int aMarkerLayer );
|
||||
|
||||
bool KeepRefreshing( bool aWait = false );
|
||||
void AdvanceProgress();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
|
||||
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
|
||||
* Copyright (C) 2015-2022 KiCad Developers, see change_log.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
|
||||
|
@ -25,6 +25,7 @@
|
|||
|
||||
#include "wx/html/m_templ.h"
|
||||
#include "wx/html/styleparams.h"
|
||||
#include "core/kicad_algo.h"
|
||||
#include <drc/drc_item.h>
|
||||
#include <drc/drc_rule.h>
|
||||
#include <board.h>
|
||||
|
@ -438,13 +439,13 @@ void DRC_ITEMS_PROVIDER::SetSeverities( int aSeverities )
|
|||
|
||||
for( PCB_MARKER* marker : m_board->Markers() )
|
||||
{
|
||||
if( marker->GetMarkerType() != m_markerType )
|
||||
continue;
|
||||
|
||||
if( marker->GetSeverity() & m_severities )
|
||||
if( alg::contains( m_markerTypes, marker->GetMarkerType() )
|
||||
&& ( marker->GetSeverity() & m_severities ) > 0 )
|
||||
{
|
||||
m_filteredMarkers.push_back( marker );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int DRC_ITEMS_PROVIDER::GetCount( int aSeverity ) const
|
||||
|
@ -456,12 +457,12 @@ int DRC_ITEMS_PROVIDER::GetCount( int aSeverity ) const
|
|||
|
||||
for( PCB_MARKER* marker : m_board->Markers() )
|
||||
{
|
||||
if( marker->GetMarkerType() != m_markerType )
|
||||
continue;
|
||||
|
||||
if( ( marker->GetSeverity() & aSeverity ) > 0 )
|
||||
if( alg::contains( m_markerTypes, marker->GetMarkerType() )
|
||||
&& ( marker->GetSeverity() & aSeverity ) > 0 )
|
||||
{
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
|
|
@ -216,11 +216,15 @@ private:
|
|||
class DRC_ITEMS_PROVIDER : public RC_ITEMS_PROVIDER
|
||||
{
|
||||
public:
|
||||
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::TYPEMARKER aMarkerType ) :
|
||||
DRC_ITEMS_PROVIDER( BOARD* aBoard, MARKER_BASE::TYPEMARKER aMarkerType,
|
||||
MARKER_BASE::TYPEMARKER otherMarkerType = MARKER_BASE::MARKER_UNSPEC ) :
|
||||
m_board( aBoard ),
|
||||
m_markerType( aMarkerType ),
|
||||
m_severities( 0 )
|
||||
{
|
||||
m_markerTypes.push_back( aMarkerType );
|
||||
|
||||
if( otherMarkerType != MARKER_BASE::MARKER_UNSPEC )
|
||||
m_markerTypes.push_back( otherMarkerType );
|
||||
}
|
||||
|
||||
void SetSeverities( int aSeverities ) override;
|
||||
|
@ -233,7 +237,7 @@ public:
|
|||
|
||||
private:
|
||||
BOARD* m_board;
|
||||
MARKER_BASE::TYPEMARKER m_markerType;
|
||||
std::vector<MARKER_BASE::TYPEMARKER> m_markerTypes;
|
||||
|
||||
int m_severities;
|
||||
std::vector<PCB_MARKER*> m_filteredMarkers;
|
||||
|
|
|
@ -72,7 +72,7 @@ const wxString DRC_TEST_PROVIDER::GetDescription() const { return wxEmptyString;
|
|||
|
||||
|
||||
void DRC_TEST_PROVIDER::reportViolation( std::shared_ptr<DRC_ITEM>& item,
|
||||
const VECTOR2I& aMarkerPos, PCB_LAYER_ID aMarkerLayer )
|
||||
const VECTOR2I& aMarkerPos, int aMarkerLayer )
|
||||
{
|
||||
if( item->GetViolatingRule() )
|
||||
accountCheck( item->GetViolatingRule() );
|
||||
|
|
|
@ -97,7 +97,7 @@ protected:
|
|||
|
||||
virtual void reportAux( wxString fmt, ... );
|
||||
virtual void reportViolation( std::shared_ptr<DRC_ITEM>& item, const VECTOR2I& aMarkerPos,
|
||||
PCB_LAYER_ID aMarkerLayer );
|
||||
int aMarkerLayer );
|
||||
virtual bool reportProgress( int aCount, int aSize, int aDelta );
|
||||
virtual bool reportPhase( const wxString& aStageName );
|
||||
|
||||
|
|
|
@ -324,9 +324,9 @@ void DRC_TEST_PROVIDER_MISC::testTextVars()
|
|||
if( text && text->GetShownText().Matches( wxT( "*${*}*" ) ) )
|
||||
{
|
||||
std::shared_ptr<DRC_ITEM> drcItem = DRC_ITEM::Create( DRCE_UNRESOLVED_VARIABLE );
|
||||
drcItem->SetItems( text );
|
||||
drcItem->SetItems( drawingSheet );
|
||||
|
||||
reportViolation( drcItem, text->GetPosition(), UNDEFINED_LAYER );
|
||||
reportViolation( drcItem, text->GetPosition(), LAYER_DRAWINGSHEET );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -881,7 +881,12 @@ void PCB_EDIT_FRAME::ResolveDRCExclusions()
|
|||
BOARD_COMMIT commit( this );
|
||||
|
||||
for( PCB_MARKER* marker : GetBoard()->ResolveDRCExclusions() )
|
||||
{
|
||||
if( marker->GetMarkerType() == MARKER_BASE::MARKER_DRAWING_SHEET )
|
||||
marker->GetRCItem()->SetItems( GetCanvas()->GetDrawingSheet() );
|
||||
|
||||
commit.Add( marker );
|
||||
}
|
||||
|
||||
commit.Push( wxEmptyString, SKIP_UNDO | SKIP_SET_DIRTY );
|
||||
|
||||
|
|
|
@ -44,15 +44,20 @@
|
|||
|
||||
|
||||
|
||||
PCB_MARKER::PCB_MARKER( std::shared_ptr<RC_ITEM> aItem, const VECTOR2I& aPosition,
|
||||
PCB_LAYER_ID aLayer ) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T, aLayer ), // parent set during BOARD::Add()
|
||||
PCB_MARKER::PCB_MARKER( std::shared_ptr<RC_ITEM> aItem, const VECTOR2I& aPosition, int aLayer ) :
|
||||
BOARD_ITEM( nullptr, PCB_MARKER_T, F_Cu ), // parent set during BOARD::Add()
|
||||
MARKER_BASE( SCALING_FACTOR, aItem )
|
||||
{
|
||||
if( m_rcItem )
|
||||
{
|
||||
m_rcItem->SetParent( this );
|
||||
|
||||
if( aLayer == LAYER_DRAWINGSHEET )
|
||||
{
|
||||
SetMarkerType( MARKER_BASE::MARKER_DRAWING_SHEET );
|
||||
}
|
||||
else
|
||||
{
|
||||
switch( m_rcItem->GetErrorCode() )
|
||||
{
|
||||
case DRCE_UNCONNECTED_ITEMS:
|
||||
|
@ -70,6 +75,9 @@ PCB_MARKER::PCB_MARKER( std::shared_ptr<RC_ITEM> aItem, const VECTOR2I& aPositio
|
|||
SetMarkerType( MARKER_BASE::MARKER_DRC );
|
||||
break;
|
||||
}
|
||||
|
||||
SetLayer( ToLAYER_ID( aLayer ) );
|
||||
}
|
||||
}
|
||||
|
||||
m_Pos = aPosition;
|
||||
|
@ -89,23 +97,41 @@ wxString PCB_MARKER::Serialize() const
|
|||
wxString lastItem;
|
||||
|
||||
if( m_rcItem->GetErrorCode() == DRCE_COPPER_SLIVER )
|
||||
lastItem = LayerName( m_layer );
|
||||
else
|
||||
lastItem = m_rcItem->GetAuxItemID().AsString();
|
||||
|
||||
{
|
||||
return wxString::Format( wxT( "%s|%d|%d|%s|%s" ),
|
||||
m_rcItem->GetSettingsKey(),
|
||||
m_Pos.x,
|
||||
m_Pos.y,
|
||||
m_rcItem->GetMainItemID().AsString(),
|
||||
lastItem );
|
||||
LayerName( m_layer ) );
|
||||
}
|
||||
else if( m_rcItem->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
|
||||
&& m_rcItem->GetParent()->GetMarkerType() == MARKER_DRAWING_SHEET )
|
||||
{
|
||||
return wxString::Format( wxT( "%s|%d|%d|%s|%s" ),
|
||||
m_rcItem->GetSettingsKey(),
|
||||
m_Pos.x,
|
||||
m_Pos.y,
|
||||
// Drawing sheet KIIDs aren't preserved between runs
|
||||
wxEmptyString,
|
||||
wxEmptyString );
|
||||
}
|
||||
else
|
||||
{
|
||||
return wxString::Format( wxT( "%s|%d|%d|%s|%s" ),
|
||||
m_rcItem->GetSettingsKey(),
|
||||
m_Pos.x,
|
||||
m_Pos.y,
|
||||
m_rcItem->GetMainItemID().AsString(),
|
||||
m_rcItem->GetAuxItemID().AsString() );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
PCB_MARKER* PCB_MARKER::Deserialize( const wxString& data )
|
||||
{
|
||||
wxArrayString props = wxSplit( data, '|' );
|
||||
PCB_LAYER_ID markerLayer = F_Cu;
|
||||
int markerLayer = F_Cu;
|
||||
VECTOR2I markerPos( (int) strtol( props[1].c_str(), nullptr, 10 ),
|
||||
(int) strtol( props[2].c_str(), nullptr, 10 ) );
|
||||
|
||||
|
@ -122,11 +148,17 @@ PCB_MARKER* PCB_MARKER::Deserialize( const wxString& data )
|
|||
{
|
||||
if( LayerName( ToLAYER_ID( layer ) ) == props[4] )
|
||||
{
|
||||
markerLayer = ToLAYER_ID( layer );
|
||||
markerLayer = layer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if( drcItem->GetErrorCode() == DRCE_UNRESOLVED_VARIABLE
|
||||
&& props[3].IsEmpty() && props[4].IsEmpty() )
|
||||
{
|
||||
// Note: caller must load our item pointer with the drawing sheet proxy item
|
||||
markerLayer = LAYER_DRAWINGSHEET;
|
||||
}
|
||||
else
|
||||
{
|
||||
drcItem->SetItems( KIID( props[3] ), KIID( props[4] ) );
|
||||
|
@ -143,6 +175,12 @@ void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
|
|||
aList.emplace_back( _( "Severity" ), GetSeverity() == RPT_SEVERITY_ERROR ? _( "Error" )
|
||||
: _( "Warning" ) );
|
||||
|
||||
if( GetMarkerType() == MARKER_DRAWING_SHEET )
|
||||
{
|
||||
aList.emplace_back( _( "Drawing Sheet" ), wxEmptyString );
|
||||
}
|
||||
else
|
||||
{
|
||||
wxString mainText;
|
||||
wxString auxText;
|
||||
EDA_ITEM* mainItem = nullptr;
|
||||
|
@ -162,6 +200,7 @@ void PCB_MARKER::GetMsgPanelInfo( EDA_DRAW_FRAME* aFrame, std::vector<MSG_PANEL_
|
|||
|
||||
aList.emplace_back( mainText, auxText );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void PCB_MARKER::Rotate( const VECTOR2I& aRotCentre, const EDA_ANGLE& aAngle )
|
||||
|
|
|
@ -41,7 +41,7 @@ class MSG_PANEL_ITEM;
|
|||
class PCB_MARKER : public BOARD_ITEM, public MARKER_BASE
|
||||
{
|
||||
public:
|
||||
PCB_MARKER( std::shared_ptr<RC_ITEM> aItem, const VECTOR2I& aPos, PCB_LAYER_ID aLayer = F_Cu );
|
||||
PCB_MARKER( std::shared_ptr<RC_ITEM> aItem, const VECTOR2I& aPos, int aLayer = F_Cu );
|
||||
|
||||
~PCB_MARKER();
|
||||
|
||||
|
|
|
@ -486,7 +486,7 @@ bool WriteDRCReport( BOARD* aBoard, const wxString& aFileName, EDA_UNITS aUnits,
|
|||
engine->SetProgressReporter( nullptr );
|
||||
|
||||
engine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2D aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2D aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_MISSING_FOOTPRINT
|
||||
|| aItem->GetErrorCode() == DRCE_DUPLICATE_FOOTPRINT
|
||||
|
|
|
@ -172,10 +172,9 @@ void DRC_TOOL::RunTests( PROGRESS_REPORTER* aProgressReporter, bool aRefillZones
|
|||
m_drcEngine->SetProgressReporter( aProgressReporter );
|
||||
|
||||
m_drcEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
PCB_MARKER* marker = new PCB_MARKER( aItem, aPos );
|
||||
marker->SetLayer( aLayer );
|
||||
PCB_MARKER* marker = new PCB_MARKER( aItem, aPos, aLayer );
|
||||
commit.Add( marker );
|
||||
} );
|
||||
|
||||
|
@ -213,7 +212,8 @@ void DRC_TOOL::updatePointers()
|
|||
if( m_drcDialog ) // Use dialog list boxes only in DRC_TOOL dialog
|
||||
{
|
||||
m_drcDialog->SetMarkersProvider( new DRC_ITEMS_PROVIDER( m_pcb,
|
||||
MARKER_BASE::MARKER_DRC ) );
|
||||
MARKER_BASE::MARKER_DRC,
|
||||
MARKER_BASE::MARKER_DRAWING_SHEET ) );
|
||||
m_drcDialog->SetRatsnestProvider( new DRC_ITEMS_PROVIDER( m_pcb,
|
||||
MARKER_BASE::MARKER_RATSNEST ) );
|
||||
m_drcDialog->SetFootprintsProvider( new DRC_ITEMS_PROVIDER( m_pcb,
|
||||
|
|
|
@ -648,8 +648,8 @@ int FOOTPRINT_EDITOR_CONTROL::CheckFootprint( const TOOL_EVENT& aEvent )
|
|||
}
|
||||
else // The dialog is just not visible (because the user has double clicked on an error item)
|
||||
{
|
||||
m_checkerDialog->SetMarkersProvider(
|
||||
new DRC_ITEMS_PROVIDER( m_frame->GetBoard(), MARKER_BASE::MARKER_DRC ) );
|
||||
m_checkerDialog->SetMarkersProvider( new DRC_ITEMS_PROVIDER( m_frame->GetBoard(),
|
||||
MARKER_BASE::MARKER_DRC ) );
|
||||
|
||||
m_checkerDialog->Show( true );
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ int runDRCProto( PROJECT_CONTEXT project, std::shared_ptr<KIGFX::VIEW_OVERLAY> a
|
|||
drcEngine->SetProgressReporter( new CONSOLE_PROGRESS_REPORTER ( &consoleLog ) );
|
||||
|
||||
drcEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
// fixme
|
||||
} );
|
||||
|
|
|
@ -64,7 +64,7 @@ BOOST_FIXTURE_TEST_CASE( DRCCustomRuleSeverityTest, DRC_REGRESSION_TEST_FIXTURE
|
|||
bds.m_DRCSeverities[ DRCE_FOOTPRINT_TYPE_MISMATCH ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
PCB_MARKER temp( aItem, aPos );
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ BOOST_FIXTURE_TEST_CASE( DRCCopperConn, DRC_REGRESSION_TEST_FIXTURE )
|
|||
bds.m_DRCSeverities[ DRCE_LIB_FOOTPRINT_MISMATCH ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( bds.GetSeverity( aItem->GetErrorCode() ) == SEVERITY::RPT_SEVERITY_ERROR )
|
||||
violations.push_back( *aItem );
|
||||
|
|
|
@ -304,7 +304,7 @@ void DoCourtyardInvalidTest( const COURTYARD_INVALID_CASE& aCase,
|
|||
drcEngine.InitEngine( wxFileName() );
|
||||
|
||||
drcEngine.SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_OVERLAPPING_FOOTPRINTS
|
||||
|| aItem->GetErrorCode() == DRCE_MALFORMED_COURTYARD
|
||||
|
|
|
@ -460,7 +460,7 @@ static void DoCourtyardOverlapTest( const COURTYARD_OVERLAP_TEST_CASE& aCase,
|
|||
drcEngine.InitEngine( wxFileName() );
|
||||
|
||||
drcEngine.SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_OVERLAPPING_FOOTPRINTS
|
||||
|| aItem->GetErrorCode() == DRCE_MALFORMED_COURTYARD
|
||||
|
|
|
@ -81,7 +81,7 @@ BOOST_FIXTURE_TEST_CASE( DRCFalsePositiveRegressions, DRC_REGRESSION_TEST_FIXTUR
|
|||
bds.m_DRCSeverities[ DRCE_LIB_FOOTPRINT_MISMATCH ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( bds.GetSeverity( aItem->GetErrorCode() ) == SEVERITY::RPT_SEVERITY_ERROR )
|
||||
violations.push_back( *aItem );
|
||||
|
@ -147,7 +147,7 @@ BOOST_FIXTURE_TEST_CASE( DRCFalseNegativeRegressions, DRC_REGRESSION_TEST_FIXTUR
|
|||
bds.m_DRCSeverities[ DRCE_LIB_FOOTPRINT_MISMATCH ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
PCB_MARKER temp( aItem, aPos );
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ BOOST_FIXTURE_TEST_CASE( DRCSolderMaskBridgingTest, DRC_REGRESSION_TEST_FIXTURE
|
|||
bds.m_DRCSeverities[ DRCE_STARVED_THERMAL ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
PCB_MARKER temp( aItem, aPos );
|
||||
|
||||
|
|
|
@ -179,7 +179,7 @@ BOOST_FIXTURE_TEST_CASE( TrackCleanerRegressionTests, TRACK_CLEANER_TEST_FIXTURE
|
|||
bds.m_DRCSeverities[ DRCE_STARVED_THERMAL ] = SEVERITY::RPT_SEVERITY_IGNORE;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_UNCONNECTED_ITEMS )
|
||||
violations.push_back( *aItem );
|
||||
|
|
|
@ -98,7 +98,7 @@ BOOST_FIXTURE_TEST_CASE( BasicZoneFills, ZONE_FILL_TEST_FIXTURE )
|
|||
bds.m_DRCEngine->InitEngine( wxFileName() ); // Just to be sure to be sure
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_CLEARANCE )
|
||||
{
|
||||
|
@ -202,8 +202,7 @@ BOOST_FIXTURE_TEST_CASE( RegressionZoneFillTests, ZONE_FILL_TEST_FIXTURE )
|
|||
std::vector<DRC_ITEM> violations;
|
||||
|
||||
bds.m_DRCEngine->SetViolationHandler(
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos,
|
||||
PCB_LAYER_ID aLayer )
|
||||
[&]( const std::shared_ptr<DRC_ITEM>& aItem, VECTOR2I aPos, int aLayer )
|
||||
{
|
||||
if( aItem->GetErrorCode() == DRCE_CLEARANCE )
|
||||
violations.push_back( *aItem );
|
||||
|
|
Loading…
Reference in New Issue