KiCad PCB EDA Suite
DRC_TEST_PROVIDER_SOLDER_MASK Class Reference
Inheritance diagram for DRC_TEST_PROVIDER_SOLDER_MASK:
DRC_TEST_PROVIDER UNITS_PROVIDER

Public Member Functions

 DRC_TEST_PROVIDER_SOLDER_MASK ()
 
virtual ~DRC_TEST_PROVIDER_SOLDER_MASK ()
 
virtual bool Run () override
 Run this provider against the given PCB with configured options (if any). More...
 
virtual const wxString GetName () const override
 
virtual const wxString GetDescription () const override
 
void SetDRCEngine (DRC_ENGINE *engine)
 
bool RunTests (EDA_UNITS aUnits)
 
EDA_UNITS GetUserUnits () const
 
void SetUserUnits (EDA_UNITS aUnits)
 
const EDA_IU_SCALEGetIuScale () const
 
wxString StringFromValue (double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
 Converts aValue in internal units into a united string. More...
 
wxString StringFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=false)
 
wxString MessageTextFromValue (double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
 A lower-precision version of StringFromValue(). More...
 
wxString MessageTextFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=true)
 
long long int ValueFromString (const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
 Converts aTextValue in aUnits to internal units used by the frame. More...
 

Static Public Member Functions

static void Init ()
 

Protected Member Functions

int forEachGeometryItem (const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
 
virtual void reportAux (wxString fmt,...)
 
virtual void reportViolation (std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
 
virtual bool reportProgress (int aCount, int aSize, int aDelta)
 
virtual bool reportPhase (const wxString &aStageName)
 
virtual void reportRuleStatistics ()
 
virtual void accountCheck (const DRC_RULE *ruleToTest)
 
virtual void accountCheck (const DRC_CONSTRAINT &constraintToTest)
 
bool isInvisibleText (const BOARD_ITEM *aItem) const
 
EDA_UNITS userUnits () const
 

Protected Attributes

DRC_ENGINEm_drcEngine
 
std::unordered_map< const DRC_RULE *, int > m_stats
 
bool m_isRuleDriven = true
 

Static Protected Attributes

static std::vector< KICAD_Ts_allBasicItems
 
static std::vector< KICAD_Ts_allBasicItemsButZones
 

Private Member Functions

void addItemToRTrees (BOARD_ITEM *aItem)
 
void buildRTrees ()
 
void testSilkToMaskClearance ()
 
void testMaskBridges ()
 
void testItemAgainstItems (BOARD_ITEM *aItem, const BOX2I &aItemBBox, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer)
 
void testMaskItemAgainstZones (BOARD_ITEM *item, const BOX2I &itemBBox, PCB_LAYER_ID refLayer, PCB_LAYER_ID targetLayer)
 
bool checkMaskAperture (BOARD_ITEM *aMaskItem, BOARD_ITEM *aTestItem, PCB_LAYER_ID aTestLayer, int aTestNet, BOARD_ITEM **aCollidingItem)
 
bool checkItemMask (BOARD_ITEM *aMaskItem, int aTestNet)
 

Private Attributes

DRC_RULE m_bridgeRule
 
BOARDm_board
 
int m_webWidth
 
int m_maxError
 
int m_largestClearance
 
std::unique_ptr< DRC_RTREEm_fullSolderMaskRTree
 
std::unique_ptr< DRC_RTREEm_itemTree
 
std::unordered_map< PTR_PTR_CACHE_KEY, LSETm_checkedPairs
 
std::unordered_map< PTR_LAYER_CACHE_KEY, std::pair< BOARD_ITEM *, int > > m_maskApertureNetMap
 
const EDA_IU_SCALEm_iuScale
 
EDA_UNITS m_userUnits
 

Detailed Description

Definition at line 46 of file drc_test_provider_solder_mask.cpp.

Constructor & Destructor Documentation

◆ DRC_TEST_PROVIDER_SOLDER_MASK()

DRC_TEST_PROVIDER_SOLDER_MASK::DRC_TEST_PROVIDER_SOLDER_MASK ( )
inline

◆ ~DRC_TEST_PROVIDER_SOLDER_MASK()

virtual DRC_TEST_PROVIDER_SOLDER_MASK::~DRC_TEST_PROVIDER_SOLDER_MASK ( )
inlinevirtual

Definition at line 58 of file drc_test_provider_solder_mask.cpp.

59 {
60 }

Member Function Documentation

◆ accountCheck() [1/2]

void DRC_TEST_PROVIDER::accountCheck ( const DRC_CONSTRAINT constraintToTest)
protectedvirtualinherited

Definition at line 127 of file drc_test_provider.cpp.

128{
129 accountCheck( constraintToTest.GetParentRule() );
130}
DRC_RULE * GetParentRule() const
Definition: drc_rule.h:143
virtual void accountCheck(const DRC_RULE *ruleToTest)

References DRC_TEST_PROVIDER::accountCheck(), and DRC_CONSTRAINT::GetParentRule().

◆ accountCheck() [2/2]

void DRC_TEST_PROVIDER::accountCheck ( const DRC_RULE ruleToTest)
protectedvirtualinherited

Definition at line 116 of file drc_test_provider.cpp.

117{
118 auto it = m_stats.find( ruleToTest );
119
120 if( it == m_stats.end() )
121 m_stats[ ruleToTest ] = 1;
122 else
123 m_stats[ ruleToTest ] += 1;
124}
std::unordered_map< const DRC_RULE *, int > m_stats

References DRC_TEST_PROVIDER::m_stats.

Referenced by DRC_TEST_PROVIDER::accountCheck(), and DRC_TEST_PROVIDER::reportViolation().

◆ addItemToRTrees()

void DRC_TEST_PROVIDER_SOLDER_MASK::addItemToRTrees ( BOARD_ITEM aItem)
private

Definition at line 112 of file drc_test_provider_solder_mask.cpp.

113{
114 ZONE* solderMask = m_board->m_SolderMask;
115
116 if( aItem->Type() == PCB_ZONE_T || aItem->Type() == PCB_FP_ZONE_T )
117 {
118 ZONE* zone = static_cast<ZONE*>( aItem );
119
120 for( PCB_LAYER_ID layer : { F_Mask, B_Mask } )
121 {
122 if( zone->IsOnLayer( layer ) )
123 {
124 solderMask->GetFill( layer )->BooleanAdd( *zone->GetFilledPolysList( layer ),
126 }
127 }
128 }
129 else if( aItem->Type() == PCB_PAD_T )
130 {
131 for( PCB_LAYER_ID layer : { F_Mask, B_Mask } )
132 {
133 if( aItem->IsOnLayer( layer ) )
134 {
135 PAD* pad = static_cast<PAD*>( aItem );
136 int clearance = ( m_webWidth / 2 ) + pad->GetSolderMaskExpansion();
137
138 aItem->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ), layer,
139 clearance, m_maxError, ERROR_OUTSIDE );
140
141 m_itemTree->Insert( aItem, layer, m_largestClearance );
142 }
143 }
144 }
145 else if( aItem->Type() == PCB_VIA_T )
146 {
147 for( PCB_LAYER_ID layer : { F_Mask, B_Mask } )
148 {
149 if( aItem->IsOnLayer( layer ) )
150 {
151 PCB_VIA* via = static_cast<PCB_VIA*>( aItem );
152 int clearance = ( m_webWidth / 2 ) + via->GetSolderMaskExpansion();
153
154 via->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ), layer,
155 clearance, m_maxError, ERROR_OUTSIDE );
156
157 m_itemTree->Insert( aItem, layer, m_largestClearance );
158 }
159 }
160 }
161 else
162 {
163 for( PCB_LAYER_ID layer : { F_Mask, B_Mask } )
164 {
165 if( aItem->IsOnLayer( layer ) )
166 {
167 aItem->TransformShapeWithClearanceToPolygon( *solderMask->GetFill( layer ),
168 layer, m_webWidth / 2, m_maxError,
170
171 m_itemTree->Insert( aItem, layer, m_largestClearance );
172 }
173 }
174 }
175}
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:232
virtual void TransformShapeWithClearanceToPolygon(SHAPE_POLY_SET &aCornerBuffer, PCB_LAYER_ID aLayer, int aClearanceValue, int aError, ERROR_LOC aErrorLoc, bool ignoreLineWidth=false) const
Convert the item shape to a closed polygon.
Definition: board_item.cpp:172
ZONE * m_SolderMask
Definition: board.h:1161
KICAD_T Type() const
Returns the type of object.
Definition: eda_item.h:97
Definition: pad.h:58
void BooleanAdd(const SHAPE_POLY_SET &b, POLYGON_MODE aFastMode)
Perform boolean polyset difference For aFastMode meaning, see function booleanOp.
Handle a list of polygons defining a copper zone.
Definition: zone.h:57
const std::shared_ptr< SHAPE_POLY_SET > & GetFilledPolysList(PCB_LAYER_ID aLayer) const
Definition: zone.h:596
SHAPE_POLY_SET * GetFill(PCB_LAYER_ID aLayer)
Definition: zone.h:602
virtual bool IsOnLayer(PCB_LAYER_ID) const override
Test to see if this object is on the given layer.
Definition: zone.cpp:303
@ ERROR_OUTSIDE
PCB_LAYER_ID
A quick note on layer IDs:
Definition: layer_ids.h:59
@ B_Mask
Definition: layer_ids.h:106
@ F_Mask
Definition: layer_ids.h:107
@ PCB_VIA_T
class PCB_VIA, a via (like a track segment on a copper layer)
Definition: typeinfo.h:102
@ PCB_ZONE_T
class ZONE, a copper pour area
Definition: typeinfo.h:112
@ PCB_FP_ZONE_T
class ZONE, managed by a footprint
Definition: typeinfo.h:100
@ PCB_PAD_T
class PAD, a pad in a footprint
Definition: typeinfo.h:87

References B_Mask, SHAPE_POLY_SET::BooleanAdd(), ERROR_OUTSIDE, F_Mask, ZONE::GetFill(), ZONE::GetFilledPolysList(), BOARD_ITEM::IsOnLayer(), ZONE::IsOnLayer(), m_board, m_itemTree, m_largestClearance, m_maxError, BOARD::m_SolderMask, m_webWidth, pad, PCB_FP_ZONE_T, PCB_PAD_T, PCB_VIA_T, PCB_ZONE_T, SHAPE_POLY_SET::PM_FAST, BOARD_ITEM::TransformShapeWithClearanceToPolygon(), EDA_ITEM::Type(), and via.

Referenced by buildRTrees().

◆ buildRTrees()

void DRC_TEST_PROVIDER_SOLDER_MASK::buildRTrees ( )
private

Definition at line 178 of file drc_test_provider_solder_mask.cpp.

179{
180 ZONE* solderMask = m_board->m_SolderMask;
181 LSET layers = { 4, F_Mask, B_Mask, F_Cu, B_Cu };
182
183 const size_t progressDelta = 500;
184 int count = 0;
185 int ii = 0;
186
187 solderMask->GetFill( F_Mask )->RemoveAllContours();
188 solderMask->GetFill( B_Mask )->RemoveAllContours();
189
190 m_fullSolderMaskRTree = std::make_unique<DRC_RTREE>();
191 m_itemTree = std::make_unique<DRC_RTREE>();
192
194 [&]( BOARD_ITEM* item ) -> bool
195 {
196 ++count;
197 return true;
198 } );
199
201 [&]( BOARD_ITEM* item ) -> bool
202 {
203 if( !reportProgress( ii++, count, progressDelta ) )
204 return false;
205
206 addItemToRTrees( item );
207 return true;
208 } );
209
212
214
215 solderMask->GetFill( F_Mask )->Deflate( m_webWidth / 2, numSegs );
216 solderMask->GetFill( B_Mask )->Deflate( m_webWidth / 2, numSegs );
217
218 solderMask->SetFillFlag( F_Mask, true );
219 solderMask->SetFillFlag( B_Mask, true );
220 solderMask->SetIsFilled( true );
221
222 solderMask->CacheTriangulation();
223
224 m_fullSolderMaskRTree->Insert( solderMask, F_Mask );
225 m_fullSolderMaskRTree->Insert( solderMask, B_Mask );
226
227 m_checkedPairs.clear();
228}
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Definition: board_item.h:50
std::unique_ptr< DRC_RTREE > m_fullSolderMaskRTree
std::unordered_map< PTR_PTR_CACHE_KEY, LSET > m_checkedPairs
int forEachGeometryItem(const std::vector< KICAD_T > &aTypes, LSET aLayers, const std::function< bool(BOARD_ITEM *)> &aFunc)
virtual bool reportProgress(int aCount, int aSize, int aDelta)
static std::vector< KICAD_T > s_allBasicItems
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:530
void Deflate(int aAmount, int aCircleSegmentsCount, CORNER_STRATEGY aCornerStrategy=ROUND_ALL_CORNERS)
void Simplify(POLYGON_MODE aFastMode)
void CacheTriangulation(PCB_LAYER_ID aLayer=UNDEFINED_LAYER)
Create a list of triangles that "fill" the solid areas used for instance to draw these solid areas on...
Definition: zone.cpp:974
void SetFillFlag(PCB_LAYER_ID aLayer, bool aFlag)
Definition: zone.h:233
void SetIsFilled(bool isFilled)
Definition: zone.h:236
static constexpr EDA_ANGLE & FULL_CIRCLE
Definition: eda_angle.h:410
int GetArcToSegmentCount(int aRadius, int aErrorMax, const EDA_ANGLE &aArcAngle)
@ B_Cu
Definition: layer_ids.h:95
@ F_Cu
Definition: layer_ids.h:64

