KiCad PCB EDA Suite
Loading...
Searching...
No Matches
test_match_properties.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <boost/test/unit_test.hpp>
21
22
23#include <board.h>
24#include <footprint.h>
25#include <pad.h>
26#include <pcb_barcode.h>
27#include <pcb_dimension.h>
28#include <pcb_group.h>
29#include <pcb_reference_image.h>
30#include <pcb_shape.h>
31#include <pcb_table.h>
32#include <pcb_tablecell.h>
33#include <pcb_target.h>
34#include <pcb_text.h>
35#include <pcb_textbox.h>
36#include <pcb_track.h>
39#include <zone.h>
40
41
42BOOST_AUTO_TEST_SUITE( MatchProperties )
43
44
45// Tracks and arcs are one family. A shape is not. CompatibleTargets() drops nulls, the source
46// itself and other families.
47BOOST_AUTO_TEST_CASE( CompatibleFamiliesAndTargets )
48{
49 PCB_TRACK trackSource( nullptr );
50 PCB_TRACK trackTarget( nullptr );
51 PCB_ARC arcTarget( nullptr );
52 PCB_SHAPE shape;
53
54 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::Compatible( trackSource, trackTarget ) );
55 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::Compatible( trackSource, arcTarget ) );
56
57 // A track and a graphic both understand a line width, so they meet over that.
58 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::Compatible( trackSource, shape ) );
59
60 std::vector<EDA_ITEM*> targets = MATCH_PROPERTIES_CATALOG::CompatibleTargets(
61 trackSource, { &shape, &trackTarget, nullptr, &trackSource, &arcTarget } );
62
63 BOOST_REQUIRE_EQUAL( targets.size(), 3 );
64 BOOST_CHECK_EQUAL( targets[0], &shape );
65 BOOST_CHECK_EQUAL( targets[1], &trackTarget );
66 BOOST_CHECK_EQUAL( targets[2], &arcTarget );
67}
68
69
70// Kinds with nothing in common stay apart, or hovering would light up the whole board.
71BOOST_AUTO_TEST_CASE( UnrelatedKindsAreNotCompatible )
72{
73 PCB_VIA via( nullptr );
74 PCB_TEXT text( static_cast<BOARD_ITEM*>( nullptr ) );
75
78}
79
80
81// The width of a track and the line width of a graphic are the same idea under two names.
82BOOST_AUTO_TEST_CASE( CommonPropertyCopiesAcrossKinds )
83{
84 PCB_TRACK source( nullptr );
85 PCB_SHAPE target;
86
87 source.SetWidth( 400000 );
88 target.SetWidth( 200000 );
89
91 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "common/Line Width" ) } );
92
93 BOOST_CHECK( result );
94 BOOST_CHECK_EQUAL( target.GetWidth(), 400000 );
95 BOOST_CHECK_EQUAL( result.m_Changed, 1 );
96}
97
98
99// A common key still carries within one kind, which is how it replaced the per-family keys.
100BOOST_AUTO_TEST_CASE( CommonPropertyCopiesWithinOneKind )
101{
102 PCB_TRACK source( nullptr );
103 PCB_TRACK target( nullptr );
104
105 source.SetWidth( 400000 );
106 target.SetWidth( 200000 );
107
109 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "common/Line Width" ) } );
110
111 BOOST_CHECK( result );
112 BOOST_CHECK_EQUAL( target.GetWidth(), 400000 );
113}
114
115
116// Crossing kinds carries only what is common; the source's own keys stay behind.
117BOOST_AUTO_TEST_CASE( CrossKindCopyIgnoresFamilyOnlyKeys )
118{
119 PCB_TRACK source( nullptr );
120 PCB_SHAPE target;
121
122 source.SetWidth( 400000 );
123 target.SetWidth( 200000 );
124
125 // A family key of the source names nothing the target should take.
126 MATCH_PROPERTIES_RESULT result = MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Width" ) } );
127
128 BOOST_CHECK( result );
129 BOOST_CHECK_EQUAL( result.m_Changed, 0 );
130 BOOST_CHECK_EQUAL( target.GetWidth(), 200000 );
131}
132
133
134// A common key stands in for the per-family keys it covers, so the same idea is offered once.
135BOOST_AUTO_TEST_CASE( CommonKeysReplaceTheFamilyKeysTheyCover )
136{
137 const std::set<wxString>& keys = MATCH_PROPERTIES_CATALOG::AllSafeKeys();
138
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" ) ) );
142
143 // Reaching two kinds is what makes it common; the mapping must name both.
144 std::set<wxString> families = MATCH_PROPERTIES_CATALOG::FamiliesFor( wxS( "common/Line Width" ) );
145
146 BOOST_CHECK( families.contains( wxS( "route" ) ) );
147 BOOST_CHECK( families.contains( wxS( "shape" ) ) );
148
149 // A family key still answers for itself.
150 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::FamiliesFor( wxS( "via/Diameter" ) )
151 == std::set<wxString>{ wxS( "via" ) } );
152}
153
154
155// The keys are persisted settings strings. Pinning them is behaviour.
156BOOST_AUTO_TEST_CASE( KeysAreCanonicalAndLabelsAreFriendly )
157{
158 PCB_TRACK track( nullptr );
159 const wxString label = MATCH_PROPERTIES_CATALOG::DisplayLabel( wxS( "route/Width" ) );
160
161 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::Family( track ), wxString( wxS( "route" ) ) );
162 BOOST_CHECK( label.Contains( _( "Tracks and Arcs" ) ) );
163 BOOST_CHECK( label.Contains( wxGetTranslation( wxS( "Width" ) ) ) );
164 BOOST_CHECK( !label.Contains( wxS( "route/" ) ) );
165}
166
167
168// The settings tree groups by family and labels the rows with the property alone, so the two
169// halves of DisplayLabel() have to stand on their own.
170BOOST_AUTO_TEST_CASE( FamilyAndPropertyLabelsSplitTheKey )
171{
172 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::FamilyLabel( wxS( "route" ) ), _( "Tracks and Arcs" ) );
174 wxGetTranslation( wxS( "Width" ) ) );
175
176 // The property name carries no family, so a group heading can never repeat it.
177 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::PropertyLabel( wxS( "route/Width" ) ).Contains( wxS( "route" ) ) );
178
179 // An unknown family still names itself rather than coming back empty.
180 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::FamilyLabel( wxS( "nonesuch" ) ), wxString( wxS( "nonesuch" ) ) );
181}
182
183
184// BOARD_CONNECTED_ITEM replaces BOARD_ITEM's Layer with a copper-restricted one. That
185// replacement has to carry the copyable flag too, or every connected item silently loses Layer.
186BOOST_AUTO_TEST_CASE( ConnectedItemsOfferTheirLayer )
187{
188 PCB_TRACK track( nullptr );
189
190 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::AllSafeKeys().contains( wxS( "route/Layer" ) ) );
191
192 PCB_TRACK source( nullptr );
193 PCB_TRACK target( nullptr );
194
195 source.SetLayer( In1_Cu );
196 target.SetLayer( F_Cu );
197
198 MATCH_PROPERTIES_RESULT result = MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Layer" ) } );
199
200 BOOST_CHECK( result );
201 BOOST_CHECK( target.GetLayer() == In1_Cu );
202}
203
204
205// A track's layer must be a copper one, so it is not offered as something kinds share. A
206// graphic's silkscreen layer would otherwise land on a track.
207BOOST_AUTO_TEST_CASE( LayerIsNotSharedWithConnectedItems )
208{
209 std::set<wxString> families = MATCH_PROPERTIES_CATALOG::FamiliesFor( wxS( "common/Layer" ) );
210
211 BOOST_CHECK( families.contains( wxS( "shape" ) ) );
212 BOOST_CHECK( !families.contains( wxS( "route" ) ) );
213}
214
215
216// Fill is registered on text boxes and table cells but their availability func refuses it.
217// Pairing kinds over it would say they are compatible and then copy nothing.
218BOOST_AUTO_TEST_CASE( FillIsNotSharedWhereItCannotApply )
219{
220 std::set<wxString> families = MATCH_PROPERTIES_CATALOG::FamiliesFor( wxS( "common/Fill" ) );
221
222 BOOST_CHECK( !families.contains( wxS( "textbox" ) ) );
223 BOOST_CHECK( !families.contains( wxS( "table_cell" ) ) );
224
225 // With nothing left in common the two kinds must not read as compatible.
226 PCB_SHAPE shape;
227 PCB_TABLE table( nullptr, 0 );
228 PCB_TABLECELL cell( &table );
229
230 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::Compatible( shape, cell ) );
231}
232
233
234// An unsafe default never copies, and says nothing.
235BOOST_AUTO_TEST_CASE( DefaultKeysAreAllSafe )
236{
237 for( const wxString& key : MATCH_PROPERTIES_CATALOG::DefaultKeys() )
238 {
239 BOOST_CHECK_MESSAGE( MATCH_PROPERTIES_CATALOG::AllSafeKeys().contains( key ), "Unsafe default: " << key );
240 }
241}
242
243
244BOOST_AUTO_TEST_CASE( AnyEnabledForMatchesOnlyTheItemsOwnFamily )
245{
246 PCB_TRACK track( nullptr );
247 PCB_TABLE table( nullptr, 0 );
248 PCB_GROUP group( nullptr );
249
250 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::AnyEnabledFor( track, { wxS( "route/Width" ) } ) );
251 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::AnyEnabledFor( track, { wxS( "shape/Layer" ) } ) );
253
254 // "table/" must not pick up "table_cell/" keys.
255 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::AnyEnabledFor( table, { wxS( "table_cell/Font" ) } ) );
256 BOOST_CHECK( MATCH_PROPERTIES_CATALOG::AnyEnabledFor( table, { wxS( "table/Border Width" ) } ) );
257}
258
259
260// The enabled set is persisted and hand-editable. An unsafe key must not write identity.
261BOOST_AUTO_TEST_CASE( CopyIgnoresEnabledKeysOutsideTheCatalog )
262{
263 PCB_TRACK source( nullptr );
264 PCB_TRACK target( nullptr );
265
266 source.SetStart( VECTOR2I( 100000, 100000 ) );
267 target.SetStart( VECTOR2I( 900000, 900000 ) );
268
270 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Start X" ), wxS( "route/Net" ) } );
271
272 BOOST_CHECK( result );
273 BOOST_CHECK_EQUAL( result.m_Changed, 0 );
274 BOOST_CHECK_EQUAL( target.GetStart(), VECTOR2I( 900000, 900000 ) );
275}
276
277
278BOOST_AUTO_TEST_CASE( CopyLeavesTheSourceUntouched )
279{
280 PCB_TRACK source( nullptr );
281 PCB_TRACK target( nullptr );
282
283 source.SetWidth( 400000 );
284 target.SetWidth( 200000 );
285
287 BOOST_CHECK_EQUAL( source.GetWidth(), 400000 );
288}
289
290
291BOOST_AUTO_TEST_CASE( CopyTableCellTextProperties )
292{
293 PCB_TABLE table( nullptr, 0 );
294 PCB_TABLECELL source( &table );
295 PCB_TABLECELL target( &table );
296
297 source.SetTextThickness( 50000 );
298 target.SetTextThickness( 10000 );
299
301 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "table_cell/Thickness" ) } );
302
303 BOOST_CHECK( result );
304 BOOST_CHECK_EQUAL( target.GetTextThickness(), 50000 );
305 BOOST_CHECK_EQUAL( result.m_Changed, 1 );
306}
307
308
309BOOST_AUTO_TEST_CASE( CopySafeProperties )
310{
311 PCB_TRACK source( nullptr );
312 PCB_TRACK target( nullptr );
313
314 source.SetWidth( 400000 );
315 target.SetWidth( 200000 );
316
317 MATCH_PROPERTIES_RESULT result = MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Width" ) } );
318
319 BOOST_CHECK( result );
320 BOOST_CHECK_EQUAL( target.GetWidth(), 400000 );
321 BOOST_CHECK_EQUAL( result.m_Changed, 1 );
322}
323
324
325// Fonts are the awkward case. The value compares by name, not identity.
326BOOST_AUTO_TEST_CASE( CopyDoesNotCountIdenticalValuesAsChanges )
327{
328 PCB_TRACK source( nullptr );
329 PCB_TRACK target( nullptr );
330 PCB_TEXT textSource( static_cast<BOARD_ITEM*>( nullptr ) );
331 PCB_TEXT textTarget( static_cast<BOARD_ITEM*>( nullptr ) );
332
333 source.SetWidth( 400000 );
334 target.SetWidth( 400000 );
335
336 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Width" ) } ).m_Changed, 0 );
338 MATCH_PROPERTIES_CATALOG::Copy( textSource, textTarget, { wxS( "text/Font" ) } ).m_Changed, 0 );
339}
340
341
342BOOST_AUTO_TEST_CASE( CopyRejectsIncompatibleItemsWithoutMutation )
343{
344 PCB_TRACK source( nullptr );
345 PCB_TEXT target( static_cast<BOARD_ITEM*>( nullptr ) );
346
347 source.SetWidth( 400000 );
348 target.SetTextSize( VECTOR2I( 100000, 100000 ) );
349
350 MATCH_PROPERTIES_RESULT result = MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "route/Width" ) } );
351
352 BOOST_CHECK( !result );
353 BOOST_CHECK_EQUAL( target.GetTextSize(), VECTOR2I( 100000, 100000 ) );
354}
355
356
357BOOST_AUTO_TEST_CASE( CopyZonePropertiesStagesHatchedModeBeforeHatchProperties )
358{
359 BOARD board;
360 ZONE source( &board );
361 ZONE target( &board );
362
363 source.SetLayer( F_Cu );
364 target.SetLayer( F_Cu );
366 source.SetHatchThickness( 500000 );
368 target.SetHatchThickness( 200000 );
369
371 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "zone/Fill Mode" ), wxS( "zone/Hatch Width" ) } );
372
373 BOOST_CHECK( result );
374 BOOST_CHECK( target.GetFillMode() == ZONE_FILL_MODE::HATCH_PATTERN );
375 BOOST_CHECK_EQUAL( target.GetHatchThickness(), 500000 );
376 BOOST_CHECK_EQUAL( result.m_Changed, 2 );
377}
378
379
380BOOST_AUTO_TEST_CASE( CopyZonePropertiesFromSolidModeSkipsUnavailableHatchProperties )
381{
382 BOARD board;
383 ZONE source( &board );
384 ZONE target( &board );
385
386 source.SetLayer( F_Cu );
387 target.SetLayer( F_Cu );
389 source.SetHatchThickness( 500000 );
391 target.SetHatchThickness( 200000 );
392
394 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "zone/Fill Mode" ), wxS( "zone/Hatch Width" ) } );
395
396 BOOST_CHECK( result );
397 BOOST_CHECK( target.GetFillMode() == ZONE_FILL_MODE::POLYGONS );
398 BOOST_CHECK_EQUAL( target.GetHatchThickness(), 200000 );
399 BOOST_CHECK_EQUAL( result.m_Changed, 1 );
400}
401
402
403BOOST_AUTO_TEST_CASE( CoupledPropertiesValidateAgainstFinalState )
404{
405 PCB_VIA source( nullptr );
406 PCB_VIA target( nullptr );
407
408 source.SetWidth( PADSTACK::ALL_LAYERS, 400000 );
409 source.SetDrill( 200000 );
410 target.SetWidth( PADSTACK::ALL_LAYERS, 600000 );
411 target.SetDrill( 500000 );
412
414 MATCH_PROPERTIES_CATALOG::Copy( source, target, { wxS( "via/Diameter" ), wxS( "via/Hole" ) } );
415
416 BOOST_CHECK( result );
418 BOOST_CHECK_EQUAL( target.GetDrillValue(), 200000 );
419}
420
421
422// The catalog comes from the copyable flag. A family with nothing flagged is a missed
423// registration, not a family with nothing to copy.
424BOOST_AUTO_TEST_CASE( EveryFamilyAdvertisesSomething )
425{
426 std::set<wxString> advertised;
427
428 for( const wxString& key : MATCH_PROPERTIES_CATALOG::AllSafeKeys() )
429 {
430 // A family whose every property is shared has no key of its own left.
431 for( const wxString& family : MATCH_PROPERTIES_CATALOG::FamiliesFor( key ) )
432 advertised.insert( family );
433 }
434
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" ) } )
439 {
440 BOOST_CHECK_MESSAGE( advertised.contains( family ), "Nothing copyable for family: " << family );
441 }
442}
443
444
445// Zones and rule areas share one item type. Only the availability funcs split their keys.
446BOOST_AUTO_TEST_CASE( ZoneAndRuleAreaKeysDoNotOverlap )
447{
448 const std::set<wxString>& keys = MATCH_PROPERTIES_CATALOG::AllSafeKeys();
449
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" ) ) );
454}
455
456
457// Nothing that moves, renames or rewires an item may be copyable.
458BOOST_AUTO_TEST_CASE( CopyableFlagExcludesIdentityGeometryAndConnectivity )
459{
461
464 {
465 for( PROPERTY_BASE* property : manager.GetProperties( type ) )
466 {
467 if( !property->IsCopyable() )
468 continue;
469
470 const wxString name = property->Name();
471
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 );
477 }
478 }
479}
480
481
482// Both pairs look like one family. Zones and rule areas share a type. A cell has a table
483// parent.
484BOOST_AUTO_TEST_CASE( RelatedItemsAreNotCompatible )
485{
486 BOARD board;
487 ZONE zone( &board );
488 ZONE ruleArea( &board );
489 PCB_TABLE table( nullptr, 0 );
490 PCB_TABLECELL cell( &table );
491 ruleArea.SetIsRuleArea( true );
492
493 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::Family( ruleArea ), wxString( wxS( "rule_area" ) ) );
494 BOOST_CHECK_EQUAL( MATCH_PROPERTIES_CATALOG::Family( cell ), wxString( wxS( "table_cell" ) ) );
495 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::Compatible( zone, ruleArea ) );
496 BOOST_CHECK( !MATCH_PROPERTIES_CATALOG::Compatible( table, cell ) );
497}
498
499
const char * name
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...
Definition board_item.h:84
Information pertinent to a Pcbnew printed circuit board.
Definition board.h:409
static constexpr PCB_LAYER_ID ALL_LAYERS
! The layer identifier to use for the single defintion on normal padstacks
Definition padstack.h:179
Definition pad.h:61
A set of BOARD_ITEMs (i.e., without duplicates).
Definition pcb_group.h:51
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
Definition pcb_text.cpp:484
VECTOR2I GetTextSize() const override
Definition pcb_text.cpp:470
void SetStart(const VECTOR2I &aStart)
Definition pcb_track.h:92
const VECTOR2I & GetStart() const
Definition pcb_track.h:93
virtual void SetWidth(int aWidth)
Definition pcb_track.h:86
virtual int GetWidth() const
Definition pcb_track.h:87
void SetDrill(int aDrill)
Definition pcb_track.h:771
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.
Definition zone.h:70
void SetHatchThickness(int aThickness)
Definition zone.h:326
virtual void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition zone.cpp:641
void SetIsRuleArea(bool aEnable)
Definition zone.h:808
void SetFillMode(ZONE_FILL_MODE aFillMode)
Definition zone.cpp:647
int GetHatchThickness() const
Definition zone.h:325
ZONE_FILL_MODE GetFillMode() const
Definition zone.h:238
#define _(s)
@ In1_Cu
Definition layer_ids.h:62
@ F_Cu
Definition layer_ids.h:60
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.
#define TYPE_HASH(x)
Definition property.h:74
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
Definition vector2d.h:683