68 std::vector<LENGTH_DELAY_CALCULATION_ITEM> lengthItems;
71 for(
PCB_TRACK* track : m_board->Tracks() )
73 if( track->GetNetCode() != testNet->
GetNetCode() )
77 widths.insert( track->GetWidth() );
81 if( item.
Type() != LENGTH_DELAY_CALCULATION_ITEM::TYPE::UNKNOWN )
82 lengthItems.emplace_back( item );
85 BOOST_TEST_MESSAGE( wxString::Format(
"Found %zu different track widths on net /TEST1_P", widths.size() ) );
88 BOOST_REQUIRE_GE( widths.size(), 2 );
92 .OptimiseVias =
true, .MergeTracks =
true, .OptimiseTracesInPads =
true, .InferViaInPad =
false
102 BOOST_CHECK_GT( lengthItems.size(), 0 );
127 std::vector<LENGTH_DELAY_CALCULATION_ITEM> lengthItems;
132 for(
PCB_TRACK* track : m_board->Tracks() )
134 if( track->GetNetCode() != testNet->
GetNetCode() )
139 if( item.
Type() == LENGTH_DELAY_CALCULATION_ITEM::TYPE::VIA )
142 if( item.
Type() != LENGTH_DELAY_CALCULATION_ITEM::TYPE::UNKNOWN )
143 lengthItems.emplace_back( std::move( item ) );
146 for(
FOOTPRINT* fp : m_board->Footprints() )
148 for(
PAD*
pad : fp->Pads() )
155 if( item.
Type() != LENGTH_DELAY_CALCULATION_ITEM::TYPE::UNKNOWN )
157 lengthItems.emplace_back( std::move( item ) );
163 BOOST_TEST_MESSAGE( wxString::Format(
"TEST_NET has %d vias, %d pads, %zu total length items", viaCount, padCount,
164 lengthItems.size() ) );
168 .OptimiseVias =
true, .MergeTracks =
true, .OptimiseTracesInPads =
true, .InferViaInPad =
false
Lightweight class which holds a pad, via, or a routed trace outline.
TYPE Type() const
Gets the routing item type.
Class which calculates lengths (and associated routing statistics) in a BOARD context.
int StackupHeight(PCB_LAYER_ID aFirstLayer, PCB_LAYER_ID aSecondLayer) const
Returns the stackup distance between the two given layers.
LENGTH_DELAY_CALCULATION_ITEM GetLengthCalculationItem(const BOARD_CONNECTED_ITEM *aBoardItem) const
Return a LENGTH_CALCULATION_ITEM constructed from the given BOARD_CONNECTED_ITEM.
LENGTH_DELAY_STATS CalculateLengthDetails(std::vector< LENGTH_DELAY_CALCULATION_ITEM > &aItems, PATH_OPTIMISATIONS aOptimisations, const PAD *aStartPad=nullptr, const PAD *aEndPad=nullptr, LENGTH_DELAY_LAYER_OPT aLayerOpt=LENGTH_DELAY_LAYER_OPT::NO_LAYER_DETAIL, LENGTH_DELAY_DOMAIN_OPT aDomain=LENGTH_DELAY_DOMAIN_OPT::NO_DELAY_DETAIL) const
Calculates the electrical length of the given items.
Handle the data for a net.
void LoadBoard(SETTINGS_MANAGER &aSettingsManager, const wxString &aRelPath, std::unique_ptr< BOARD > &aBoard)
Holds length measurement result details and statistics.
Struct to control which optimisations the length calculation code runs on the given path objects.
SETTINGS_MANAGER m_settingsManager
std::unique_ptr< BOARD > m_board
BOOST_FIXTURE_TEST_CASE(LengthCalculationIncludesAllWidths, TUNER_DRC_TEST_FIXTURE)
Verify that length calculation includes all segments regardless of track width.
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_TEST_MESSAGE("\n=== Real-World Polygon PIP Benchmark ===\n"<< formatTable(table))
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)