pcbnew: Add via height support in drc length
Fixes https://gitlab.com/kicad/code/kicad/-/issues/10135
This commit is contained in:
parent
517e44e917
commit
11c967b259
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <common.h>
|
#include <common.h>
|
||||||
#include <board.h>
|
#include <board.h>
|
||||||
|
#include <board_design_settings.h>
|
||||||
#include <pad.h>
|
#include <pad.h>
|
||||||
#include <pcb_track.h>
|
#include <pcb_track.h>
|
||||||
|
|
||||||
|
@ -89,13 +90,6 @@ private:
|
||||||
DRC_LENGTH_REPORT m_report;
|
DRC_LENGTH_REPORT m_report;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
static int computeViaThruLength( PCB_VIA *aVia, const std::set<BOARD_CONNECTED_ITEM*> &conns )
|
|
||||||
{
|
|
||||||
return 0; // fixme: not yet there...
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths( DRC_CONSTRAINT& aConstraint,
|
void DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths( DRC_CONSTRAINT& aConstraint,
|
||||||
std::vector<CONNECTION>& aMatchedConnections )
|
std::vector<CONNECTION>& aMatchedConnections )
|
||||||
{
|
{
|
||||||
|
@ -291,9 +285,17 @@ bool DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal( bool aDelayReportMode )
|
||||||
{
|
{
|
||||||
if( citem->Type() == PCB_VIA_T )
|
if( citem->Type() == PCB_VIA_T )
|
||||||
{
|
{
|
||||||
|
const BOARD_DESIGN_SETTINGS& ds = m_board->GetDesignSettings();
|
||||||
|
|
||||||
ent.viaCount++;
|
ent.viaCount++;
|
||||||
ent.totalVia += computeViaThruLength( static_cast<PCB_VIA*>( citem ),
|
|
||||||
nitem.second );
|
if( ds.m_UseHeightForLengthCalcs )
|
||||||
|
{
|
||||||
|
const PCB_VIA* v = static_cast<PCB_VIA*>( citem );
|
||||||
|
|
||||||
|
ent.totalVia += ds.GetStackupDescriptor().GetLayerDistance(
|
||||||
|
v->TopLayer(), v->BottomLayer() );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if( citem->Type() == PCB_TRACE_T )
|
else if( citem->Type() == PCB_TRACE_T )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue