2007-12-10 05:42:42 +00:00
|
|
|
/*
|
2011-09-30 18:15:37 +00:00
|
|
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
2007-12-10 05:42:42 +00:00
|
|
|
*
|
|
|
|
* Copyright (C) 2007 Dick Hollenbeck, dick@softplc.com
|
2021-12-01 14:42:44 +00:00
|
|
|
* Copyright (C) 2015-2021 KiCad Developers, see change_log.txt for contributors.
|
2007-12-10 05:42:42 +00:00
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, you may find one here:
|
|
|
|
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
|
|
|
|
* or you may search the http://www.gnu.org website for the version 2 license,
|
|
|
|
* or you may write to the Free Software Foundation, Inc.,
|
|
|
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
|
|
|
*/
|
|
|
|
|
2008-05-05 19:54:21 +00:00
|
|
|
|
2020-02-24 17:23:53 +00:00
|
|
|
#include "wx/html/m_templ.h"
|
|
|
|
#include "wx/html/styleparams.h"
|
2020-03-16 11:05:01 +00:00
|
|
|
#include <drc/drc_item.h>
|
2021-08-17 14:37:33 +00:00
|
|
|
#include <drc/drc_rule.h>
|
2020-11-12 20:19:22 +00:00
|
|
|
#include <board.h>
|
2021-12-01 14:42:44 +00:00
|
|
|
#include <pcb_marker.h>
|
2011-09-23 13:57:12 +00:00
|
|
|
|
2007-12-09 12:59:06 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
// These, being statically-defined, require specialized I18N handling. We continue to
|
|
|
|
// use the _() macro so that string harvesting by the I18N framework doesn't have to be
|
|
|
|
// specialized, but we don't translate on initialization and instead do it in the getters.
|
|
|
|
|
|
|
|
#undef _
|
|
|
|
#define _(s) s
|
|
|
|
|
2020-10-13 22:03:07 +00:00
|
|
|
// NOTE: Avoid changing the settings key for a DRC item after it has been created
|
|
|
|
|
2020-12-06 18:45:05 +00:00
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::heading_electrical( 0, _( "Electrical" ), "" );
|
2021-07-11 21:47:19 +00:00
|
|
|
DRC_ITEM DRC_ITEM::heading_DFM( 0, _( "Design for Manufacturing" ), "" );
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM DRC_ITEM::heading_schematic_parity( 0, _( "Schematic Parity" ), "" );
|
|
|
|
DRC_ITEM DRC_ITEM::heading_signal_integrity( 0, _( "Signal Integrity" ), "" );
|
2021-07-11 21:47:19 +00:00
|
|
|
DRC_ITEM DRC_ITEM::heading_readability( 0, _( "Readability" ), "" );
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM DRC_ITEM::heading_misc( 0, _( "Miscellaneous" ), "" );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::unconnectedItems( DRCE_UNCONNECTED_ITEMS,
|
2021-02-04 14:06:50 +00:00
|
|
|
_( "Missing connection between items" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "unconnected_items" ) );
|
|
|
|
|
2020-07-30 20:41:52 +00:00
|
|
|
DRC_ITEM DRC_ITEM::shortingItems( DRCE_SHORTING_ITEMS,
|
|
|
|
_( "Items shorting two nets" ),
|
|
|
|
wxT( "shorting_items" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::itemsNotAllowed( DRCE_ALLOWED_ITEMS,
|
|
|
|
_( "Items not allowed" ),
|
|
|
|
wxT( "items_not_allowed" ) );
|
|
|
|
|
2021-05-24 18:53:19 +00:00
|
|
|
DRC_ITEM DRC_ITEM::textOnEdgeCuts( DRCE_TEXT_ON_EDGECUTS,
|
|
|
|
_( "Text (or dimension) on Edge.Cuts layer" ),
|
|
|
|
wxT( "text_on_edge_cuts" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::clearance( DRCE_CLEARANCE,
|
|
|
|
_( "Clearance violation" ),
|
|
|
|
wxT( "clearance" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::tracksCrossing( DRCE_TRACKS_CROSSING,
|
|
|
|
_( "Tracks crossing" ),
|
|
|
|
wxT( "tracks_crossing" ) );
|
|
|
|
|
2021-08-15 17:23:54 +00:00
|
|
|
DRC_ITEM DRC_ITEM::edgeClearance( DRCE_EDGE_CLEARANCE,
|
2020-06-08 02:19:46 +00:00
|
|
|
_( "Board edge clearance violation" ),
|
|
|
|
wxT( "copper_edge_clearance" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::zonesIntersect( DRCE_ZONES_INTERSECT,
|
2022-03-01 11:56:17 +00:00
|
|
|
_( "Copper zones intersect" ),
|
2021-08-12 16:58:30 +00:00
|
|
|
wxT( "zones_intersect" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2022-03-01 11:56:17 +00:00
|
|
|
DRC_ITEM DRC_ITEM::isolatedCopper( DRCE_ISOLATED_COPPER,
|
|
|
|
_( "Isolated copper fill" ),
|
|
|
|
wxT( "isolated_copper" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2021-08-09 10:10:09 +00:00
|
|
|
DRC_ITEM DRC_ITEM::starvedThermal( DRCE_STARVED_THERMAL,
|
|
|
|
_( "Thermal relief connection to zone incomplete" ),
|
|
|
|
wxT( "starved_thermal" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::viaDangling( DRCE_DANGLING_VIA,
|
2021-01-10 09:21:24 +00:00
|
|
|
_( "Via is not connected or connected on only one layer" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "via_dangling" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::trackDangling( DRCE_DANGLING_TRACK,
|
|
|
|
_( "Track has unconnected end" ),
|
|
|
|
wxT( "track_dangling" ) );
|
|
|
|
|
2020-09-11 15:04:11 +00:00
|
|
|
DRC_ITEM DRC_ITEM::holeClearance( DRCE_HOLE_CLEARANCE,
|
2020-10-06 12:20:29 +00:00
|
|
|
_( "Hole clearance violation" ),
|
2020-09-11 15:04:11 +00:00
|
|
|
wxT( "hole_clearance" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::holeNearHole( DRCE_DRILLED_HOLES_TOO_CLOSE,
|
|
|
|
_( "Drilled holes too close together" ),
|
|
|
|
wxT( "hole_near_hole" ) );
|
|
|
|
|
2021-05-20 09:35:31 +00:00
|
|
|
DRC_ITEM DRC_ITEM::holesCoLocated( DRCE_DRILLED_HOLES_COLOCATED,
|
|
|
|
_( "Drilled holes co-located" ),
|
|
|
|
wxT( "holes_co_located" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::trackWidth( DRCE_TRACK_WIDTH,
|
2020-09-23 10:46:41 +00:00
|
|
|
_( "Track width" ),
|
2020-06-08 02:19:46 +00:00
|
|
|
wxT( "track_width" ) );
|
|
|
|
|
2020-09-23 10:46:41 +00:00
|
|
|
DRC_ITEM DRC_ITEM::annularWidth( DRCE_ANNULAR_WIDTH,
|
|
|
|
_( "Annular width" ),
|
|
|
|
wxT( "annular_width" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2021-01-03 22:57:51 +00:00
|
|
|
DRC_ITEM DRC_ITEM::drillTooSmall( DRCE_DRILL_OUT_OF_RANGE,
|
|
|
|
_( "Drill out of range" ),
|
|
|
|
wxT( "drill_out_of_range" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2020-09-18 12:31:56 +00:00
|
|
|
DRC_ITEM DRC_ITEM::viaDiameter( DRCE_VIA_DIAMETER,
|
2020-09-23 10:46:41 +00:00
|
|
|
_( "Via diameter" ),
|
2020-09-18 12:31:56 +00:00
|
|
|
wxT( "via_diameter" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::padstack( DRCE_PADSTACK,
|
|
|
|
_( "Padstack is not valid" ),
|
|
|
|
wxT( "padstack" ) );
|
|
|
|
|
2021-01-03 22:57:51 +00:00
|
|
|
DRC_ITEM DRC_ITEM::microviaDrillTooSmall( DRCE_MICROVIA_DRILL_OUT_OF_RANGE,
|
|
|
|
_( "Micro via drill out of range" ),
|
|
|
|
wxT( "microvia_drill_out_of_range" ) );
|
2020-05-07 13:35:50 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::courtyardsOverlap( DRCE_OVERLAPPING_FOOTPRINTS,
|
|
|
|
_( "Courtyards overlap" ),
|
|
|
|
wxT( "courtyards_overlap" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::missingCourtyard( DRCE_MISSING_COURTYARD,
|
|
|
|
_( "Footprint has no courtyard defined" ),
|
|
|
|
wxT( "missing_courtyard" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::malformedCourtyard( DRCE_MALFORMED_COURTYARD,
|
|
|
|
_( "Footprint has malformed courtyard" ),
|
|
|
|
wxT( "malformed_courtyard" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::pthInsideCourtyard( DRCE_PTH_IN_COURTYARD,
|
|
|
|
_( "PTH inside courtyard" ),
|
|
|
|
wxT( "pth_inside_courtyard" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::npthInsideCourtyard( DRCE_NPTH_IN_COURTYARD,
|
|
|
|
_( "NPTH inside courtyard" ),
|
|
|
|
wxT( "npth_inside_courtyard" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::itemOnDisabledLayer( DRCE_DISABLED_LAYER_ITEM,
|
|
|
|
_( "Item on a disabled layer" ),
|
|
|
|
wxT( "item_on_disabled_layer" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::invalidOutline( DRCE_INVALID_OUTLINE,
|
|
|
|
_( "Board has malformed outline" ),
|
|
|
|
wxT( "invalid_outline" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::duplicateFootprints( DRCE_DUPLICATE_FOOTPRINT,
|
|
|
|
_( "Duplicate footprints" ),
|
|
|
|
wxT( "duplicate_footprints" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::missingFootprint( DRCE_MISSING_FOOTPRINT,
|
|
|
|
_( "Missing footprint" ),
|
|
|
|
wxT( "missing_footprint" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::extraFootprint( DRCE_EXTRA_FOOTPRINT,
|
|
|
|
_( "Extra footprint" ),
|
|
|
|
wxT( "extra_footprint" ) );
|
|
|
|
|
2020-09-04 09:32:20 +00:00
|
|
|
DRC_ITEM DRC_ITEM::netConflict( DRCE_NET_CONFLICT,
|
|
|
|
_( "Pad net doesn't match schematic" ),
|
|
|
|
wxT( "net_conflict" ) );
|
|
|
|
|
2021-07-11 11:49:36 +00:00
|
|
|
DRC_ITEM DRC_ITEM::libFootprintIssues( DRCE_LIB_FOOTPRINT_ISSUES,
|
2022-01-11 21:13:41 +00:00
|
|
|
_( "Footprint not found in libraries" ),
|
2021-07-11 11:49:36 +00:00
|
|
|
wxT( "lib_footprint_issues" ) );
|
|
|
|
|
2022-01-11 21:13:41 +00:00
|
|
|
DRC_ITEM DRC_ITEM::libFootprintMismatch( DRCE_LIB_FOOTPRINT_MISMATCH,
|
|
|
|
_( "Footprint doesn't match copy in library" ),
|
|
|
|
wxT( "lib_footprint_mismatch" ) );
|
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM DRC_ITEM::unresolvedVariable( DRCE_UNRESOLVED_VARIABLE,
|
|
|
|
_( "Unresolved text variable" ),
|
|
|
|
wxT( "unresolved_variable" ) );
|
|
|
|
|
2021-09-22 21:20:18 +00:00
|
|
|
DRC_ITEM DRC_ITEM::assertionFailure( DRCE_ASSERTION_FAILURE,
|
|
|
|
_( "Assertion failure" ),
|
|
|
|
wxT( "assertion_failure" ) );
|
|
|
|
|
2021-08-11 13:01:30 +00:00
|
|
|
DRC_ITEM DRC_ITEM::copperSliver( DRCE_COPPER_SLIVER,
|
|
|
|
_( "Copper sliver" ),
|
|
|
|
wxT( "copper_sliver" ) );
|
|
|
|
|
2021-08-12 16:58:30 +00:00
|
|
|
DRC_ITEM DRC_ITEM::solderMaskBridge( DRCE_SOLDERMASK_BRIDGE,
|
|
|
|
_( "Solder mask aperture bridges items with different nets" ),
|
|
|
|
wxT( "solder_mask_bridge" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::silkClearance( DRCE_SILK_CLEARANCE,
|
2020-10-04 11:44:22 +00:00
|
|
|
_( "Silkscreen clipped by solder mask" ),
|
|
|
|
wxT( "silk_over_copper" ) );
|
2020-09-18 14:24:09 +00:00
|
|
|
|
2022-03-14 19:49:00 +00:00
|
|
|
DRC_ITEM DRC_ITEM::silkEdgeClearance( DRCE_SILK_EDGE_CLEARANCE,
|
|
|
|
_( "Silkscreen clipped by board edge" ),
|
|
|
|
wxT( "silk_edge_clearance" ) );
|
|
|
|
|
2020-10-11 21:30:43 +00:00
|
|
|
DRC_ITEM DRC_ITEM::silkOverlaps( DRCE_OVERLAPPING_SILK,
|
2020-10-04 11:44:22 +00:00
|
|
|
_( "Silkscreen overlap" ),
|
|
|
|
wxT( "silk_overlap" ) );
|
2020-09-18 14:24:09 +00:00
|
|
|
|
2021-07-11 15:12:28 +00:00
|
|
|
DRC_ITEM DRC_ITEM::textHeightOutOfRange( DRCE_TEXT_HEIGHT,
|
|
|
|
_( "Text height out of range" ),
|
|
|
|
wxT( "text_height" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::textThicknessOutOfRange( DRCE_TEXT_THICKNESS,
|
|
|
|
_( "Text thickness out of range" ),
|
|
|
|
wxT( "text_thickness" ) );
|
|
|
|
|
2020-09-23 21:46:22 +00:00
|
|
|
DRC_ITEM DRC_ITEM::lengthOutOfRange( DRCE_LENGTH_OUT_OF_RANGE,
|
|
|
|
_( "Trace length out of range" ),
|
|
|
|
wxT( "length_out_of_range" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::skewOutOfRange( DRCE_SKEW_OUT_OF_RANGE,
|
|
|
|
_( "Skew between traces out of range" ),
|
|
|
|
wxT( "skew_out_of_range" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::tooManyVias( DRCE_TOO_MANY_VIAS,
|
|
|
|
_( "Too many vias on a connection" ),
|
|
|
|
wxT( "too_many_vias" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
|
2020-09-26 20:42:09 +00:00
|
|
|
DRC_ITEM DRC_ITEM::diffPairGapOutOfRange( DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE,
|
|
|
|
_( "Differential pair gap out of range" ),
|
|
|
|
wxT( "diff_pair_gap_out_of_range" ) );
|
|
|
|
|
|
|
|
DRC_ITEM DRC_ITEM::diffPairUncoupledLengthTooLong( DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG,
|
|
|
|
_( "Differential uncoupled length too long" ),
|
|
|
|
wxT( "diff_pair_uncoupled_length_too_long" ) );
|
|
|
|
|
2021-09-25 15:55:33 +00:00
|
|
|
DRC_ITEM DRC_ITEM::footprintTypeMismatch( DRCE_FOOTPRINT_TYPE_MISMATCH,
|
|
|
|
_( "Footprint type doesn't match footprint pads" ),
|
|
|
|
wxT( "footprint_type_mismatch" ) );
|
|
|
|
|
2021-10-19 11:24:30 +00:00
|
|
|
DRC_ITEM DRC_ITEM::footprintTHPadhasNoHole( DRCE_PAD_TH_WITH_NO_HOLE,
|
|
|
|
_( "Through hole pad has no hole" ),
|
|
|
|
wxT( "through_hole_pad_without_hole" ) );
|
|
|
|
|
2022-03-18 19:35:40 +00:00
|
|
|
DRC_ITEM DRC_ITEM::footprintOverlappingPads( DRCE_OVERLAPPING_PADS,
|
|
|
|
_( "Pads with different numbers overlap" ),
|
|
|
|
wxT( "overlapping_pads" ) );
|
|
|
|
|
2021-10-19 11:24:30 +00:00
|
|
|
|
2020-06-08 02:19:46 +00:00
|
|
|
std::vector<std::reference_wrapper<RC_ITEM>> DRC_ITEM::allItemTypes( {
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::heading_electrical,
|
2020-07-30 20:41:52 +00:00
|
|
|
DRC_ITEM::shortingItems,
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM::tracksCrossing,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::clearance,
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM::viaDangling,
|
|
|
|
DRC_ITEM::trackDangling,
|
2021-08-09 10:10:09 +00:00
|
|
|
DRC_ITEM::starvedThermal,
|
2020-12-06 18:45:05 +00:00
|
|
|
|
|
|
|
DRC_ITEM::heading_DFM,
|
2021-08-15 17:23:54 +00:00
|
|
|
DRC_ITEM::edgeClearance,
|
2020-09-11 15:04:11 +00:00
|
|
|
DRC_ITEM::holeClearance,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::holeNearHole,
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM::trackWidth,
|
2020-09-23 10:46:41 +00:00
|
|
|
DRC_ITEM::annularWidth,
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM::drillTooSmall,
|
|
|
|
DRC_ITEM::microviaDrillTooSmall,
|
|
|
|
DRC_ITEM::courtyardsOverlap,
|
|
|
|
DRC_ITEM::missingCourtyard,
|
|
|
|
DRC_ITEM::malformedCourtyard,
|
|
|
|
DRC_ITEM::invalidOutline,
|
2021-08-11 13:01:30 +00:00
|
|
|
DRC_ITEM::copperSliver,
|
2021-08-12 16:58:30 +00:00
|
|
|
DRC_ITEM::solderMaskBridge,
|
2020-12-06 18:45:05 +00:00
|
|
|
|
|
|
|
DRC_ITEM::heading_schematic_parity,
|
2020-06-08 02:19:46 +00:00
|
|
|
DRC_ITEM::duplicateFootprints,
|
|
|
|
DRC_ITEM::missingFootprint,
|
|
|
|
DRC_ITEM::extraFootprint,
|
2020-09-11 15:04:11 +00:00
|
|
|
DRC_ITEM::netConflict,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::unconnectedItems,
|
|
|
|
|
|
|
|
DRC_ITEM::heading_signal_integrity,
|
2020-09-23 21:46:22 +00:00
|
|
|
DRC_ITEM::lengthOutOfRange,
|
|
|
|
DRC_ITEM::skewOutOfRange,
|
2020-09-26 20:42:09 +00:00
|
|
|
DRC_ITEM::tooManyVias,
|
|
|
|
DRC_ITEM::diffPairGapOutOfRange,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::diffPairUncoupledLengthTooLong,
|
|
|
|
|
2021-07-11 21:47:19 +00:00
|
|
|
DRC_ITEM::heading_readability,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::silkOverlaps,
|
2021-08-12 16:58:30 +00:00
|
|
|
DRC_ITEM::silkClearance,
|
2022-03-14 19:49:00 +00:00
|
|
|
DRC_ITEM::silkEdgeClearance,
|
2021-07-11 21:47:19 +00:00
|
|
|
DRC_ITEM::textHeightOutOfRange,
|
|
|
|
DRC_ITEM::textThicknessOutOfRange,
|
|
|
|
|
|
|
|
DRC_ITEM::heading_misc,
|
|
|
|
DRC_ITEM::itemsNotAllowed,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::zonesIntersect,
|
2022-03-01 11:56:17 +00:00
|
|
|
DRC_ITEM::isolatedCopper,
|
2020-12-06 18:45:05 +00:00
|
|
|
DRC_ITEM::padstack,
|
|
|
|
DRC_ITEM::pthInsideCourtyard,
|
|
|
|
DRC_ITEM::npthInsideCourtyard,
|
|
|
|
DRC_ITEM::itemOnDisabledLayer,
|
|
|
|
DRC_ITEM::unresolvedVariable,
|
2021-09-25 15:55:33 +00:00
|
|
|
|
2021-10-19 11:24:30 +00:00
|
|
|
DRC_ITEM::footprintTypeMismatch,
|
2021-07-11 21:47:19 +00:00
|
|
|
DRC_ITEM::libFootprintIssues,
|
2022-01-11 21:13:41 +00:00
|
|
|
DRC_ITEM::libFootprintMismatch,
|
2022-03-18 19:35:40 +00:00
|
|
|
DRC_ITEM::footprintTHPadhasNoHole,
|
|
|
|
DRC_ITEM::footprintOverlappingPads
|
2020-06-08 02:19:46 +00:00
|
|
|
} );
|
|
|
|
|
|
|
|
|
2020-08-11 13:33:16 +00:00
|
|
|
std::shared_ptr<DRC_ITEM> DRC_ITEM::Create( int aErrorCode )
|
2020-05-07 13:35:50 +00:00
|
|
|
{
|
2020-06-08 02:19:46 +00:00
|
|
|
switch( aErrorCode )
|
2020-05-07 13:35:50 +00:00
|
|
|
{
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_UNCONNECTED_ITEMS: return std::make_shared<DRC_ITEM>( unconnectedItems );
|
|
|
|
case DRCE_SHORTING_ITEMS: return std::make_shared<DRC_ITEM>( shortingItems );
|
|
|
|
case DRCE_ALLOWED_ITEMS: return std::make_shared<DRC_ITEM>( itemsNotAllowed );
|
2021-05-24 18:53:19 +00:00
|
|
|
case DRCE_TEXT_ON_EDGECUTS: return std::make_shared<DRC_ITEM>( textOnEdgeCuts );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_CLEARANCE: return std::make_shared<DRC_ITEM>( clearance );
|
|
|
|
case DRCE_TRACKS_CROSSING: return std::make_shared<DRC_ITEM>( tracksCrossing );
|
2021-08-15 17:23:54 +00:00
|
|
|
case DRCE_EDGE_CLEARANCE: return std::make_shared<DRC_ITEM>( edgeClearance );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_ZONES_INTERSECT: return std::make_shared<DRC_ITEM>( zonesIntersect );
|
2022-03-01 11:56:17 +00:00
|
|
|
case DRCE_ISOLATED_COPPER: return std::make_shared<DRC_ITEM>( isolatedCopper );
|
2021-08-09 10:10:09 +00:00
|
|
|
case DRCE_STARVED_THERMAL: return std::make_shared<DRC_ITEM>( starvedThermal );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_DANGLING_VIA: return std::make_shared<DRC_ITEM>( viaDangling );
|
|
|
|
case DRCE_DANGLING_TRACK: return std::make_shared<DRC_ITEM>( trackDangling );
|
|
|
|
case DRCE_DRILLED_HOLES_TOO_CLOSE: return std::make_shared<DRC_ITEM>( holeNearHole );
|
2021-05-20 09:35:31 +00:00
|
|
|
case DRCE_DRILLED_HOLES_COLOCATED: return std::make_shared<DRC_ITEM>( holesCoLocated );
|
2020-09-11 15:04:11 +00:00
|
|
|
case DRCE_HOLE_CLEARANCE: return std::make_shared<DRC_ITEM>( holeClearance );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_TRACK_WIDTH: return std::make_shared<DRC_ITEM>( trackWidth );
|
2021-05-20 09:35:31 +00:00
|
|
|
case DRCE_ANNULAR_WIDTH: return std::make_shared<DRC_ITEM>( annularWidth );
|
|
|
|
case DRCE_DRILL_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( drillTooSmall );
|
2020-09-18 12:31:56 +00:00
|
|
|
case DRCE_VIA_DIAMETER: return std::make_shared<DRC_ITEM>( viaDiameter );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_PADSTACK: return std::make_shared<DRC_ITEM>( padstack );
|
2021-01-03 22:57:51 +00:00
|
|
|
case DRCE_MICROVIA_DRILL_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( microviaDrillTooSmall );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_OVERLAPPING_FOOTPRINTS: return std::make_shared<DRC_ITEM>( courtyardsOverlap );
|
|
|
|
case DRCE_MISSING_COURTYARD: return std::make_shared<DRC_ITEM>( missingCourtyard );
|
|
|
|
case DRCE_MALFORMED_COURTYARD: return std::make_shared<DRC_ITEM>( malformedCourtyard );
|
|
|
|
case DRCE_PTH_IN_COURTYARD: return std::make_shared<DRC_ITEM>( pthInsideCourtyard );
|
|
|
|
case DRCE_NPTH_IN_COURTYARD: return std::make_shared<DRC_ITEM>( npthInsideCourtyard );
|
|
|
|
case DRCE_DISABLED_LAYER_ITEM: return std::make_shared<DRC_ITEM>( itemOnDisabledLayer );
|
|
|
|
case DRCE_INVALID_OUTLINE: return std::make_shared<DRC_ITEM>( invalidOutline );
|
2020-08-22 14:38:32 +00:00
|
|
|
case DRCE_MISSING_FOOTPRINT: return std::make_shared<DRC_ITEM>( missingFootprint );
|
|
|
|
case DRCE_DUPLICATE_FOOTPRINT: return std::make_shared<DRC_ITEM>( duplicateFootprints );
|
2020-09-04 09:32:20 +00:00
|
|
|
case DRCE_NET_CONFLICT: return std::make_shared<DRC_ITEM>( netConflict );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_EXTRA_FOOTPRINT: return std::make_shared<DRC_ITEM>( extraFootprint );
|
2021-07-11 11:49:36 +00:00
|
|
|
case DRCE_LIB_FOOTPRINT_ISSUES: return std::make_shared<DRC_ITEM>( libFootprintIssues );
|
2022-01-11 21:13:41 +00:00
|
|
|
case DRCE_LIB_FOOTPRINT_MISMATCH: return std::make_shared<DRC_ITEM>( libFootprintMismatch );
|
2020-08-15 00:37:23 +00:00
|
|
|
case DRCE_UNRESOLVED_VARIABLE: return std::make_shared<DRC_ITEM>( unresolvedVariable );
|
2021-09-22 21:20:18 +00:00
|
|
|
case DRCE_ASSERTION_FAILURE: return std::make_shared<DRC_ITEM>( assertionFailure );
|
2021-08-11 13:01:30 +00:00
|
|
|
case DRCE_COPPER_SLIVER: return std::make_shared<DRC_ITEM>( copperSliver );
|
2020-10-11 21:30:43 +00:00
|
|
|
case DRCE_OVERLAPPING_SILK: return std::make_shared<DRC_ITEM>( silkOverlaps );
|
2021-08-12 16:58:30 +00:00
|
|
|
case DRCE_SILK_CLEARANCE: return std::make_shared<DRC_ITEM>( silkClearance );
|
2022-03-14 19:49:00 +00:00
|
|
|
case DRCE_SILK_EDGE_CLEARANCE: return std::make_shared<DRC_ITEM>( silkEdgeClearance );
|
2021-08-12 16:58:30 +00:00
|
|
|
case DRCE_SOLDERMASK_BRIDGE: return std::make_shared<DRC_ITEM>( solderMaskBridge );
|
2021-07-11 15:12:28 +00:00
|
|
|
case DRCE_TEXT_HEIGHT: return std::make_shared<DRC_ITEM>( textHeightOutOfRange );
|
|
|
|
case DRCE_TEXT_THICKNESS: return std::make_shared<DRC_ITEM>( textThicknessOutOfRange );
|
2020-09-23 21:46:22 +00:00
|
|
|
case DRCE_LENGTH_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( lengthOutOfRange );
|
|
|
|
case DRCE_SKEW_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( skewOutOfRange );
|
|
|
|
case DRCE_TOO_MANY_VIAS: return std::make_shared<DRC_ITEM>( tooManyVias );
|
2020-09-26 20:42:09 +00:00
|
|
|
case DRCE_DIFF_PAIR_GAP_OUT_OF_RANGE: return std::make_shared<DRC_ITEM>( diffPairGapOutOfRange );
|
|
|
|
case DRCE_DIFF_PAIR_UNCOUPLED_LENGTH_TOO_LONG: return std::make_shared<DRC_ITEM>( diffPairUncoupledLengthTooLong );
|
2021-09-25 15:55:33 +00:00
|
|
|
case DRCE_FOOTPRINT_TYPE_MISMATCH: return std::make_shared<DRC_ITEM>( footprintTypeMismatch );
|
2022-03-18 19:35:40 +00:00
|
|
|
case DRCE_PAD_TH_WITH_NO_HOLE: return std::make_shared<DRC_ITEM>( footprintTHPadhasNoHole );
|
|
|
|
case DRCE_OVERLAPPING_PADS: return std::make_shared<DRC_ITEM>( footprintOverlappingPads );
|
2020-06-08 02:19:46 +00:00
|
|
|
default:
|
2022-03-13 16:09:06 +00:00
|
|
|
wxFAIL_MSG( wxT( "Unknown DRC error code" ) );
|
2020-06-08 02:19:46 +00:00
|
|
|
return nullptr;
|
2020-05-07 13:35:50 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2020-08-11 13:33:16 +00:00
|
|
|
std::shared_ptr<DRC_ITEM> DRC_ITEM::Create( const wxString& aErrorKey )
|
2020-05-07 13:35:50 +00:00
|
|
|
{
|
2020-06-08 02:19:46 +00:00
|
|
|
for( const RC_ITEM& item : allItemTypes )
|
2007-12-09 12:59:06 +00:00
|
|
|
{
|
2020-06-08 02:19:46 +00:00
|
|
|
if( aErrorKey == item.GetSettingsKey() )
|
2020-08-15 00:37:23 +00:00
|
|
|
return std::make_shared<DRC_ITEM>( static_cast<const DRC_ITEM&>( item ) );
|
2007-12-09 12:59:06 +00:00
|
|
|
}
|
2020-05-07 13:35:50 +00:00
|
|
|
|
2020-07-06 16:53:55 +00:00
|
|
|
// This can happen if a project has old-format exclusions. Just drop these items.
|
2020-06-08 02:19:46 +00:00
|
|
|
return nullptr;
|
2007-12-09 12:59:06 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-17 14:37:33 +00:00
|
|
|
wxString DRC_ITEM::GetViolatingRuleDesc() const
|
|
|
|
{
|
|
|
|
if( m_violatingRule )
|
|
|
|
return wxString::Format( _( "Rule: %s" ), m_violatingRule->m_Name );
|
2021-08-21 00:58:21 +00:00
|
|
|
else
|
2021-09-06 18:58:46 +00:00
|
|
|
return _( "Local override" );
|
2021-08-17 14:37:33 +00:00
|
|
|
}
|
|
|
|
|
2021-12-01 14:42:44 +00:00
|
|
|
|
|
|
|
void DRC_ITEMS_PROVIDER::SetSeverities( int aSeverities )
|
|
|
|
{
|
|
|
|
m_severities = aSeverities;
|
|
|
|
|
|
|
|
m_filteredMarkers.clear();
|
|
|
|
|
|
|
|
for( PCB_MARKER* marker : m_board->Markers() )
|
|
|
|
{
|
|
|
|
if( marker->GetMarkerType() != m_markerType )
|
|
|
|
continue;
|
|
|
|
|
|
|
|
if( marker->GetSeverity() & m_severities )
|
|
|
|
m_filteredMarkers.push_back( marker );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int DRC_ITEMS_PROVIDER::GetCount( int aSeverity ) const
|
|
|
|
{
|
|
|
|
if( aSeverity < 0 )
|
|
|
|
return m_filteredMarkers.size();
|
|
|
|
|
|
|
|
int count = 0;
|
|
|
|
|
|
|
|
for( PCB_MARKER* marker : m_board->Markers() )
|
|
|
|
{
|
|
|
|
if( marker->GetMarkerType() != m_markerType )
|
|
|
|
continue;
|
|
|
|
|
2022-01-22 21:34:01 +00:00
|
|
|
if( ( marker->GetSeverity() & aSeverity ) > 0 )
|
2021-12-01 14:42:44 +00:00
|
|
|
count++;
|
|
|
|
}
|
|
|
|
|
|
|
|
return count;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::shared_ptr<RC_ITEM> DRC_ITEMS_PROVIDER::GetItem( int aIndex ) const
|
|
|
|
{
|
|
|
|
PCB_MARKER* marker = m_filteredMarkers[ aIndex ];
|
|
|
|
|
|
|
|
return marker ? marker->GetRCItem() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DRC_ITEMS_PROVIDER::DeleteItem( int aIndex, bool aDeep )
|
|
|
|
{
|
|
|
|
PCB_MARKER* marker = m_filteredMarkers[ aIndex ];
|
|
|
|
m_filteredMarkers.erase( m_filteredMarkers.begin() + aIndex );
|
|
|
|
|
|
|
|
if( aDeep )
|
|
|
|
m_board->Delete( marker );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void DRC_ITEMS_PROVIDER::DeleteAllItems( bool aIncludeExclusions, bool aDeep )
|
|
|
|
{
|
|
|
|
// Filtered list was already handled through DeleteItem() by the tree control
|
|
|
|
|
|
|
|
if( aDeep )
|
|
|
|
m_board->DeleteMARKERs( true, aIncludeExclusions );
|
|
|
|
}
|