73 +
"plugins/altium/eDP_adapter_dvt1_source/eDP_adapter_dvt1.PcbDoc";
75 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
78 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
83 BOOST_CHECK( board->GetNetCount() > 0 );
84 BOOST_CHECK( board->Footprints().size() > 0 );
100 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
102 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
107 std::shared_ptr<NET_SETTINGS> netSettings = board->GetDesignSettings().m_NetSettings;
112 auto& patternAssignments = netSettings->GetNetclassPatternAssignments();
115 BOOST_REQUIRE_MESSAGE( patternAssignments.size() > 0,
116 "Test file must have netclass pattern assignments" );
120 bool foundAssignedNet =
false;
124 if( net->GetNetCode() <= 0 )
128 NETCLASS* directNetclass = net->GetNetClass();
131 std::shared_ptr<NETCLASS> effectiveNetclass =
132 netSettings->GetEffectiveNetClass( net->GetNetname() );
139 directNetclass !=
nullptr,
140 wxString::Format(
"Net '%s' should have a direct netclass assignment",
141 net->GetNetname() ) );
145 foundAssignedNet =
true;
151 wxString::Format(
"Net '%s' should not have default netclass, "
152 "expected effective class or component",
153 net->GetNetname() ) );
160 "At least one net should have a non-default netclass assigned" );
170 const std::string& aRelativePath )
174 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
175 aPlugin.
LoadBoard( dataPath, board.get(),
nullptr );
179 int fillZoneCount = 0;
180 int fillZonesWithClearance = 0;
182 for(
ZONE* zone : board->Zones() )
184 if( !zone->IsOnCopperLayer() || zone->GetIsRuleArea() || zone->IsTeardropArea() )
189 if( zone->GetLocalClearance().has_value() && zone->GetLocalClearance().value() > 0 )
190 fillZonesWithClearance++;
193 BOOST_CHECK_GT( fillZoneCount, 0 );
196 wxString::Format(
"%s: %d/%d copper fill zones have clearance set",
197 aRelativePath, fillZonesWithClearance,
205 m_altiumPlugin,
"plugins/altium/eDP_adapter_dvt1_source/eDP_adapter_dvt1.PcbDoc" );
212 "plugins/altium/HiFive/HiFive1.B01.PcbDoc" );
257 auto makeRule = [](
int aPriority,
const wxString& aScope1,
const wxString& aScope2,
269 std::vector<ARULE6> rules = {
270 makeRule( 1, wxT(
"InPolygon And InNet('GND')" ), wxT(
"All" ), 100 ),
271 makeRule( 2, wxT(
"InPolygon" ), wxT(
"All" ), 200 ),
272 makeRule( 3, wxT(
"All" ), wxT(
"All" ), 300 ),
273 makeRule( 4, wxT(
"All" ), wxT(
"All" ), 400 ),
281 rules.erase( rules.begin() );
287 rules.erase( rules.begin() );
307 +
"plugins/altium/issue24456/Fastino_Ground_Isolator.PcbDoc";
309 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
311 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
316 int frontExposed = 0;
319 for(
PCB_TRACK* track : board->Tracks() )
334 BOOST_REQUIRE_GT( viaCount, 0 );
339 wxString::Format(
"%d of %d vias left front-exposed despite a "
340 "hole-referenced mask",
341 frontExposed, viaCount ) );
343 wxString::Format(
"%d of %d vias left back-exposed despite a "
344 "hole-referenced mask",
345 backExposed, viaCount ) );
350 const uint32_t holeSize = 300000;
351 const int landWidth = 600000;
354 holeSize, 500000, landWidth ) );
356 holeSize, 30000, landWidth ) );
358 holeSize, 0, landWidth ) );
362 holeSize, 30000, landWidth ) );
376 +
"plugins/altium/issue24456/Fastino_Ground_Isolator.PcbDoc";
378 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
380 m_altiumPlugin.LoadBoard( dataPath, board.get(),
nullptr );
384 const BOARD_STACKUP& stackup = board->GetDesignSettings().GetStackupDescriptor();
386 int dielectricCount = 0;
387 int dielectricWithTangent = 0;
394 for(
int sub = 0; sub < item->GetSublayersCount(); sub++ )
397 if( item->GetThickness( sub ) <= 0 )
402 double tangent = item->GetLossTangent( sub );
406 dielectricWithTangent++;
409 BOOST_CHECK_CLOSE( tangent, 0.020, 1e-6 );
414 BOOST_REQUIRE_GT( dielectricCount, 0 );
419 wxString::Format(
"Only %d of %d dielectric sublayers received a loss "
420 "tangent from the Altium stackup",
421 dielectricWithTangent, dielectricCount ) );
434 std::string pcbDoc = dataDir +
"Fastino_Ground_Isolator.PcbDoc";
435 std::string prjPcb = dataDir +
"Fastino_Ground_Isolator.PrjPcb";
441 std::map<std::string, UTF8> props;
442 props[
"project_file"] = prjPcb;
444 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
446 m_altiumPlugin.LoadBoard( pcbDoc, board.get(), &props, &
project );
448 const std::map<wxString, wxString>& textVars =
project.GetTextVars();
456 BOOST_CHECK_EQUAL( textVars.at( wxS(
"PROJECT_NAME" ) ), wxS(
"Fastino Ground Isolator" ) );
467 board->SetProject( &
project,
true );
469 bool sawResolvedBoardText =
false;
475 if(
text &&
text->GetText().Contains( wxS(
"${PCB_REVISION}" ) ) )
477 wxString shown =
text->GetShownText(
false );
478 BOOST_CHECK( !shown.Contains( wxS(
"${PCB_REVISION}" ) ) );
479 BOOST_CHECK( shown.Contains( wxS(
"A" ) ) );
480 sawResolvedBoardText =
true;
484 BOOST_CHECK( sawResolvedBoardText );
495 std::string pcbDoc = dataDir +
"Fastino_Ground_Isolator.PcbDoc";
496 std::string prjPcb = dataDir +
"Fastino_Ground_Isolator.PrjPcb";
501 project.GetTextVars()[wxS(
"PCB_REVISION" )] = wxS(
"user-set" );
503 std::map<std::string, UTF8> props;
504 props[
"project_file"] = prjPcb;
506 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
508 m_altiumPlugin.LoadBoard( pcbDoc, board.get(), &props, &
project );
bool altiumScopeExprMatchesPolygon(const wxString &aExpr)
Return true if an Altium rule scope expression targets polygon pour primitives (matches InPolygon,...
const ARULE6 * selectAltiumPolygonRule(const std::vector< ARULE6 > &aRulesByPriorityAsc)
Select the highest Altium-priority rule whose scope references polygons.
bool altiumViaSideIsTented(bool aTentFlag, bool aManual, bool aFromHole, uint32_t aHoleSize, int32_t aMaskExpansion, int aLandDiameter)
Decide whether one side of an Altium via should be tented when imported into KiCad.
General utilities for PCB file IO for QA programs.
@ BS_ITEM_TYPE_DIELECTRIC
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Manage one layer needed to make a physical board.
Manage layers needed to make a physical board.
const std::vector< BOARD_STACKUP_ITEM * > & GetList() const
A mix-in class (via multiple inheritance) that handles texts such as labels, parts,...
A collection of nets and the parameters used to route or test these nets.
static const char Default[]
the name of the default NETCLASS
const wxString GetName() const
Gets the name of this (maybe aggregate) netclass in a format for internal usage or for export to exte...
Handle the data for a net.
BOARD * LoadBoard(const wxString &aFileName, BOARD *aAppendToMe, const std::map< std::string, UTF8 > *aProperties, PROJECT *aProject=nullptr) override
Load information from some input file format that this PCB_IO implementation knows about into either ...
Container for project specific data.
bool LoadProject(const wxString &aFullPath, bool aSetActive=true)
Load a project or sets up a new project with a specified path.
PROJECT & Prj() const
A helper while we are not MDI-capable – return the one and only project.
Handle a list of polygons defining a copper zone.
wxString ExpandTextVars(const wxString &aSource, const PROJECT *aProject, int aFlags)
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
ALTIUM_PCB_IMPORT_FIXTURE()=default
PCB_IO_ALTIUM_DESIGNER m_altiumPlugin
BOOST_AUTO_TEST_CASE(BoardLoadNoAssertions)
Test basic board loading - verifies that the Altium import doesn't trigger any assertions during the ...
static void checkAllCopperFillZonesHaveClearance(PCB_IO_ALTIUM_DESIGNER &aPlugin, const std::string &aRelativePath)
Verify that copper zones in imported Altium boards have non-zero local clearance values derived from ...
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_REQUIRE(intersection.has_value()==c.ExpectedIntersection.has_value())
BOOST_AUTO_TEST_SUITE_END()
BOOST_CHECK_MESSAGE(totalMismatches==0, std::to_string(totalMismatches)+" board(s) with strategy disagreements")
BOOST_CHECK_EQUAL(result, "25.4")
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)