53#define CHECK_ENUM_CLASS_EQUAL( L, R ) \
54 BOOST_CHECK_EQUAL( static_cast<int>( L ), static_cast<int>( R ) )
80 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"LayerWildcard.kicad_pcb" );
85 ZONE* z = testBoard->Zones()[0];
95 auto tmpBoard = std::filesystem::temp_directory_path() /
"Issue19775_RoundTrip.kicad_pcb";
99 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"LayerEnumerate.kicad_pcb" );
100 kicadPlugin.SaveBoard( tmpBoard.string(), *testBoard );
104 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( tmpBoard.string() );
109 ZONE* z = testBoard->Zones()[0];
130 +
"plugins/kicad_sexpr/Issue23125_EmptyZone/";
132 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"EmptyZone.kicad_pcb" );
139 ZONE* z = testBoard->Zones()[0];
156 for(
int ii = 0; ii < 2; ++ii )
170 const wxString
path =
171 ( std::filesystem::temp_directory_path() /
"qa_coincident_drawings.kicad_pcb" ).
string();
173 kicadPlugin.SaveBoard(
path, board );
175 std::unique_ptr<BOARD> reloaded = kicadPlugin.LoadBoard(
path );
180 std::filesystem::remove(
path.ToStdString() );
187 +
"plugins/kicad_sexpr/";
189 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( dataPath +
"ScientificNotation.kicad_pcb" );
212 +
"plugins/kicad_sexpr/Issue23625_CorruptedStackup/";
214 std::unique_ptr<BOARD> testBoard;
216 BOOST_CHECK_NO_THROW( testBoard = kicadPlugin.LoadBoard( dataPath +
"corrupted_stackup.kicad_pcb" ) );
219 testBoard->GetDesignSettings().GetStackupDescriptor();
224 BOOST_CHECK_LE( stackup.
GetCount(), 128 );
225 BOOST_CHECK_GT( stackup.
GetCount(), 0 );
239 +
"plugins/kicad_sexpr/Issue24133_DuplicatedStackup/";
241 std::unique_ptr<BOARD> testBoard;
243 BOOST_CHECK_NO_THROW( testBoard = kicadPlugin.LoadBoard( dataPath +
"duplicated_stackup.kicad_pcb" ) );
245 const BOARD_STACKUP& stackup = testBoard->GetDesignSettings().GetStackupDescriptor();
267 std::string destinationPath = dataPath +
"issue3812.kicad_pcb";
269 std::string sourcePath = dataPath +
"issue18142.kicad_pcb";
270 std::map<std::string, UTF8> props;
284 int copperLayerCount = 0;
292 return copperLayerCount;
306 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( destinationPath );
308 const BOARD_STACKUP& initialStackup = testBoard->GetDesignSettings().GetStackupDescriptor();
309 const BOARD_STACKUP_ITEM* initialFirstDielectric = findFirstDielectric( initialStackup );
310 const int initialCopperLayerCount = testBoard->GetCopperLayerCount();
311 const LSET initialEnabledLayers = testBoard->GetEnabledLayers();
312 const wxString initialFinishType = initialStackup.
m_FinishType;
318 const wxString initialFirstDielectricMaterial = initialFirstDielectric->
GetMaterial();
319 const int initialFirstDielectricThickness = initialFirstDielectric->
GetThickness();
321 kicadPlugin.LoadAndAppendBoard( sourcePath, *testBoard, &props );
323 const int appendedCopperLayerCount = testBoard->GetCopperLayerCount();
325 if( appendedCopperLayerCount > initialCopperLayerCount )
326 testBoard->SetCopperLayerCount( appendedCopperLayerCount );
328 LSET enabledLayers = testBoard->GetEnabledLayers();
329 enabledLayers |= initialEnabledLayers;
330 testBoard->SetEnabledLayers( enabledLayers );
331 testBoard->GetDesignSettings().GetStackupDescriptor().SynchronizeWithBoard( &testBoard->GetDesignSettings() );
333 const BOARD_STACKUP& finalStackup = testBoard->GetDesignSettings().GetStackupDescriptor();
357 std::string destinationPath = dataPath +
"issue3812.kicad_pcb";
359 std::string sourcePath = dataPath +
"issue18142.kicad_pcb";
361 std::map<std::string, UTF8> props;
364 std::unique_ptr<BOARD> testBoard = kicadPlugin.LoadBoard( destinationPath );
371 kicadPlugin.LoadAndAppendBoard( sourcePath, *testBoard, &props );
396 std::string sourcePath = dataPath +
"issue3812.kicad_pcb";
398 std::map<std::string, UTF8> props;
407 if( track->GetLayer() == aLayer )
415 const wxString fName = wxS(
"Top_layer" );
416 const wxString in1Name = wxS(
"GND_layer" );
417 const wxString in2Name = wxS(
"VDD_layer" );
418 const wxString bName = wxS(
"Bottom_layer" );
421 std::vector<wxString> seenNames;
423 kicadPlugin.RegisterCallback(
424 [&](
const std::vector<INPUT_LAYER_DESC>& aDescs ) -> std::map<wxString, PCB_LAYER_ID>
427 seenNames.push_back( desc.Name );
432 std::unique_ptr<BOARD> identityBoard = std::make_unique<BOARD>();
434 kicadPlugin.LoadAndAppendBoard( sourcePath, *identityBoard, &props );
437 BOOST_CHECK( std::find( seenNames.begin(), seenNames.end(), in1Name ) != seenNames.end() );
438 BOOST_CHECK( std::find( seenNames.begin(), seenNames.end(), in2Name ) != seenNames.end() );
440 const int idIn1 = countTracksOn( identityBoard.get(),
In1_Cu );
441 const int idIn2 = countTracksOn( identityBoard.get(),
In2_Cu );
443 BOOST_REQUIRE_GT( idIn2, 0 );
446 kicadPlugin.RegisterCallback(
447 [&](
const std::vector<INPUT_LAYER_DESC>& ) -> std::map<wxString, PCB_LAYER_ID>
452 std::unique_ptr<BOARD> swapBoard = std::make_unique<BOARD>();
454 kicadPlugin.LoadAndAppendBoard( sourcePath, *swapBoard, &props );
456 const int swIn1 = countTracksOn( swapBoard.get(),
In1_Cu );
457 const int swIn2 = countTracksOn( swapBoard.get(),
In2_Cu );
473 std::string standardNames = dataPath +
"issue18142.kicad_pcb";
474 std::string customNames = dataPath +
"issue3812.kicad_pcb";
476 std::map<std::string, UTF8> props;
479 bool handlerCalled =
false;
481 kicadPlugin.RegisterCallback(
482 [&](
const std::vector<INPUT_LAYER_DESC>& aDescs ) -> std::map<wxString, PCB_LAYER_ID>
484 handlerCalled =
true;
486 std::map<wxString, PCB_LAYER_ID> remap;
489 remap[desc.Name] = desc.AutoMapLayer;
496 std::unique_ptr<BOARD> matchBoard = kicadPlugin.LoadBoard( standardNames );
497 handlerCalled =
false;
498 kicadPlugin.LoadAndAppendBoard( standardNames, *matchBoard, &props );
504 std::unique_ptr<BOARD> mismatchBoard = kicadPlugin.LoadBoard( standardNames );
505 handlerCalled =
false;
506 kicadPlugin.LoadAndAppendBoard( customNames, *mismatchBoard, &props );
533 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
540 fp->
SetFPID(
LIB_ID( wxT(
"scratch" ), wxT(
"test_fp_save_netinfo" ) ) );
567 BOOST_REQUIRE_NO_THROW( kicadPlugin.FootprintSave( tmpLib.
Path().string(), fp ) );
569 auto savedFile = tmpLib.
Path() /
"test_fp_save_netinfo.kicad_mod";
572 std::ifstream in( savedFile );
574 "Failed to open serialized footprint: " << savedFile.string() );
576 std::stringstream ss;
584 const std::string contents = ss.str();
587 BOOST_CHECK_MESSAGE( contents.find(
"(net " ) == std::string::npos,
588 "Saved footprint library file must not contain (net ...) tokens:\n"
596 std::unique_ptr<FOOTPRINT> detached(
static_cast<FOOTPRINT*
>( fp->
Clone() ) );
597 detached->SetParent(
nullptr );
598 detached->SetParentGroup(
nullptr );
599 detached->ClearAllNets();
605 detached->RunOnChildren(
608 switch( aItem->
Type() )
637 std::unique_ptr<BOARD> writeBoard = std::make_unique<BOARD>();
639 ZONE* zone =
new ZONE( writeBoard.get() );
656 writeBoard->Add( zone );
658 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
659 /
"copper_thieving_roundtrip.kicad_pcb";
662 writer.
SaveBoard( tmpPath.string(), *writeBoard );
665 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
669 ZONE* loaded = readBoard->Zones()[0];
683 std::filesystem::remove( tmpPath );
693 const std::array<THIEVING_PATTERN, 3> patterns = {
703 std::unique_ptr<BOARD> writeBoard = std::make_unique<BOARD>();
705 ZONE* zone =
new ZONE( writeBoard.get() );
717 writeBoard->Add( zone );
719 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
720 /
"copper_thieving_pattern.kicad_pcb";
722 writer.
SaveBoard( tmpPath.string(), *writeBoard );
725 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
728 BOOST_CHECK( readBoard->Zones()[0]->GetThievingSettings().pattern == pattern );
730 std::filesystem::remove( tmpPath );
744 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
745 /
"copper_thieving_old_version.kicad_pcb";
746 std::ofstream out( tmpPath );
749 out <<
"(kicad_pcb (version 20260512) (generator \"test\") (generator_version \"test\")"
750 <<
" (general (thickness 1.6)) (paper \"A4\")"
751 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
752 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000001\")"
753 <<
" (hatch edge 0.5)"
754 <<
" (connect_pads (clearance 0))"
755 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
756 <<
" (fill yes (mode thieving) (thermal_gap 0.5) (thermal_bridge_width 0.5)"
757 <<
" (island_removal_mode 0))"
758 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
765 std::filesystem::remove( tmpPath );
772 std::filesystem::path tmpPath = tempDir.
Path() /
"malformed_dimension_text.kicad_pcb";
773 std::ofstream out( tmpPath );
774 out <<
"(kicad_pcb (version 20240108) (generator \"test\")"
775 <<
" (general (thickness 1.6)) (paper \"A4\")"
776 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal) (36 \"B.SilkS\" user \"b.silkscreen\"))"
777 <<
" (dimension (type aligned) (layer \"B.SilkS\")"
778 <<
" (gr_text \"1 mm\" (at broken))))";
795 std::filesystem::path tmpPath = std::filesystem::temp_directory_path()
796 /
"copper_thieving_malformed.kicad_pcb";
797 std::ofstream out( tmpPath );
798 out <<
"(kicad_pcb (version 20260513) (generator \"test\") (generator_version \"test\")"
799 <<
" (general (thickness 1.6)) (paper \"A4\")"
800 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
801 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000002\")"
802 <<
" (hatch edge 0.5)"
803 <<
" (connect_pads (clearance 0))"
804 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
805 <<
" (fill yes (mode thieving)"
806 <<
" (thermal_gap 0.5) (thermal_bridge_width 0.5)"
807 <<
" (island_removal_mode 0)"
808 <<
" (thieving (type dots) (size -1) (gap 0)"
809 <<
" (width -5) (stagger no) (orientation 0)))"
810 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
815 std::unique_ptr<BOARD> readBoard = reader.
LoadBoard( tmpPath.string() );
821 BOOST_CHECK_GT( loaded.
gap, 0 );
824 std::filesystem::remove( tmpPath );
838 std::filesystem::path tmpPath = tempDir.
Path() /
"thermal_zone_block.kicad_pcb";
839 std::ofstream out( tmpPath );
843 out <<
"(kicad_pcb (version 20260513) (generator \"test\") (generator_version \"test\")"
844 <<
" (general (thickness 1.6)) (paper \"A4\")"
845 <<
" (layers (0 \"F.Cu\" signal) (31 \"B.Cu\" signal))"
846 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000001\")"
847 <<
" (hatch edge 0.5)"
848 <<
" (connect_pads (clearance 0.5))"
849 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
850 <<
" (fill yes (thermal_gap 0.5) (thermal_bridge_width 0.5) (island_removal_mode 0))"
851 <<
" (polygon (pts (xy 0 0) (xy 5 0) (xy 5 5) (xy 0 5))))"
852 <<
" (zone (net 0) (net_name \"\") (layer \"F.Cu\") (uuid \"00000000-0000-0000-0000-000000000002\")"
854 <<
" (hatch edge 0.5)"
855 <<
" (connect_pads yes (clearance 0.5))"
856 <<
" (min_thickness 0.25) (filled_areas_thickness no)"
857 <<
" (fill yes (thermal_gap 0.5) (thermal_bridge_width 0.5) (island_removal_mode 0)"
858 <<
" (smoothing fillet) (radius 1))"
859 <<
" (polygon (pts (xy 10 0) (xy 15 0) (xy 15 5) (xy 10 5))))"
864 std::unique_ptr<BOARD> board = std::make_unique<BOARD>();
866 ZONE_SETTINGS settings = board->GetDesignSettings().GetDefaultZoneSettings();
873 board->GetDesignSettings().SetDefaultZoneSettings( settings );
875 kicadPlugin.LoadAndAppendBoard( tmpPath.string(), *board );
880 ZONE* omitted = board->Zones()[0];
889 ZONE* explicitZone = board->Zones()[1];
908 CANCEL_AT_LINE_READER(
const std::string& aText,
unsigned aCancelLine,
bool* aCancelFlag ) :
910 m_cancelLine( aCancelLine ),
911 m_cancelFlag( aCancelFlag )
917 if( !*m_cancelFlag &&
LineNumber() >= m_cancelLine )
919 *m_cancelFlag =
true;
920 std::this_thread::sleep_for( std::chrono::milliseconds( 300 ) );
927 unsigned m_cancelLine;
934 CANCELLING_REPORTER(
bool* aCancelFlag ) :
935 m_cancelFlag( aCancelFlag )
944 void Report(
const wxString& )
override {}
948 void SetTitle(
const wxString& )
override {}
949 bool IsCancelled()
const override {
return *m_cancelFlag; }
957 std::unique_ptr<BOARD>
source = std::make_unique<BOARD>();
962 for(
int i = 0; i < 400; i++ )
974 kicadPlugin.FormatBoardToFormatter( &fmt,
source.get() );
980 unsigned lineCount = std::count(
text.begin(),
text.end(),
'\n' );
983 std::unique_ptr<BOARD> dest = std::make_unique<BOARD>();
990 dest->Add( existing );
992 size_t tracksBefore = dest->Tracks().size();
993 unsigned netsBefore = dest->GetNetInfo().GetNetCount();
995 bool cancelRequested =
false;
997 CANCEL_AT_LINE_READER reader(
text, lineCount / 2, &cancelRequested );
998 CANCELLING_REPORTER
reporter( &cancelRequested );
1000 BOOST_CHECK_THROW( kicadPlugin.DoLoad( reader, *dest,
false,
nullptr, &
reporter, lineCount ),
IO_ERROR );
1014 std::filesystem::path libPath = std::filesystem::temp_directory_path() /
"kicad_qa_no_such_library.pretty";
1018 wxArrayString names;
1020 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
1022 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
1031 std::filesystem::path libPath = temp.
Path() /
"finish.pretty";
1032 std::filesystem::create_directories( libPath );
1035 /
"Resistor_SMD.pretty" /
"R_0402_1005Metric.kicad_mod";
1038 std::unique_ptr<FOOTPRINT> footprint = kicadPlugin.ImportFootprint( wxString(
source.string() ),
name );
1040 footprint->SetFPID(
LIB_ID( wxEmptyString, wxS(
"grouped" ) ) );
1041 footprint->SetLocked(
true );
1044 group->AddItem( footprint->Pads().front() );
1045 footprint->Add(
group );
1047 kicadPlugin.FootprintSave( libPath.string(), footprint.get() );
1049 std::unique_ptr<FOOTPRINT> loaded =
1050 kicadPlugin.ImportFootprint( wxString( ( libPath /
"grouped.kicad_mod" ).
string() ),
name );
1064 std::filesystem::path libPath = temp.
Path() /
"warning.pretty";
1065 std::filesystem::create_directories( libPath );
1067 std::filesystem::path
source =
1070 for(
const char*
name : {
"R_0402_1005Metric",
"R_0603_1608Metric" } )
1071 std::filesystem::copy_file(
source / ( std::string(
name ) +
".kicad_mod" ),
1072 libPath / ( std::string(
name ) +
".kicad_mod" ) );
1075 std::filesystem::path zeroPad = libPath /
"R_0402_1005Metric.kicad_mod";
1076 std::ifstream in( zeroPad );
1077 std::string
text( ( std::istreambuf_iterator<char>( in ) ), std::istreambuf_iterator<char>() );
1080 size_t at =
text.find(
"(size 0.54 0.64)" );
1082 text.replace( at, std::string(
"(size 0.54 0.64)" ).size(),
"(size 0 0)" );
1083 std::ofstream( zeroPad ) <<
text;
1085 wxArrayString names;
1087 BOOST_CHECK_NO_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ) );
1089 BOOST_CHECK( names.Index( wxS(
"R_0402_1005Metric" ) ) != wxNOT_FOUND );
1092 std::ofstream( libPath /
"broken.kicad_mod" ) <<
"(footprint";
1094 kicadPlugin.ClearCachedFootprints( libPath.string() );
1097 BOOST_CHECK_THROW( kicadPlugin.FootprintEnumerate( names, libPath.string(),
false ),
IO_ERROR );
constexpr EDA_IU_SCALE pcbIUScale
General utilities for PCB file IO for QA programs.
@ BS_ITEM_TYPE_DIELECTRIC
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
virtual void SetNet(NETINFO_ITEM *aNetInfo)
Set a NET_INFO object for the item.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
NETINFO_ITEM * GetNet() const
Return NETINFO_ITEM object for a given item.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
bool IsLocked() const override
Manage one layer needed to make a physical board.
int GetThickness(int aDielectricSubLayer=0) const
wxString GetMaterial(int aDielectricSubLayer=0) const
Manage layers needed to make a physical board.
int BuildBoardThicknessFromStackup() const
wxString m_FinishType
The name of external copper finish.
Information pertinent to a Pcbnew printed circuit board.
void Add(BOARD_ITEM *aItem, ADD_MODE aMode=ADD_MODE::INSERT, bool aSkipConnectivity=false) override
Removes an item from the container.
const TRACKS & Tracks() const
const DRAWINGS & Drawings() const
KICAD_T Type() const
Returns the type of object.
EDA_ANGLE GetAngle() const
void SetAngle(const EDA_ANGLE &aAngle)
VECTOR2I GetArcMid() const
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
const std::filesystem::path & Path() const
Get the path to the temporary directory as a std::filesystem::path.
A logical library item identifier and consists of various portions much like a URI.
virtual unsigned LineNumber() const
Return the line number of the last line read from this LINE_READER.
LSET is a set of PCB_LAYER_IDs.
bool Contains(PCB_LAYER_ID aLayer) const
See if the layer set contains a PCB layer.
Handle the data for a net.
static NETINFO_ITEM * OrphanedItem()
NETINFO_ITEM meaning that there was no net assigned for an item, as there was no board storing net li...
@ NORMAL
Shape is the same on all layers.
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
A set of BOARD_ITEMs (i.e., without duplicates).
A PCB_IO derivation for saving and loading Pcbnew s-expression formatted files.
std::unique_ptr< FOOTPRINT > ImportFootprint(const wxString &aFootprintPath, wxString &aFootprintNameOut, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Load a single footprint from aFootprintPath and put its name in aFootprintNameOut.
void SaveBoard(const wxString &aFileName, BOARD &aBoard, const std::map< std::string, UTF8 > *aProperties=nullptr) override
Write aBoard to a storage file in a format that this PCB_IO implementation knows about or it can be u...
std::unique_ptr< BOARD > LoadBoard(const wxString &aFileName, const std::map< std::string, UTF8 > *aProperties=nullptr, PROJECT *aProject=nullptr)
Load information from some input file format that this PCB_IO implementation knows about into new BOA...
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
void SetEnd(const VECTOR2I &aEnd)
void SetStart(const VECTOR2I &aStart)
virtual void SetWidth(int aWidth)
A progress reporter interface for use in multi-threaded environments.
virtual bool IsCancelled() const =0
virtual void AddPhases(int aNumPhases)=0
virtual bool KeepRefreshing(bool aWait=false)=0
Update the UI (if any).
virtual void SetNumPhases(int aNumPhases)=0
Set the number of phases.
virtual void Report(const wxString &aMessage)=0
Display aMessage in the progress bar dialog.
virtual void BeginPhase(int aPhase)=0
Initialize the aPhase virtual zone of the dialog progress bar.
virtual void AdvancePhase()=0
Use the next available virtual zone of the dialog progress bar.
virtual void SetTitle(const wxString &aTitle)=0
Change the title displayed on the window caption.
virtual void AdvanceProgress()=0
Increment the progress bar length (inside the current virtual zone).
virtual void SetCurrentProgress(double aProgress)=0
Set the progress value to aProgress (0..1).
virtual void SetMaxProgress(int aMaxProgress)=0
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
int TotalVertices() const
Return total number of vertices stored in the set.
Is a LINE_READER that reads from a multiline 8 bit wide std::string.
STRING_LINE_READER(const std::string &aString, const wxString &aSource)
Construct a string line reader.
char * ReadLine() override
Read a line of text into the buffer and increments the line number counter.
void SetCornerSmoothingType(CORNER_SMOOTHING aType)
void SetPadConnection(ZONE_CONNECTION aPadConnection)
void SetCornerRadius(int aRadius)
ZONE_FILL_MODE m_FillMode
int m_HatchSmoothingLevel
Handle a list of polygons defining a copper zone.
const THIEVING_SETTINGS & GetThievingSettings() const
bool AppendCorner(const VECTOR2I &aPosition, int aHoleIdx, bool aAllowDuplication=false)
Add a new corner to the zone outline (to the main outline or a hole)
ZONE_LAYER_PROPERTIES & LayerProperties(PCB_LAYER_ID aLayer)
std::shared_ptr< SHAPE_POLY_SET > GetFilledPolysList(PCB_LAYER_ID aLayer) const
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
bool IsCopperThieving() const
ZONE_SETTINGS::CORNER_SMOOTHING GetCornerSmoothingType() const
void SetFillMode(ZONE_FILL_MODE aFillMode)
ZONE_CONNECTION GetPadConnection() const
void SetThievingSettings(const THIEVING_SETTINGS &aSettings)
VECTOR2I GetPosition() const override
void SetNet(NETINFO_ITEM *aNetInfo) override
Override that drops aNetInfo when this zone is in copper-thieving fill mode.
ZONE_FILL_MODE GetFillMode() const
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
int GetHatchSmoothingLevel() const
unsigned int GetCornerRadius() const
int GetNumCorners(void) const
Access to m_Poly parameters.
PCB_LAYER_ID
A quick note on layer IDs:
std::string GetTestDataRootDir()
std::string GetPcbnewTestDataDir()
Utility which returns a path to the data directory where the test board files are stored.
constexpr char APPEND_PRESERVE_DESTINATION_STACKUP[]
Class to handle a set of BOARD_ITEMs.
PCB_IO_KICAD_SEXPR kicadPlugin
Parameters that drive copper-thieving fill generation.
EDA_ORIENTATION orientation
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
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_REQUIRE_MESSAGE(dc.CacheTableInfo(table, { "part_id", "val" }), dc.GetLastError())
BOOST_REQUIRE(res.columns()==1)
BOOST_AUTO_TEST_SUITE_END()
BOOST_TEST(netlist.find("R_G1 ARM_OUT1 DIE_B R='0.001 / ((SW_STATE)") !=std::string::npos)
IbisParser parser & reporter
#define CHECK_ENUM_CLASS_EQUAL(L, R)
BOOST_AUTO_TEST_CASE(Issue19775_ZoneLayerWildcards)
Declares the struct as the Boost test fixture.
BOOST_TEST_CONTEXT("Test Clearance")
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
@ PCB_ZONE_T
class ZONE, a copper pour area
@ PCB_PAD_T
class PAD, a pad in a footprint
VECTOR2< int32_t > VECTOR2I
THIEVING_PATTERN
Shape stamped onto the grid for a copper-thieving fill.
@ THERMAL
Use thermal relief for pads.
@ FULL
pads are covered by copper