References addItemToRTrees(), B_Cu, B_Mask, ZONE::CacheTriangulation(), SHAPE_POLY_SET::Deflate(), F_Cu, F_Mask, DRC_TEST_PROVIDER::forEachGeometryItem(), FULL_CIRCLE, GetArcToSegmentCount(), ZONE::GetFill(), m_board, m_checkedPairs, m_fullSolderMaskRTree, m_itemTree, m_maxError, BOARD::m_SolderMask, m_webWidth, SHAPE_POLY_SET::PM_STRICTLY_SIMPLE, SHAPE_POLY_SET::RemoveAllContours(), DRC_TEST_PROVIDER::reportProgress(), DRC_TEST_PROVIDER::s_allBasicItems, ZONE::SetFillFlag(), ZONE::SetIsFilled(), and SHAPE_POLY_SET::Simplify().

Referenced by Run().

◆ checkItemMask()

bool DRC_TEST_PROVIDER_SOLDER_MASK::checkItemMask ( BOARD_ITEM aMaskItem,
int  aTestNet 
)
private

Definition at line 375 of file drc_test_provider_solder_mask.cpp.

376{
377 FOOTPRINT* fp = static_cast<FOOTPRINT*>( aMaskItem->GetParentFootprint() );
378
379 if( fp && ( fp->GetAttributes() & FP_ALLOW_SOLDERMASK_BRIDGES ) > 0 )
380 {
381 // If we're allowing bridges then we're allowing bridges. Nothing to check.
382 return false;
383 }
384
385 // Graphic items are used to implement net-ties between pads of a group within a net-tie
386 // footprint. They must be allowed to intrude into their pad's mask aperture.
387 if( aTestNet < 0 && aMaskItem->Type() == PCB_PAD_T && fp->IsNetTie() )
388 {
389 std::map<wxString, int> padNumberToGroupIdxMap = fp->MapPadNumbersToNetTieGroups();
390
391 if( padNumberToGroupIdxMap[ static_cast<PAD*>( aMaskItem )->GetNumber() ] >= 0 )
392 return false;
393 }
394
395 return true;
396}
BOARD_ITEM_CONTAINER * GetParentFootprint() const
Definition: board_item.cpp:217
std::map< wxString, int > MapPadNumbersToNetTieGroups() const
Definition: footprint.cpp:2252
int GetAttributes() const
Definition: footprint.h:245
bool IsNetTie() const
Definition: footprint.h:252
const wxString & GetNumber() const
Definition: pad.h:134
@ FP_ALLOW_SOLDERMASK_BRIDGES
Definition: footprint.h:73

References FP_ALLOW_SOLDERMASK_BRIDGES, FOOTPRINT::GetAttributes(), PAD::GetNumber(), BOARD_ITEM::GetParentFootprint(), FOOTPRINT::IsNetTie(), FOOTPRINT::MapPadNumbersToNetTieGroups(), and PCB_PAD_T.

Referenced by testItemAgainstItems().

◆ checkMaskAperture()

bool DRC_TEST_PROVIDER_SOLDER_MASK::checkMaskAperture ( BOARD_ITEM aMaskItem,
BOARD_ITEM aTestItem,
PCB_LAYER_ID  aTestLayer,
int  aTestNet,
BOARD_ITEM **  aCollidingItem 
)
private

Definition at line 337 of file drc_test_provider_solder_mask.cpp.

340{
341 if( !IsCopperLayer( aTestLayer ) )
342 return false;
343
344 FOOTPRINT* fp = static_cast<FOOTPRINT*>( aMaskItem->GetParentFootprint() );
345
346 if( fp && ( fp->GetAttributes() & FP_ALLOW_SOLDERMASK_BRIDGES ) > 0 )
347 {
348 // Mask apertures in footprints which allow soldermask bridges are ignored entirely.
349 return false;
350 }
351
352 PTR_LAYER_CACHE_KEY key = { aMaskItem, aTestLayer };
353
354 auto ii = m_maskApertureNetMap.find( key );
355
356 if( ii == m_maskApertureNetMap.end() )
357 {
358 m_maskApertureNetMap[ key ] = { aTestItem, aTestNet };
359
360 // First net; no bridge yet....
361 return false;
362 }
363
364 if( ii->second.second == aTestNet && aTestNet > 0 )
365 {
366 // Same net; still no bridge...
367 return false;
368 }
369
370 *aCollidingItem = ii->second.first;
371 return true;
372}
std::unordered_map< PTR_LAYER_CACHE_KEY, std::pair< BOARD_ITEM *, int > > m_maskApertureNetMap
bool IsCopperLayer(int aLayerId)
Tests whether a layer is a copper layer.
Definition: layer_ids.h:823

