45struct FP_LEVEL_NET_TIE_FIXTURE
50 FP_LEVEL_NET_TIE_FIXTURE() :
51 m_footprint( &m_board )
60 void setCustomStackup(
int numCuLayers )
77 pad->SetNumber( aNumber );
81 pad->SetLayerSet( LSET( { aLayer } ) );
82 pad->SetPosition( aPos );
108 addNonComponentPad( wxS(
"1" ), padAPos, aLayer );
109 addNonComponentPad( wxS(
"2" ), padBPos, aLayer );
110 addCopperLine( padAPos, padBPos, aLayer );
115 const BOARD_ITEM* padA;
116 const BOARD_ITEM* padB;
117 const BOARD_ITEM* copper;
124 std::vector<SHORT_INFO> getShortedItems()
126 std::vector<SHORT_INFO> shorts;
129 [&](
const BOARD_ITEM* padA,
const BOARD_ITEM* padB,
const BOARD_ITEM* copper,
const VECTOR2I& pos )
131 shorts.emplace_back( SHORT_INFO{ padA, padB, copper, pos } );
139 size_t countShortedItems()
141 return getShortedItems().size();
144 const PAD& expectPadWithNumber(
const wxString& aNumber )
146 for(
const PAD*
pad : m_footprint.Pads() )
148 if(
pad->GetNumber() == aNumber )
151 throw std::runtime_error(
"Pad with number " + std::string( aNumber.mb_str() ) +
" not found" );
154 const PCB_SHAPE& expectCopperLine()
156 for(
const BOARD_ITEM* shape : m_footprint.GraphicalItems() )
159 return *
static_cast<const PCB_SHAPE*
>( shape );
161 throw std::runtime_error(
"Copper line not found" );
173 buildTwoPadTie(
F_Cu );
175 const std::vector<FP_LEVEL_NET_TIE_FIXTURE::SHORT_INFO> shorts = getShortedItems();
180 BOOST_CHECK_NE( shorts[0].padA,
nullptr );
181 BOOST_CHECK_NE( shorts[0].padB,
nullptr );
182 BOOST_CHECK_NE( shorts[0].padA, shorts[0].padB );
184 BOOST_CHECK_NE( shorts[0].copper, &expectCopperLine() );
199 const std::vector<FP_LEVEL_NET_TIE_FIXTURE::SHORT_INFO> shorts = getShortedItems();
204 BOOST_CHECK_NE( shorts[0].padA,
nullptr );
205 BOOST_CHECK_NE( shorts[0].padB,
nullptr );
206 BOOST_CHECK_NE( shorts[0].padA, shorts[0].padB );
208 BOOST_CHECK_NE( shorts[0].copper, &expectCopperLine() );
220 setCustomStackup( 4 );
223 const std::vector<FP_LEVEL_NET_TIE_FIXTURE::SHORT_INFO> shorts = getShortedItems();
228 BOOST_CHECK_NE( shorts[0].padA,
nullptr );
229 BOOST_CHECK_NE( shorts[0].padB,
nullptr );
230 BOOST_CHECK_NE( shorts[0].padA, shorts[0].padB );
232 BOOST_CHECK_NE( shorts[0].copper, &expectCopperLine() );
246 setCustomStackup( 4 );
263 setCustomStackup( 4 );
269 addNonComponentPad( wxS(
"1" ), padAPos,
In2_Cu );
270 addNonComponentPad( wxS(
"2" ), padBPos,
In1_Cu );
271 addCopperLine( padAPos, padBPos,
In2_Cu );
constexpr EDA_IU_SCALE pcbIUScale
constexpr bool Contains(const Vec &aPoint) const
static const LSET & AllCuMask()
return AllCuMask( MAX_CU_LAYERS );
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
void SetWidth(int aWidth) override
void SetEnd(const VECTOR2I &aEnd) override
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetStart(const VECTOR2I &aStart) override
PCB_LAYER_ID
A quick note on layer IDs:
@ NON_COMPONENT
Pad with no hole that does not connect to a physical component, but rather provides a connection poin...
constexpr int mmToIU(double mm) const
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_CHECK(res.column_datatype(0)==SQL_NUMERIC||res.column_datatype(0)==SQL_DECIMAL)
BOOST_REQUIRE_EQUAL(rows.size(), 1)
BOOST_CHECK_EQUAL(std::any_cast< std::string >(rows[0].at("val")), "12345678901234567.89")
BOOST_AUTO_TEST_SUITE_END()
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
VECTOR2< int32_t > VECTOR2I