20#include <boost/test/unit_test.hpp>
61 trackSource, { &shape, &trackTarget,
nullptr, &trackSource, &arcTarget } );
63 BOOST_REQUIRE_EQUAL( targets.size(), 3 );
139 BOOST_CHECK( keys.contains( wxS(
"common/Line Width" ) ) );
140 BOOST_CHECK( !keys.contains( wxS(
"route/Width" ) ) );
141 BOOST_CHECK( !keys.contains( wxS(
"shape/Line Width" ) ) );
146 BOOST_CHECK(
families.contains( wxS(
"route" ) ) );
147 BOOST_CHECK(
families.contains( wxS(
"shape" ) ) );
151 == std::set<wxString>{ wxS(
"via" ) } );
162 BOOST_CHECK( label.Contains(
_(
"Tracks and Arcs" ) ) );
163 BOOST_CHECK( label.Contains( wxGetTranslation( wxS(
"Width" ) ) ) );
164 BOOST_CHECK( !label.Contains( wxS(
"route/" ) ) );
174 wxGetTranslation( wxS(
"Width" ) ) );
211 BOOST_CHECK(
families.contains( wxS(
"shape" ) ) );
212 BOOST_CHECK( !
families.contains( wxS(
"route" ) ) );
222 BOOST_CHECK( !
families.contains( wxS(
"textbox" ) ) );
223 BOOST_CHECK( !
families.contains( wxS(
"table_cell" ) ) );
360 ZONE source( &board );
361 ZONE target( &board );
383 ZONE source( &board );
384 ZONE target( &board );
426 std::set<wxString> advertised;
432 advertised.insert( family );
435 for(
const wxString& family : { wxS(
"route" ), wxS(
"via" ), wxS(
"pad" ), wxS(
"shape" ), wxS(
"text" ),
436 wxS(
"textbox" ), wxS(
"dimension" ), wxS(
"zone" ), wxS(
"rule_area" ),
437 wxS(
"footprint" ), wxS(
"table" ), wxS(
"table_cell" ), wxS(
"target" ),
438 wxS(
"reference_image" ), wxS(
"barcode" ) } )
440 BOOST_CHECK_MESSAGE( advertised.contains( family ),
"Nothing copyable for family: " << family );
450 BOOST_CHECK( keys.contains( wxS(
"zone/Fill Mode" ) ) );
451 BOOST_CHECK( !keys.contains( wxS(
"rule_area/Fill Mode" ) ) );
452 BOOST_CHECK( keys.contains( wxS(
"rule_area/Keep Out Tracks" ) ) );
453 BOOST_CHECK( !keys.contains( wxS(
"zone/Keep Out Tracks" ) ) );
467 if( !property->IsCopyable() )
470 const wxString
name =
property->Name();
472 BOOST_CHECK_MESSAGE(
name != wxS(
"Net" ) &&
name != wxS(
"Net Class" ) &&
name != wxS(
"Locked" )
473 && !
name.StartsWith( wxS(
"Position" ) ) && !
name.EndsWith( wxS(
" X" ) )
474 && !
name.EndsWith( wxS(
" Y" ) ) &&
name != wxS(
"Orientation" )
475 &&
name != wxS(
"Reference" ) &&
name != wxS(
"Value" ),
476 "Unsafe property flagged copyable: " <<
name );
488 ZONE ruleArea( &board );
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
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).
void SetWidth(int aWidth) override
int GetWidth() const override
int GetTextThickness() const override
void SetTextThickness(int aWidth) override
The TextThickness is that set by the user.
void SetTextSize(VECTOR2I aNewSize, bool aEnforceMinTextSize=true) override
VECTOR2I GetTextSize() const override
void SetStart(const VECTOR2I &aStart)
const VECTOR2I & GetStart() const
virtual void SetWidth(int aWidth)
virtual int GetWidth() const
void SetDrill(int aDrill)
int GetWidth() const override
int GetDrillValue() const
Calculate the drill value for vias (m_drill if > 0, or default drill value for the board).
void SetWidth(int aWidth) override
Provide class metadata.Helper macro to map type hashes to names.
const std::vector< PROPERTY_BASE * > & GetProperties(TYPE_ID aType) const
Return all properties for a specific type.
static PROPERTY_MANAGER & Instance()
Handle a list of polygons defining a copper zone.
void SetHatchThickness(int aThickness)
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
void SetIsRuleArea(bool aEnable)
void SetFillMode(ZONE_FILL_MODE aFillMode)
int GetHatchThickness() const
ZONE_FILL_MODE GetFillMode() const
static const std::map< wxString, FAMILY > & families()
Keyed by the names Family() returns. Every family there must appear here.
MATCH_PROPERTIES_RESULT Copy(const EDA_ITEM &aSource, EDA_ITEM &aTarget, const std::set< wxString > &aEnabledKeys)
bool Compatible(const EDA_ITEM &aSource, const EDA_ITEM &aTarget)
const std::set< wxString > & AllSafeKeys()
Every property Match Properties may copy, keyed as "family/Property Name".
wxString PropertyLabel(const wxString &aKey)
The translated property name alone, without the family it belongs to.
const std::set< wxString > & DefaultKeys()
The subset enabled until the user says otherwise.
bool AnyEnabledFor(const EDA_ITEM &aItem, const std::set< wxString > &aEnabledKeys)
True if any enabled key names a property of this item's family.
std::vector< EDA_ITEM * > CompatibleTargets(const EDA_ITEM &aSource, const std::vector< EDA_ITEM * > &aCandidates)
wxString FamilyLabel(const wxString &aFamily)
The translated name of a family, for the heading of its group.
std::set< wxString > FamiliesFor(const wxString &aKey)
The families a key reaches. One for a family key, several for a common one.
wxString Family(const EDA_ITEM &aItem)
wxString DisplayLabel(const wxString &aKey)
BARCODE class definition.
Class to handle a set of BOARD_ITEMs.
size_t TYPE_ID
Unique type identifier.
BOOST_AUTO_TEST_CASE(HorizontalAlignment)
BOOST_AUTO_TEST_SUITE(CadstarPartParser)
BOOST_AUTO_TEST_SUITE_END()
BOOST_AUTO_TEST_CASE(CompatibleFamiliesAndTargets)
wxString result
Test unit parsing edge cases and error handling.
BOOST_CHECK_EQUAL(result, "25.4")
VECTOR2< int32_t > VECTOR2I