References FP_ALLOW_SOLDERMASK_BRIDGES, FOOTPRINT::GetAttributes(), BOARD_ITEM::GetParentFootprint(), IsCopperLayer(), and m_maskApertureNetMap.

Referenced by testItemAgainstItems(), and testMaskItemAgainstZones().

◆ forEachGeometryItem()

int DRC_TEST_PROVIDER::forEachGeometryItem ( const std::vector< KICAD_T > &  aTypes,
LSET  aLayers,
const std::function< bool(BOARD_ITEM *)> &  aFunc 
)
protectedinherited

Definition at line 152 of file drc_test_provider.cpp.

154{
155 BOARD *brd = m_drcEngine->GetBoard();
156 std::bitset<MAX_STRUCT_TYPE_ID> typeMask;
157 int n = 0;
158
159 if( aTypes.size() == 0 )
160 {
161 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
162 typeMask[ i ] = true;
163 }
164 else
165 {
166 for( KICAD_T aType : aTypes )
167 typeMask[ aType ] = true;
168 }
169
170 for( PCB_TRACK* item : brd->Tracks() )
171 {
172 if( (item->GetLayerSet() & aLayers).any() )
173 {
174 if( typeMask[ PCB_TRACE_T ] && item->Type() == PCB_TRACE_T )
175 {
176 aFunc( item );
177 n++;
178 }
179 else if( typeMask[ PCB_VIA_T ] && item->Type() == PCB_VIA_T )
180 {
181 aFunc( item );
182 n++;
183 }
184 else if( typeMask[ PCB_ARC_T ] && item->Type() == PCB_ARC_T )
185 {
186 aFunc( item );
187 n++;
188 }
189 }
190 }
191
192 for( BOARD_ITEM* item : brd->Drawings() )
193 {
194 if( (item->GetLayerSet() & aLayers).any() )
195 {
196 if( typeMask[ PCB_DIMENSION_T ] && BaseType( item->Type() ) == PCB_DIMENSION_T )
197 {
198 if( !aFunc( item ) )
199 return n;
200
201 n++;
202 }
203 else if( typeMask[ PCB_SHAPE_T ] && item->Type() == PCB_SHAPE_T )
204 {
205 if( !aFunc( item ) )
206 return n;
207
208 n++;
209 }
210 else if( typeMask[ PCB_TEXT_T ] && item->Type() == PCB_TEXT_T )
211 {
212 if( !aFunc( item ) )
213 return n;
214
215 n++;
216 }
217 else if( typeMask[ PCB_TEXTBOX_T ] && item->Type() == PCB_TEXTBOX_T )
218 {
219 if( !aFunc( item ) )
220 return n;
221
222 n++;
223 }
224 else if( typeMask[ PCB_TARGET_T ] && item->Type() == PCB_TARGET_T )
225 {
226 if( !aFunc( item ) )
227 return n;
228
229 n++;
230 }
231 }
232 }
233
234 if( typeMask[ PCB_ZONE_T ] )
235 {
236 for( ZONE* item : brd->Zones() )
237 {
238 if( ( item->GetLayerSet() & aLayers ).any() )
239 {
240 if( !aFunc( item ) )
241 return n;
242
243 n++;
244 }
245 }
246 }
247
248 for( FOOTPRINT* footprint : brd->Footprints() )
249 {
250 if( typeMask[ PCB_FP_TEXT_T ] )
251 {
252 if( ( footprint->Reference().GetLayerSet() & aLayers ).any() )
253 {
254 if( !aFunc( &footprint->Reference() ) )
255 return n;
256
257 n++;
258 }
259
260 if( ( footprint->Value().GetLayerSet() & aLayers ).any() )
261 {
262 if( !aFunc( &footprint->Value() ) )
263 return n;
264
265 n++;
266 }
267 }
268
269 if( typeMask[ PCB_PAD_T ] )
270 {
271 for( PAD* pad : footprint->Pads() )
272 {
273 // Careful: if a pad has a hole then it pierces all layers
274 if( pad->HasHole() || ( pad->GetLayerSet() & aLayers ).any() )
275 {
276 if( !aFunc( pad ) )
277 return n;
278
279 n++;
280 }
281 }
282 }
283
284 for( BOARD_ITEM* dwg : footprint->GraphicalItems() )
285 {
286 if( (dwg->GetLayerSet() & aLayers).any() )
287 {
288 if( typeMask[ PCB_DIMENSION_T ] && BaseType( dwg->Type() ) == PCB_DIMENSION_T )
289 {
290 if( !aFunc( dwg ) )
291 return n;
292
293 n++;
294 }
295 else if( typeMask[ PCB_FP_TEXT_T ] && dwg->Type() == PCB_FP_TEXT_T )
296 {
297 if( !aFunc( dwg ) )
298 return n;
299
300 n++;
301 }
302 else if( typeMask[ PCB_FP_TEXTBOX_T ] && dwg->Type() == PCB_FP_TEXTBOX_T )
303 {
304 if( !aFunc( dwg ) )
305 return n;
306
307 n++;
308 }
309 else if( typeMask[ PCB_FP_SHAPE_T ] && dwg->Type() == PCB_FP_SHAPE_T )
310 {
311 if( !aFunc( dwg ) )
312 return n;
313
314 n++;
315 }
316 }
317 }
318
319 if( typeMask[ PCB_FP_ZONE_T ] )
320 {
321 for( ZONE* zone : footprint->Zones() )
322 {
323 if( (zone->GetLayerSet() & aLayers).any() )
324 {
325 if( !aFunc( zone ) )
326 return n;
327
328 n++;
329 }
330 }
331 }
332
333 if( typeMask[ PCB_FOOTPRINT_T ] )
334 {
335 if( !aFunc( footprint ) )
336 return n;
337
338 n++;
339 }
340 }
341
342 return n;
343}
Information pertinent to a Pcbnew printed circuit board.
Definition: board.h:265
ZONES & Zones()
Definition: board.h:313
FOOTPRINTS & Footprints()
Definition: board.h:307
TRACKS & Tracks()
Definition: board.h:304
DRAWINGS & Drawings()
Definition: board.h:310
BOARD * GetBoard() const
Definition: drc_engine.h:89
DRC_ENGINE * m_drcEngine
constexpr KICAD_T BaseType(const KICAD_T aType)
Return the underlying type of the given type.
Definition: typeinfo.h:253
KICAD_T
The set of class identification values stored in EDA_ITEM::m_structType.
Definition: typeinfo.h:78
@ PCB_SHAPE_T
class PCB_SHAPE, a segment not on copper layers
Definition: typeinfo.h:88
@ PCB_FP_SHAPE_T
class FP_SHAPE, a footprint edge
Definition: typeinfo.h:94
@ MAX_STRUCT_TYPE_ID
Definition: typeinfo.h:241
@ PCB_FP_TEXTBOX_T
class FP_TEXTBOX, wrapped text in a footprint
Definition: typeinfo.h:93
@ PCB_TEXTBOX_T
class PCB_TEXTBOX, wrapped text on a layer
Definition: typeinfo.h:91
@ PCB_TEXT_T
class PCB_TEXT, text on a layer
Definition: typeinfo.h:90
@ PCB_TARGET_T
class PCB_TARGET, a target (graphic item)
Definition: typeinfo.h:111
@ PCB_FOOTPRINT_T
class FOOTPRINT, a footprint
Definition: typeinfo.h:86
@ PCB_FP_TEXT_T
class FP_TEXT, text in a footprint
Definition: typeinfo.h:92
@ PCB_ARC_T
class PCB_ARC, an arc track segment on a copper layer
Definition: typeinfo.h:103
@ PCB_DIMENSION_T
class PCB_DIMENSION_BASE: abstract dimension meta-type
Definition: typeinfo.h:105
@ PCB_TRACE_T
class PCB_TRACK, a track segment (segment on a copper layer)
Definition: typeinfo.h:101

References BaseType(), BOARD::Drawings(), BOARD::Footprints(), DRC_ENGINE::GetBoard(), DRC_TEST_PROVIDER::m_drcEngine, MAX_STRUCT_TYPE_ID, pad, PCB_ARC_T, PCB_DIMENSION_T, PCB_FOOTPRINT_T, PCB_FP_SHAPE_T, PCB_FP_TEXT_T, PCB_FP_TEXTBOX_T, PCB_FP_ZONE_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TARGET_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, BOARD::Tracks(), and BOARD::Zones().

Referenced by buildRTrees(), DRC_CACHE_GENERATOR::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), testMaskBridges(), testSilkToMaskClearance(), and DRC_TEST_PROVIDER_MISC::testTextVars().

◆ GetDescription()

virtual const wxString DRC_TEST_PROVIDER_SOLDER_MASK::GetDescription ( ) const
inlineoverridevirtual

Reimplemented from DRC_TEST_PROVIDER.

Definition at line 69 of file drc_test_provider_solder_mask.cpp.

70 {
71 return wxT( "Tests for silkscreen being clipped by solder mask and copper being exposed "
72 "by mask apertures of other nets" );
73 }

◆ GetIuScale()

const EDA_IU_SCALE & UNITS_PROVIDER::GetIuScale ( ) const
inlineinherited

◆ GetName()

virtual const wxString DRC_TEST_PROVIDER_SOLDER_MASK::GetName ( void  ) const
inlineoverridevirtual

Reimplemented from DRC_TEST_PROVIDER.

Definition at line 64 of file drc_test_provider_solder_mask.cpp.

65 {
66 return wxT( "solder_mask_issues" );
67 };

◆ GetUserUnits()

EDA_UNITS UNITS_PROVIDER::GetUserUnits ( ) const
inlineinherited

Definition at line 37 of file units_provider.h.

37{ return m_userUnits; }
EDA_UNITS m_userUnits

References UNITS_PROVIDER::m_userUnits.

Referenced by DIALOG_CONSTRAINTS_REPORTER::AddPage(), DIALOG_SHIM::DIALOG_SHIM(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), PL_EDITOR_FRAME::DisplayGridMsg(), EDA_DRAW_FRAME::DisplayUnitsMsg(), DRAWING_TOOL::drawArc(), DRAWING_TOOL::DrawDimension(), DRAWING_TOOL::drawShape(), DRAWING_TOOL::DrawSpecificationStackup(), EVT_GRID_CMD_CELL_CHANGED(), PCB_EDIT_FRAME::GenFootprintsReport(), PANEL_SETUP_TEXT_AND_GRAPHICS::getGridValue(), GERBER_DRAW_ITEM::GetMsgPanelInfo(), EDA_DRAW_FRAME::GetUnitPair(), GetUserUnits(), GERBVIEW_INSPECTION_TOOL::MeasureTool(), PCB_VIEWER_TOOLS::MeasureTool(), UNITS_PROVIDER::MessageTextFromValue(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), PANEL_SETUP_BOARD_STACKUP::onExportToClipboard(), PANEL_SETUP_TRACKS_AND_VIAS::OnSortDiffPairsClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnSortTrackWidthsClick(), PANEL_SETUP_TRACKS_AND_VIAS::OnSortViaSizesClick(), PANEL_SETUP_BOARD_STACKUP::onThicknessChange(), UNIT_BINDER::onUnitsChanged(), DIALOG_TRACK_VIA_PROPERTIES::onUnitsChanged(), DIALOG_NET_INSPECTOR::onUnitsChanged(), PANEL_FP_EDITOR_DEFAULTS::PANEL_FP_EDITOR_DEFAULTS(), PANEL_PREVIEW_3D_MODEL::PANEL_PREVIEW_3D_MODEL(), PCB_CONTROL::placeBoardItems(), POSITION_RELATIVE_TOOL::PositionRelative(), DRC_TOOL::RunTests(), SCH_EDIT_FRAME::SaveSettings(), EDA_DRAW_FRAME::SaveSettings(), PIN_TABLE_DATA_MODEL::SetValue(), FP_TEXT_GRID_TABLE::SetValue(), GERBVIEW_INSPECTION_TOOL::ShowDCodes(), UNITS_PROVIDER::StringFromValue(), COMMON_TOOLS::ToggleUnits(), EDA_DRAW_FRAME::ToggleUserUnits(), PANEL_SETUP_BOARD_STACKUP::transferDataFromUIToStackup(), PANEL_SETUP_TRACKS_AND_VIAS::TransferDataFromWindow(), UNIT_BINDER::UNIT_BINDER(), PCB_BASE_EDIT_FRAME::unitsChangeRefresh(), EDITOR_CONDITIONS::unitsFunc(), PROPERTIES_PANEL::update(), GERBVIEW_FRAME::updateDCodeSelectBox(), DIALOG_DIMENSION_PROPERTIES::updateDimensionFromDialog(), PNS_TUNE_STATUS_POPUP::UpdateStatus(), PL_EDITOR_FRAME::UpdateStatusBar(), PCB_EDIT_FRAME::UpdateViaSizeSelectBox(), DRC_TOOL::userUnits(), and UNITS_PROVIDER::ValueFromString().

◆ Init()

void DRC_TEST_PROVIDER::Init ( )
staticinherited

Definition at line 53 of file drc_test_provider.cpp.

54{
55 if( s_allBasicItems.size() == 0 )
56 {
57 for( int i = 0; i < MAX_STRUCT_TYPE_ID; i++ )
58 {
59 if( i != PCB_FOOTPRINT_T && i != PCB_GROUP_T )
60 {
61 s_allBasicItems.push_back( (KICAD_T) i );
62
63 if( i != PCB_ZONE_T && i != PCB_FP_ZONE_T )
64 s_allBasicItemsButZones.push_back( (KICAD_T) i );
65 }
66 }
67 }
68}
static std::vector< KICAD_T > s_allBasicItemsButZones
@ PCB_GROUP_T
class PCB_GROUP, a set of BOARD_ITEMs
Definition: typeinfo.h:115

References MAX_STRUCT_TYPE_ID, PCB_FOOTPRINT_T, PCB_FP_ZONE_T, PCB_GROUP_T, PCB_ZONE_T, DRC_TEST_PROVIDER::s_allBasicItems, and DRC_TEST_PROVIDER::s_allBasicItemsButZones.

Referenced by DRC_ENGINE::RunTests().

◆ isInvisibleText()

bool DRC_TEST_PROVIDER::isInvisibleText ( const BOARD_ITEM aItem) const
protectedinherited

Definition at line 346 of file drc_test_provider.cpp.

347{
348
349 if( const FP_TEXT* text = dyn_cast<const FP_TEXT*>( aItem ) )
350 {
351 if( !text->IsVisible() )
352 return true;
353 }
354
355 if( const PCB_TEXT* text = dyn_cast<const PCB_TEXT*>( aItem ) )
356 {
357 if( !text->IsVisible() )
358 return true;
359 }
360
361 return false;
362}

References text.

Referenced by DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), and testSilkToMaskClearance().

◆ MessageTextFromValue() [1/2]

wxString UNITS_PROVIDER::MessageTextFromValue ( const EDA_ANGLE aValue,
bool  aAddUnitLabel = true 
)
inlineinherited

Definition at line 82 of file units_provider.h.

83 {
85 aValue.AsDegrees(), aAddUnitLabel,
87 }
constexpr EDA_IU_SCALE unityScale
Definition: base_units.h:112
double AsDegrees() const
Definition: eda_angle.h:149
wxString MessageTextFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
A helper to convert the double length aValue to a string in inches, millimeters, or unscaled units.
Definition: eda_units.cpp:323

References EDA_ANGLE::AsDegrees(), DEGREES, DISTANCE, EDA_UNIT_UTILS::UI::MessageTextFromValue(), and unityScale.

◆ MessageTextFromValue() [2/2]

wxString UNITS_PROVIDER::MessageTextFromValue ( double  aValue,
bool  aAddUnitLabel = true,
EDA_DATA_TYPE  aType = EDA_DATA_TYPE::DISTANCE 
)
inlineinherited

A lower-precision version of StringFromValue().

Should ONLY be used for status text and messages. Not suitable for dialogs, files, etc. where the loss of precision matters.

Definition at line 75 of file units_provider.h.

77 {
79 aAddUnitLabel, aType );
80 }
const EDA_IU_SCALE & GetIuScale() const
EDA_UNITS GetUserUnits() const

References UNITS_PROVIDER::GetIuScale(), UNITS_PROVIDER::GetUserUnits(), and EDA_UNIT_UTILS::UI::MessageTextFromValue().

Referenced by DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), CheckLibSymbol(), DRC_TEST_PROVIDER_HOLE_SIZE::checkPadHole(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_HOLE_SIZE::checkViaHole(), DIALOG_BOARD_REANNOTATE::CoordTowxString(), EDA_DRAW_FRAME::DisplayGridMsg(), GERBVIEW_FRAME::DisplayGridMsg(), PCB_BASE_FRAME::DisplayGridMsg(), GERBER_FILE_IMAGE::DisplayImageInfo(), DRAWING_TOOL::DrawBoardCharacteristics(), DRC_ENGINE::EvalRules(), DIALOG_NET_INSPECTOR::formatLength(), LIB_FIELD::GetMsgPanelInfo(), LIB_PIN::GetMsgPanelInfo(), LIB_TEXT::GetMsgPanelInfo(), LIB_TEXTBOX::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), SCH_FIELD::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_TEXTBOX::GetMsgPanelInfo(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), FP_TEXT::GetMsgPanelInfo(), FP_TEXTBOX::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), PCB_BITMAP::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), STROKE_PARAMS::GetMsgPanelInfo(), FOOTPRINT_SEARCH_HANDLER::GetResultCell(), ZONE_SEARCH_HANDLER::GetResultCell(), TEXT_SEARCH_HANDLER::GetResultCell(), LIB_SHAPE::GetSelectMenuText(), SCH_LINE::GetSelectMenuText(), SCH_SHAPE::GetSelectMenuText(), DS_DRAW_ITEM_LINE::GetSelectMenuText(), DS_DRAW_ITEM_RECT::GetSelectMenuText(), PCB_TRACK::GetSelectMenuText(), DIALOG_BOARD_REANNOTATE::MakeSampleText(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_TRACK_WIDTH::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), DIALOG_BOARD_STATISTICS::saveReportClicked(), EDA_SHAPE::ShapeGetMsgPanelInfo(), showCoord(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones(), TRACK_WIDTH_MENU::update(), DIFF_PAIR_MENU::update(), VIA_SIZE_MENU::update(), BOARD_NETLIST_UPDATER::updateCopperZoneNets(), DIALOG_BOARD_STATISTICS::updateDrillGrid(), PCB_CONTROL::UpdateMessagePanel(), PL_EDITOR_FRAME::UpdateMsgPanelInfo(), SCH_BASE_FRAME::UpdateStatusBar(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and DIALOG_BOARD_STATISTICS::updateWidets().

◆ reportAux()

◆ reportPhase()

bool DRC_TEST_PROVIDER::reportPhase ( const wxString &  aStageName)
protectedvirtualinherited

◆ reportProgress()

bool DRC_TEST_PROVIDER::reportProgress ( int  aCount,
int  aSize,
int  aDelta 
)
protectedvirtualinherited

◆ reportRuleStatistics()

void DRC_TEST_PROVIDER::reportRuleStatistics ( )
protectedvirtualinherited

Definition at line 133 of file drc_test_provider.cpp.

134{
135 if( !m_isRuleDriven )
136 return;
137
138 m_drcEngine->ReportAux( wxT( "Rule hit statistics: " ) );
139
140 for( const std::pair<const DRC_RULE* const, int>& stat : m_stats )
141 {
142 if( stat.first )
143 {
144 m_drcEngine->ReportAux( wxString::Format( wxT( " - rule '%s': %d hits " ),
145 stat.first->m_Name,
146 stat.second ) );
147 }
148 }
149}
void Format(OUTPUTFORMATTER *out, int aNestLevel, int aCtl, const CPTREE &aTree)
Output a PTREE into s-expression format via an OUTPUTFORMATTER derivative.
Definition: ptree.cpp:200

References Format(), DRC_TEST_PROVIDER::m_drcEngine, DRC_TEST_PROVIDER::m_isRuleDriven, DRC_TEST_PROVIDER::m_stats, and DRC_ENGINE::ReportAux().

Referenced by DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_HOLE_SIZE::Run(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run(), Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_TRACK_WIDTH::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), and DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal().

◆ reportViolation()

void DRC_TEST_PROVIDER::reportViolation ( std::shared_ptr< DRC_ITEM > &  item,
const VECTOR2I aMarkerPos,
int  aMarkerLayer 
)
protectedvirtualinherited

Definition at line 75 of file drc_test_provider.cpp.

77{
78 if( item->GetViolatingRule() )
79 accountCheck( item->GetViolatingRule() );
80
81 item->SetViolatingTest( this );
82 m_drcEngine->ReportViolation( item, aMarkerPos, aMarkerLayer );
83}
void ReportViolation(const std::shared_ptr< DRC_ITEM > &aItem, const VECTOR2I &aPos, int aMarkerLayer)

References DRC_TEST_PROVIDER::accountCheck(), DRC_TEST_PROVIDER::m_drcEngine, and DRC_ENGINE::ReportViolation().

Referenced by DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), DRC_TEST_PROVIDER_HOLE_SIZE::checkPadHole(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts(), DRC_TEST_PROVIDER_HOLE_SIZE::checkViaHole(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_FOOTPRINT_CHECKS::Run(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_TRACK_WIDTH::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), testItemAgainstItems(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), testMaskItemAgainstZones(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist(), DRC_TEST_PROVIDER_MISC::testOutline(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_MISC::testTextVars(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ Run()

bool DRC_TEST_PROVIDER_SOLDER_MASK::Run ( )
overridevirtual

Run this provider against the given PCB with configured options (if any).

Implements DRC_TEST_PROVIDER.

Definition at line 695 of file drc_test_provider_solder_mask.cpp.

696{
699 {
700 reportAux( wxT( "Solder mask violations ignored. Tests not run." ) );
701 return true; // continue with other tests
702 }
703
708
709 for( FOOTPRINT* footprint : m_board->Footprints() )
710 {
711 for( PAD* pad : footprint->Pads() )
712 m_largestClearance = std::max( m_largestClearance, pad->GetSolderMaskExpansion() );
713 }
714
715 // Order is important here: m_webWidth must be added in before m_largestCourtyardClearance is
716 // maxed with the various SILK_CLEARANCE_CONSTRAINTS.
718
719 DRC_CONSTRAINT worstClearanceConstraint;
720
721 if( m_drcEngine->QueryWorstConstraint( SILK_CLEARANCE_CONSTRAINT, worstClearanceConstraint ) )
722 m_largestClearance = std::max( m_largestClearance, worstClearanceConstraint.m_Value.Min() );
723
724 reportAux( wxT( "Worst clearance : %d nm" ), m_largestClearance );
725
726 if( !reportPhase( _( "Building solder mask..." ) ) )
727 return false; // DRC cancelled
728
729 m_checkedPairs.clear();
730 m_maskApertureNetMap.clear();
731
732 buildRTrees();
733
734 if( !reportPhase( _( "Checking solder mask to silk clearance..." ) ) )
735 return false; // DRC cancelled
736
738
739 if( !reportPhase( _( "Checking solder mask web integrity..." ) ) )
740 return false; // DRC cancelled
741
743
745
746 return !m_drcEngine->IsCancelled();
747}
BOARD_DESIGN_SETTINGS & GetDesignSettings() const
Definition: board.cpp:618
MINOPTMAX< int > m_Value
Definition: drc_rule.h:170
bool IsErrorLimitExceeded(int error_code)
bool IsCancelled() const
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
virtual bool reportPhase(const wxString &aStageName)
virtual void reportRuleStatistics()
T Min() const
Definition: minoptmax.h:33
@ DRCE_SOLDERMASK_BRIDGE
Definition: drc_item.h:85
@ DRCE_SILK_CLEARANCE
Definition: drc_item.h:88
@ SILK_CLEARANCE_CONSTRAINT
Definition: drc_rule.h:52

References _, buildRTrees(), DRCE_SILK_CLEARANCE, DRCE_SOLDERMASK_BRIDGE, BOARD::Footprints(), DRC_ENGINE::GetBoard(), BOARD::GetDesignSettings(), DRC_ENGINE::IsCancelled(), DRC_ENGINE::IsErrorLimitExceeded(), m_board, m_checkedPairs, DRC_TEST_PROVIDER::m_drcEngine, m_largestClearance, m_maskApertureNetMap, BOARD_DESIGN_SETTINGS::m_MaxError, m_maxError, BOARD_DESIGN_SETTINGS::m_SolderMaskMinWidth, DRC_CONSTRAINT::m_Value, m_webWidth, MINOPTMAX< T >::Min(), pad, DRC_ENGINE::QueryWorstConstraint(), DRC_TEST_PROVIDER::reportAux(), DRC_TEST_PROVIDER::reportPhase(), DRC_TEST_PROVIDER::reportRuleStatistics(), SILK_CLEARANCE_CONSTRAINT, testMaskBridges(), and testSilkToMaskClearance().

◆ RunTests()

bool DRC_TEST_PROVIDER::RunTests ( EDA_UNITS  aUnits)
inlineinherited

Definition at line 86 of file drc_test_provider.h.

87 {
88 SetUserUnits( aUnits );
89 return Run();
90 }
virtual bool Run()=0
Run this provider against the given PCB with configured options (if any).
void SetUserUnits(EDA_UNITS aUnits)

References DRC_TEST_PROVIDER::Run(), and UNITS_PROVIDER::SetUserUnits().

◆ SetDRCEngine()

void DRC_TEST_PROVIDER::SetDRCEngine ( DRC_ENGINE engine)
inlineinherited

Definition at line 80 of file drc_test_provider.h.

81 {
82 m_drcEngine = engine;
83 m_stats.clear();
84 }

References DRC_TEST_PROVIDER::m_drcEngine, and DRC_TEST_PROVIDER::m_stats.

Referenced by EDIT_TOOL::doMoveSelection(), and DRC_ENGINE::RunTests().

◆ SetUserUnits()

◆ StringFromValue() [1/2]

wxString UNITS_PROVIDER::StringFromValue ( const EDA_ANGLE aValue,
bool  aAddUnitLabel = false 
)
inlineinherited

Definition at line 62 of file units_provider.h.

63 {
65 aValue.AsDegrees(), aAddUnitLabel,
67 }
wxString StringFromValue(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, double aValue, bool aAddUnitsText=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Returns the string from aValue according to aUnits (inch, mm ...) for display.
Definition: eda_units.cpp:233

References EDA_ANGLE::AsDegrees(), DEGREES, DISTANCE, EDA_UNIT_UTILS::UI::StringFromValue(), and unityScale.

◆ StringFromValue() [2/2]

wxString UNITS_PROVIDER::StringFromValue ( double  aValue,
bool  aAddUnitLabel = false,
EDA_DATA_TYPE  aType = EDA_DATA_TYPE::DISTANCE 
)
inlineinherited

Converts aValue in internal units into a united string.

For readability, trailing 0s are removed if the mantissa has 3 or more digits. This function should be used to display values in dialogs because a value entered in mm (for instance 2.0 mm) could need up to 8 digits mantissa if displayed in inch to avoid truncation or rounding made just by the printf function.

Parameters
aValue= value in internal units
aAddUnitLabel= true to add symbol unit to the string value
Returns
A wxString object containing value and optionally the symbol unit (like 2.000 mm)

Definition at line 55 of file units_provider.h.

57 {
59 aAddUnitLabel, aType );
60 }

References UNITS_PROVIDER::GetIuScale(), UNITS_PROVIDER::GetUserUnits(), and EDA_UNIT_UTILS::UI::StringFromValue().

Referenced by PANEL_SETUP_TRACKS_AND_VIAS::AppendDiffPairs(), PANEL_SETUP_TRACKS_AND_VIAS::AppendTrackWidth(), PANEL_SETUP_TRACKS_AND_VIAS::AppendViaSize(), DIALOG_PLOT::applyPlotSettings(), DIALOG_GLOBAL_EDIT_TRACKS_AND_VIAS::buildNetclassesGrid(), PANEL_SETUP_BOARD_STACKUP::computeBoardThickness(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), PANEL_SETUP_BOARD_STACKUP::createRowData(), DIALOG_TRACK_VIA_PROPERTIES::DIALOG_TRACK_VIA_PROPERTIES(), DRAWING_TOOL::DrawSpecificationStackup(), PIN_TABLE_DATA_MODEL::GetValue(), FP_TEXT_GRID_TABLE::GetValue(), BOARD_INSPECTION_TOOL::InspectClearance(), BOARD_INSPECTION_TOOL::InspectDRCError(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), DIALOG_TRACK_VIA_PROPERTIES::onUnitsChanged(), reportMax(), reportMin(), reportOpt(), PANEL_SETUP_BOARD_STACKUP::setDefaultLayerWidths(), PANEL_SETUP_BOARD_STACKUP::synchronizeWithBoard(), DIALOG_GRID_SETTINGS::TransferDataFromWindow(), PANEL_SETUP_NETCLASSES::TransferDataToWindow(), DIALOG_PAD_PRIMITIVE_POLY_PROPS::TransferDataToWindow(), and PANEL_SETUP_CONSTRAINTS::TransferDataToWindow().

◆ testItemAgainstItems()

void DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems ( BOARD_ITEM aItem,
const BOX2I aItemBBox,
PCB_LAYER_ID  aRefLayer,
PCB_LAYER_ID  aTargetLayer 
)
private

Definition at line 399 of file drc_test_provider_solder_mask.cpp.

402{
403 int itemNet = -1;
404
405 if( aItem->IsConnected() )
406 itemNet = static_cast<BOARD_CONNECTED_ITEM*>( aItem )->GetNetCode();
407
409 PAD* pad = dynamic_cast<PAD*>( aItem );
410 PCB_VIA* via = dynamic_cast<PCB_VIA*>( aItem );
411 std::shared_ptr<SHAPE> itemShape = aItem->GetEffectiveShape( aRefLayer );
412
413 m_itemTree->QueryColliding( aItem, aRefLayer, aTargetLayer,
414 // Filter:
415 [&]( BOARD_ITEM* other ) -> bool
416 {
417 FOOTPRINT* itemFP = static_cast<FOOTPRINT*>( aItem->GetParentFootprint() );
418 PAD* otherPad = dynamic_cast<PAD*>( other );
419 int otherNet = -1;
420
421 if( other->IsConnected() )
422 otherNet = static_cast<BOARD_CONNECTED_ITEM*>( other )->GetNetCode();
423
424 if( otherNet > 0 && otherNet == itemNet )
425 return false;
426
427 if( isNullAperture( other ) )
428 return false;
429
430 if( itemFP && itemFP == other->GetParentFootprint() )
431 {
432 // Board-wide exclusion
434 return false;
435
436 // Footprint-specific exclusion
437 if( ( itemFP->GetAttributes() & FP_ALLOW_SOLDERMASK_BRIDGES ) > 0 )
438 return false;
439 }
440
441 if( pad && otherPad && pad->SameLogicalPadAs( otherPad ) )
442 {
443 return false;
444 }
445
446 BOARD_ITEM* a = aItem;
447 BOARD_ITEM* b = other;
448
449 // store canonical order so we don't collide in both directions (a:b and b:a)
450 if( static_cast<void*>( a ) > static_cast<void*>( b ) )
451 std::swap( a, b );
452
453 auto it = m_checkedPairs.find( { a, b } );
454
455 if( it != m_checkedPairs.end() && it->second.test( aTargetLayer ) )
456 {
457 return false;
458 }
459 else
460 {
461 m_checkedPairs[ { a, b } ].set( aTargetLayer );
462 return true;
463 }
464 },
465 // Visitor:
466 [&]( BOARD_ITEM* other ) -> bool
467 {
468 PAD* otherPad = dynamic_cast<PAD*>( other );
469 PCB_VIA* otherVia = dynamic_cast<PCB_VIA*>( other );
470 auto otherShape = other->GetEffectiveShape( aTargetLayer );
471 int otherNet = -1;
472
473 if( other->IsConnected() )
474 otherNet = static_cast<BOARD_CONNECTED_ITEM*>( other )->GetNetCode();
475
476 int actual;
477 VECTOR2I pos;
478 int clearance = 0;
479
480 if( aRefLayer == F_Mask || aRefLayer == B_Mask )
481 {
482 // Aperture-to-aperture must enforce web-min-width
483 clearance = m_webWidth;
484 }
485 else // ( aRefLayer == F_Cu || aRefLayer == B_Cu )
486 {
487 // Copper-to-aperture uses the solder-mask-to-copper-clearance
489 }
490
491 if( pad )
492 clearance += pad->GetSolderMaskExpansion();
493 else if( via )
494 clearance += via->GetSolderMaskExpansion();
495
496 if( otherPad )
497 clearance += otherPad->GetSolderMaskExpansion();
498 else if( otherVia )
499 clearance += otherVia->GetSolderMaskExpansion();
500
501 if( itemShape->Collide( otherShape.get(), clearance, &actual, &pos ) )
502 {
503 wxString msg;
504 BOARD_ITEM* colliding = nullptr;
505
506 if( aTargetLayer == F_Mask )
507 msg = _( "Front solder mask aperture bridges items with different nets" );
508 else
509 msg = _( "Rear solder mask aperture bridges items with different nets" );
510
511 // Simple mask apertures aren't associated with copper items, so they only
512 // constitute a bridge when they expose other copper items having at least
513 // two distinct nets.
514 if( isMaskAperture( aItem ) )
515 {
516 if( checkMaskAperture( aItem, other, aRefLayer, otherNet, &colliding ) )
517 {
519
520 drce->SetErrorMessage( msg );
521 drce->SetItems( aItem, colliding, other );
522 drce->SetViolatingRule( &m_bridgeRule );
523 reportViolation( drce, pos, aTargetLayer );
524 }
525 }
526 else if( isMaskAperture( other ) )
527 {
528 if( checkMaskAperture( other, aItem, aRefLayer, itemNet, &colliding ) )
529 {
531
532 drce->SetErrorMessage( msg );
533 drce->SetItems( other, colliding, aItem );
534 drce->SetViolatingRule( &m_bridgeRule );
535 reportViolation( drce, pos, aTargetLayer );
536 }
537 }
538 else if( checkItemMask( other, itemNet ) )
539 {
541
542 drce->SetErrorMessage( msg );
543 drce->SetItems( aItem, other );
544 drce->SetViolatingRule( &m_bridgeRule );
545 reportViolation( drce, pos, aTargetLayer );
546 }
547 }
548
549 return !m_drcEngine->IsCancelled();
550 },
552}
A base class derived from BOARD_ITEM for items that can be connected and have a net,...
Container for design settings for a BOARD object.
virtual bool IsConnected() const
Returns information if the object is derived from BOARD_CONNECTED_ITEM.
Definition: board_item.h:105
virtual std::shared_ptr< SHAPE > GetEffectiveShape(PCB_LAYER_ID aLayer=UNDEFINED_LAYER, FLASHING aFlash=FLASHING::DEFAULT) const
Some pad shapes can be complex (rounded/chamfered rectangle), even without considering custom shapes.
Definition: board_item.cpp:197
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
Definition: board_item.cpp:37
static std::shared_ptr< DRC_ITEM > Create(int aErrorCode)
Constructs a DRC_ITEM for the given error code.
Definition: drc_item.cpp:325
bool checkMaskAperture(BOARD_ITEM *aMaskItem, BOARD_ITEM *aTestItem, PCB_LAYER_ID aTestLayer, int aTestNet, BOARD_ITEM **aCollidingItem)
bool checkItemMask(BOARD_ITEM *aMaskItem, int aTestNet)
virtual void reportViolation(std::shared_ptr< DRC_ITEM > &item, const VECTOR2I &aMarkerPos, int aMarkerLayer)
int GetSolderMaskExpansion() const
Definition: pad.cpp:812
int GetSolderMaskExpansion() const
Definition: pcb_track.cpp:438
bool isMaskAperture(BOARD_ITEM *aItem)
bool isNullAperture(BOARD_ITEM *aItem)

References _, B_Mask, checkItemMask(), checkMaskAperture(), DRC_ITEM::Create(), DRCE_SOLDERMASK_BRIDGE, F_Mask, FP_ALLOW_SOLDERMASK_BRIDGES, FOOTPRINT::GetAttributes(), BOARD_ITEM::GetBoard(), BOARD::GetDesignSettings(), BOARD_ITEM::GetEffectiveShape(), BOARD_CONNECTED_ITEM::GetNetCode(), BOARD_ITEM::GetParentFootprint(), PAD::GetSolderMaskExpansion(), PCB_VIA::GetSolderMaskExpansion(), DRC_ENGINE::IsCancelled(), BOARD_ITEM::IsConnected(), isMaskAperture(), isNullAperture(), BOARD_DESIGN_SETTINGS::m_AllowSoldermaskBridgesInFPs, m_board, m_bridgeRule, m_checkedPairs, DRC_TEST_PROVIDER::m_drcEngine, m_itemTree, m_largestClearance, BOARD_DESIGN_SETTINGS::m_SolderMaskToCopperClearance, m_webWidth, pad, DRC_TEST_PROVIDER::reportViolation(), and via.

Referenced by testMaskBridges().

◆ testMaskBridges()

void DRC_TEST_PROVIDER_SOLDER_MASK::testMaskBridges ( )
private

Definition at line 636 of file drc_test_provider_solder_mask.cpp.

637{
638 LSET copperAndMaskLayers = { 4, F_Mask, B_Mask, F_Cu, B_Cu };
639
640 const size_t progressDelta = 250;
641 int count = 0;
642 int ii = 0;
643
644 forEachGeometryItem( s_allBasicItemsButZones, copperAndMaskLayers,
645 [&]( BOARD_ITEM* item ) -> bool
646 {
647 ++count;
648 return true;
649 } );
650
651 forEachGeometryItem( s_allBasicItemsButZones, copperAndMaskLayers,
652 [&]( BOARD_ITEM* item ) -> bool
653 {
655 return false;
656
657 if( !reportProgress( ii++, count, progressDelta ) )
658 return false;
659
660 BOX2I itemBBox = item->GetBoundingBox();
661
662 if( item->IsOnLayer( F_Mask ) && !isNullAperture( item ) )
663 {
664 // Test for aperture-to-aperture collisions
665 testItemAgainstItems( item, itemBBox, F_Mask, F_Mask );
666
667 // Test for aperture-to-zone collisions
668 testMaskItemAgainstZones( item, itemBBox, F_Mask, F_Cu );
669 }
670 else if( item->IsOnLayer( F_Cu ) )
671 {
672 // Test for copper-item-to-aperture collisions
673 testItemAgainstItems( item, itemBBox, F_Cu, F_Mask );
674 }
675
676 if( item->IsOnLayer( B_Mask ) && !isNullAperture( item ) )
677 {
678 // Test for aperture-to-aperture collisions
679 testItemAgainstItems( item, itemBBox, B_Mask, B_Mask );
680
681 // Test for aperture-to-zone collisions
682 testMaskItemAgainstZones( item, itemBBox, B_Mask, B_Cu );
683 }
684 else if( item->IsOnLayer( B_Cu ) )
685 {
686 // Test for copper-item-to-aperture collisions
687 testItemAgainstItems( item, itemBBox, B_Cu, B_Mask );
688 }
689
690 return true;
691 } );
692}
void testMaskItemAgainstZones(BOARD_ITEM *item, const BOX2I &itemBBox, PCB_LAYER_ID refLayer, PCB_LAYER_ID targetLayer)
void testItemAgainstItems(BOARD_ITEM *aItem, const BOX2I &aItemBBox, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer)
virtual const BOX2I GetBoundingBox() const
Return the orthogonal bounding box of this object for display purposes.
Definition: eda_item.cpp:74

References B_Cu, B_Mask, DRCE_SOLDERMASK_BRIDGE, F_Cu, F_Mask, DRC_TEST_PROVIDER::forEachGeometryItem(), EDA_ITEM::GetBoundingBox(), DRC_ENGINE::IsErrorLimitExceeded(), isNullAperture(), BOARD_ITEM::IsOnLayer(), DRC_TEST_PROVIDER::m_drcEngine, DRC_TEST_PROVIDER::reportProgress(), DRC_TEST_PROVIDER::s_allBasicItemsButZones, testItemAgainstItems(), and testMaskItemAgainstZones().

Referenced by Run().

◆ testMaskItemAgainstZones()

void DRC_TEST_PROVIDER_SOLDER_MASK::testMaskItemAgainstZones ( BOARD_ITEM item,
const BOX2I itemBBox,
PCB_LAYER_ID  refLayer,
PCB_LAYER_ID  targetLayer 
)
private

Definition at line 555 of file drc_test_provider_solder_mask.cpp.

559{
560 for( ZONE* zone : m_board->m_DRCCopperZones )
561 {
562 if( !zone->GetLayerSet().test( aTargetLayer ) )
563 continue;
564
565 int zoneNet = zone->GetNetCode();
566
567 if( aItem->IsConnected() )
568 {
569 BOARD_CONNECTED_ITEM* connectedItem = static_cast<BOARD_CONNECTED_ITEM*>( aItem );
570
571 if( zoneNet == connectedItem->GetNetCode() && zoneNet > 0 )
572 continue;
573 }
574
575 BOX2I inflatedBBox( aItemBBox );
577
578 if( aItem->Type() == PCB_PAD_T )
579 clearance += static_cast<PAD*>( aItem )->GetSolderMaskExpansion();
580 else if( aItem->Type() == PCB_VIA_T )
581 clearance += static_cast<PCB_VIA*>( aItem )->GetSolderMaskExpansion();
582
583 inflatedBBox.Inflate( clearance );
584
585 if( !inflatedBBox.Intersects( zone->GetBoundingBox() ) )
586 continue;
587
588 DRC_RTREE* zoneTree = m_board->m_CopperZoneRTreeCache[ zone ].get();
589 int actual;
590 VECTOR2I pos;
591
592 std::shared_ptr<SHAPE> itemShape = aItem->GetEffectiveShape( aMaskLayer );
593
594 if( zoneTree && zoneTree->QueryColliding( aItemBBox, itemShape.get(), aTargetLayer,
595 clearance, &actual, &pos ) )
596 {
597 wxString msg;
598 BOARD_ITEM* colliding = nullptr;
599
600 if( aMaskLayer == F_Mask )
601 msg = _( "Front solder mask aperture bridges items with different nets" );
602 else
603 msg = _( "Rear solder mask aperture bridges items with different nets" );
604
605 // Simple mask apertures aren't associated with copper items, so they only constitute
606 // a bridge when they expose other copper items having at least two distinct nets.
607 if( isMaskAperture( aItem ) && zoneNet >= 0 )
608 {
609 if( checkMaskAperture( aItem, zone, aTargetLayer, zoneNet, &colliding ) )
610 {
612
613 drce->SetErrorMessage( msg );
614 drce->SetItems( aItem, colliding, zone );
615 drce->SetViolatingRule( &m_bridgeRule );
616 reportViolation( drce, pos, aTargetLayer );
617 }
618 }
619 else
620 {
622
623 drce->SetErrorMessage( msg );
624 drce->SetItems( aItem, zone );
625 drce->SetViolatingRule( &m_bridgeRule );
626 reportViolation( drce, pos, aTargetLayer );
627 }
628 }
629
630 if( m_drcEngine->IsCancelled() )
631 return;
632 }
633}
std::vector< ZONE * > m_DRCCopperZones
Definition: board.h:1158
std::unordered_map< ZONE *, std::unique_ptr< DRC_RTREE > > m_CopperZoneRTreeCache
Definition: board.h:1152
Implement an R-tree for fast spatial and layer indexing of connectable items.
Definition: drc_rtree.h:48
int QueryColliding(BOARD_ITEM *aRefItem, PCB_LAYER_ID aRefLayer, PCB_LAYER_ID aTargetLayer, std::function< bool(BOARD_ITEM *)> aFilter=nullptr, std::function< bool(BOARD_ITEM *)> aVisitor=nullptr, int aClearance=0) const
This is a fast test which essentially does bounding-box overlap given a worst-case clearance.
Definition: drc_rtree.h:211
const BOX2I GetBoundingBox() const override
Definition: zone.cpp:309
virtual LSET GetLayerSet() const override
Return a std::bitset of all layers on which the item physically resides.
Definition: zone.h:115

References _, checkMaskAperture(), DRC_ITEM::Create(), DRCE_SOLDERMASK_BRIDGE, F_Mask, ZONE::GetBoundingBox(), BOARD::GetDesignSettings(), BOARD_ITEM::GetEffectiveShape(), ZONE::GetLayerSet(), BOARD_CONNECTED_ITEM::GetNetCode(), PCB_VIA::GetSolderMaskExpansion(), BOX2< Vec >::Inflate(), BOX2< Vec >::Intersects(), DRC_ENGINE::IsCancelled(), BOARD_ITEM::IsConnected(), isMaskAperture(), m_board, m_bridgeRule, BOARD::m_CopperZoneRTreeCache, BOARD::m_DRCCopperZones, DRC_TEST_PROVIDER::m_drcEngine, BOARD_DESIGN_SETTINGS::m_SolderMaskToCopperClearance, PCB_PAD_T, PCB_VIA_T, DRC_RTREE::QueryColliding(), DRC_TEST_PROVIDER::reportViolation(), and EDA_ITEM::Type().

Referenced by testMaskBridges().

◆ testSilkToMaskClearance()

void DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance ( )
private

Definition at line 231 of file drc_test_provider_solder_mask.cpp.

232{
233 LSET silkLayers = { 2, F_SilkS, B_SilkS };
234
235 const size_t progressDelta = 250;
236 int count = 0;
237 int ii = 0;
238
240 [&]( BOARD_ITEM* item ) -> bool
241 {
242 ++count;
243 return true;
244 } );
245
247 [&]( BOARD_ITEM* item ) -> bool
248 {
250 return false;
251
252 if( !reportProgress( ii++, count, progressDelta ) )
253 return false;
254
255 if( isInvisibleText( item ) )
256 return true;
257
258 for( PCB_LAYER_ID layer : silkLayers.Seq() )
259 {
260 if( !item->IsOnLayer( layer ) )
261 continue;
262
263 BOX2I itemBBox = item->GetBoundingBox();
264 DRC_CONSTRAINT constraint = m_drcEngine->EvalRules( SILK_CLEARANCE_CONSTRAINT,
265 item, nullptr, layer );
266 int clearance = constraint.GetValue().Min();
267 int actual;
268 VECTOR2I pos;
269
270 if( constraint.GetSeverity() == RPT_SEVERITY_IGNORE || clearance <= 0 )
271 return true;
272
273 std::shared_ptr<SHAPE> itemShape = item->GetEffectiveShape( layer );
274
275 if( m_fullSolderMaskRTree->QueryColliding( itemBBox, itemShape.get(), layer,
276 clearance, &actual, &pos ) )
277 {
278 auto drce = DRC_ITEM::Create( DRCE_SILK_CLEARANCE );
279 wxString msg;
280
281 msg.Printf( _( "(%s clearance %s; actual %s)" ),
282 constraint.GetName(),
283 MessageTextFromValue( clearance ),
284 MessageTextFromValue( actual ) );
285
286 drce->SetErrorMessage( drce->GetErrorText() + wxS( " " ) + msg );
287 drce->SetItems( item );
288 drce->SetViolatingRule( constraint.GetParentRule() );
289
290 reportViolation( drce, pos, layer );
291 }
292 }
293
294 return true;
295 } );
296}
bool isInvisibleText(const BOARD_ITEM *aItem) const
LSEQ Seq(const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
Return an LSEQ from the union of this LSET and a desired sequence.
Definition: lset.cpp:411
@ F_SilkS
Definition: layer_ids.h:104
@ B_SilkS
Definition: layer_ids.h:103

References B_SilkS, DRCE_SILK_CLEARANCE, F_SilkS, DRC_TEST_PROVIDER::forEachGeometryItem(), DRC_ENGINE::IsErrorLimitExceeded(), DRC_TEST_PROVIDER::isInvisibleText(), DRC_TEST_PROVIDER::m_drcEngine, DRC_TEST_PROVIDER::reportProgress(), DRC_TEST_PROVIDER::s_allBasicItems, and LSET::Seq().

Referenced by Run().

◆ userUnits()

EDA_UNITS DRC_TEST_PROVIDER::userUnits ( ) const
protectedinherited

◆ ValueFromString()

long long int UNITS_PROVIDER::ValueFromString ( const wxString &  aTextValue,
EDA_DATA_TYPE  aType = EDA_DATA_TYPE::DISTANCE 
)
inlineinherited

Converts aTextValue in aUnits to internal units used by the frame.

Warning
This utilizes the current locale and will break if decimal formats differ
Parameters
aTextValueA reference to a wxString object containing the string to convert.
Returns
internal units value

Definition at line 96 of file units_provider.h.

98 {
100 aType );
101 }
long long int ValueFromString(const EDA_IU_SCALE &aIuScale, EDA_UNITS aUnits, const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE)
Function ValueFromString converts aTextValue in aUnits to internal units used by the application.
Definition: eda_units.cpp:530

References UNITS_PROVIDER::GetIuScale(), UNITS_PROVIDER::GetUserUnits(), and EDA_UNIT_UTILS::UI::ValueFromString().

Referenced by PIN_TABLE_DATA_MODEL::compare(), PANEL_SETUP_BOARD_STACKUP::computeBoardThickness(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), PANEL_SETUP_BOARD_STACKUP::onAdjustDielectricThickness(), PANEL_SETUP_BOARD_STACKUP::onCopperLayersSelCount(), PANEL_SETUP_BOARD_STACKUP::setDefaultLayerWidths(), PANEL_SETUP_NETCLASSES::TransferDataFromWindow(), and DIALOG_GRID_SETTINGS::TransferDataToWindow().

Member Data Documentation

◆ m_board

BOARD* DRC_TEST_PROVIDER_SOLDER_MASK::m_board
private

◆ m_bridgeRule

DRC_RULE DRC_TEST_PROVIDER_SOLDER_MASK::m_bridgeRule
private

◆ m_checkedPairs

std::unordered_map<PTR_PTR_CACHE_KEY, LSET> DRC_TEST_PROVIDER_SOLDER_MASK::m_checkedPairs
private

Definition at line 103 of file drc_test_provider_solder_mask.cpp.

Referenced by buildRTrees(), Run(), and testItemAgainstItems().

◆ m_drcEngine

DRC_ENGINE* DRC_TEST_PROVIDER::m_drcEngine
protectedinherited

Definition at line 123 of file drc_test_provider.h.

Referenced by DRC_TEST_PROVIDER_HOLE_SIZE::checkPadHole(), DRC_TEST_PROVIDER_HOLE_SIZE::checkViaHole(), DRC_TEST_PROVIDER::forEachGeometryItem(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::layerDesc(), DRC_TEST_PROVIDER_SLIVER_CHECKER::layerDesc(), DRC_TEST_PROVIDER::reportAux(), DRC_TEST_PROVIDER::reportPhase(), DRC_TEST_PROVIDER::reportProgress(), DRC_TEST_PROVIDER::reportRuleStatistics(), DRC_TEST_PROVIDER::reportViolation(), DRC_CACHE_GENERATOR::Run(), DRC_TEST_PROVIDER_ANNULAR_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::Run(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_FOOTPRINT_CHECKS::Run(), DRC_TEST_PROVIDER_HOLE_SIZE::Run(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run(), DRC_TEST_PROVIDER_LIBRARY_PARITY::Run(), DRC_TEST_PROVIDER_MISC::Run(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::Run(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_SLIVER_CHECKER::Run(), Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_TRACK_WIDTH::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::Run(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE_ON_MOVE::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), DRC_TEST_PROVIDER::SetDRCEngine(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::testAgainstEdge(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_MISC::testDisabledLayers(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testFootprintCourtyardDefinitions(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::testHoleAgainstHole(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), testItemAgainstItems(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), testMaskBridges(), testMaskItemAgainstZones(), DRC_TEST_PROVIDER_SCHEMATIC_PARITY::testNetlist(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadClearances(), testSilkToMaskClearance(), DRC_TEST_PROVIDER_MISC::testTextVars(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testTrackClearances(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ m_fullSolderMaskRTree

std::unique_ptr<DRC_RTREE> DRC_TEST_PROVIDER_SOLDER_MASK::m_fullSolderMaskRTree
private

Definition at line 100 of file drc_test_provider_solder_mask.cpp.

Referenced by buildRTrees().

◆ m_isRuleDriven

◆ m_itemTree

std::unique_ptr<DRC_RTREE> DRC_TEST_PROVIDER_SOLDER_MASK::m_itemTree
private

◆ m_iuScale

const EDA_IU_SCALE& UNITS_PROVIDER::m_iuScale
privateinherited

Definition at line 104 of file units_provider.h.

Referenced by UNITS_PROVIDER::GetIuScale().

◆ m_largestClearance

int DRC_TEST_PROVIDER_SOLDER_MASK::m_largestClearance
private

Definition at line 98 of file drc_test_provider_solder_mask.cpp.

Referenced by addItemToRTrees(), Run(), and testItemAgainstItems().

◆ m_maskApertureNetMap

std::unordered_map<PTR_LAYER_CACHE_KEY, std::pair<BOARD_ITEM*, int> > DRC_TEST_PROVIDER_SOLDER_MASK::m_maskApertureNetMap
private

Definition at line 108 of file drc_test_provider_solder_mask.cpp.

Referenced by checkMaskAperture(), and Run().

◆ m_maxError

int DRC_TEST_PROVIDER_SOLDER_MASK::m_maxError
private

Definition at line 97 of file drc_test_provider_solder_mask.cpp.

Referenced by addItemToRTrees(), buildRTrees(), and Run().

◆ m_stats

std::unordered_map<const DRC_RULE*, int> DRC_TEST_PROVIDER::m_stats
protectedinherited

◆ m_userUnits

EDA_UNITS UNITS_PROVIDER::m_userUnits
privateinherited

Definition at line 105 of file units_provider.h.

Referenced by UNITS_PROVIDER::GetUserUnits(), and UNITS_PROVIDER::SetUserUnits().

◆ m_webWidth

int DRC_TEST_PROVIDER_SOLDER_MASK::m_webWidth
private

◆ s_allBasicItems

◆ s_allBasicItemsButZones

std::vector< KICAD_T > DRC_TEST_PROVIDER::s_allBasicItemsButZones
staticprotectedinherited

The documentation for this class was generated from the following file: