KiCad PCB EDA Suite
|
Design Rule Checker object that performs all the DRC tests. More...
#include <drc_engine.h>
Classes | |
struct | DRC_ENGINE_CONSTRAINT |
Public Member Functions | |
DRC_ENGINE (BOARD *aBoard=nullptr, BOARD_DESIGN_SETTINGS *aSettings=nullptr) | |
virtual | ~DRC_ENGINE () |
DRC_ENGINE (const DRC_ENGINE &)=delete | |
DRC_ENGINE & | operator= (const DRC_ENGINE &)=delete |
void | SetBoard (BOARD *aBoard) |
BOARD * | GetBoard () const |
void | SetDesignSettings (BOARD_DESIGN_SETTINGS *aSettings) |
BOARD_DESIGN_SETTINGS * | GetDesignSettings () const |
void | SetSchematicNetlist (NETLIST *aNetlist) |
NETLIST * | GetSchematicNetlist () const |
void | SetDrawingSheet (DS_PROXY_VIEW_ITEM *aDrawingSheet) |
DS_PROXY_VIEW_ITEM * | GetDrawingSheet () const |
void | SetDebugOverlay (std::shared_ptr< KIGFX::VIEW_OVERLAY > aOverlay) |
std::shared_ptr< KIGFX::VIEW_OVERLAY > | GetDebugOverlay () const |
void | SetViolationHandler (DRC_VIOLATION_HANDLER aHandler) |
Set an optional DRC violation handler (receives DRC_ITEMs and positions). | |
void | ClearViolationHandler () |
void | SetProgressReporter (PROGRESS_REPORTER *aProgRep) |
Set an optional reporter for user-level progress info. | |
PROGRESS_REPORTER * | GetProgressReporter () const |
void | SetLogReporter (REPORTER *aReporter) |
void | InitEngine (const wxFileName &aRulePath) |
Initialize the DRC engine. | |
void | RunTests (EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aTestFootprints, BOARD_COMMIT *aCommit=nullptr) |
Run the DRC tests. | |
bool | IsErrorLimitExceeded (int error_code) |
DRC_CONSTRAINT | EvalRules (DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr) |
DRC_CONSTRAINT | EvalZoneConnection (const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr) |
void | ProcessAssertions (const BOARD_ITEM *a, std::function< void(const DRC_CONSTRAINT *)> aFailureHandler, REPORTER *aReporter=nullptr) |
bool | HasRulesForConstraintType (DRC_CONSTRAINT_T constraintID) |
bool | GetReportAllTrackErrors () const |
bool | GetTestFootprints () const |
bool | RulesValid () |
void | ReportViolation (const std::shared_ptr< DRC_ITEM > &aItem, const VECTOR2I &aPos, int aMarkerLayer, const std::vector< PCB_SHAPE > &aShapes={}) |
bool | KeepRefreshing (bool aWait=false) |
void | AdvanceProgress () |
void | SetMaxProgress (int aSize) |
bool | ReportProgress (double aProgress) |
bool | ReportPhase (const wxString &aMessage) |
bool | IsCancelled () const |
REPORTER * | GetLogReporter () const |
bool | QueryWorstConstraint (DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint) |
std::set< int > | QueryDistinctConstraints (DRC_CONSTRAINT_T aConstraintId) |
std::vector< DRC_TEST_PROVIDER * > | GetTestProviders () const |
DRC_TEST_PROVIDER * | GetTestProvider (const wxString &name) const |
std::vector< BOARD_ITEM * > | GetItemsMatchingCondition (const wxString &aExpression, DRC_CONSTRAINT_T aConstraint=ASSERTION_CONSTRAINT, REPORTER *aReporter=nullptr) |
Evaluate a DRC condition against all board items and return matches. | |
bool | IsNetTieExclusion (int aTrackNetCode, PCB_LAYER_ID aTrackLayer, const VECTOR2I &aCollisionPos, BOARD_ITEM *aCollidingItem) |
Check if the given collision between a track and another item occurs during the track's entry into a net-tie pad. | |
EDA_UNITS | GetUserUnits () const |
void | SetUserUnits (EDA_UNITS aUnits) |
virtual void | GetUnitPair (EDA_UNITS &aPrimaryUnit, EDA_UNITS &aSecondaryUnits) |
const EDA_IU_SCALE & | GetIuScale () const |
virtual ORIGIN_TRANSFORMS & | GetOriginTransforms () |
wxString | StringFromValue (double aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
Converts aValue in internal units into a united string. | |
wxString | StringFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=false) const |
wxString | StringFromOptionalValue (std::optional< int > aValue, bool aAddUnitLabel=false, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
Converts an optional aValue in internal units into a united string. | |
wxString | MessageTextFromValue (double aValue, bool aAddUnitLabel=true, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
A lower-precision version of StringFromValue(). | |
wxString | MessageTextFromValue (const EDA_ANGLE &aValue, bool aAddUnitLabel=true) const |
wxString | MessageTextFromMinOptMax (const MINOPTMAX< int > &aValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
int | ValueFromString (const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
Converts aTextValue in aUnits to internal units used by the frame. | |
std::optional< int > | OptionalValueFromString (const wxString &aTextValue, EDA_DATA_TYPE aType=EDA_DATA_TYPE::DISTANCE) const |
Converts aTextValue in aUnits to internal units used by the frame. | |
EDA_ANGLE | AngleValueFromString (const wxString &aTextValue) const |
EDA_UNITS | GetUnitsFromType (EDA_DATA_TYPE aType) const |
Gets the units to use in the conversion based on the underlying user units. | |
Static Public Member Functions | |
static bool | IsNetADiffPair (BOARD *aBoard, NETINFO_ITEM *aNet, int &aNetP, int &aNetN) |
static int | MatchDpSuffix (const wxString &aNetName, wxString &aComplementNet, wxString &aBaseDpName) |
Check if the given net is a diff pair, returning its polarity and complement if so. | |
static EDA_DATA_TYPE | GetTypeFromUnits (const EDA_UNITS aUnits) |
Gets the inferred type from the given units. | |
Static Public Attributes | |
static const wxString | NullUiString = "" |
The string that is used in the UI to represent a null value. | |
Protected Attributes | |
BOARD_DESIGN_SETTINGS * | m_designSettings |
BOARD * | m_board |
DS_PROXY_VIEW_ITEM * | m_drawingSheet |
NETLIST * | m_schematicNetlist |
std::vector< std::shared_ptr< DRC_RULE > > | m_rules |
bool | m_rulesValid |
std::vector< DRC_TEST_PROVIDER * > | m_testProviders |
std::vector< int > | m_errorLimits |
bool | m_reportAllTrackErrors |
bool | m_testFootprints |
std::map< DRC_CONSTRAINT_T, std::vector< DRC_ENGINE_CONSTRAINT * > * > | m_constraintMap |
DRC_VIOLATION_HANDLER | m_violationHandler |
REPORTER * | m_logReporter |
PROGRESS_REPORTER * | m_progressReporter |
std::shared_ptr< KIGFX::VIEW_OVERLAY > | m_debugOverlay |
Private Member Functions | |
void | addRule (std::shared_ptr< DRC_RULE > &rule) |
void | loadRules (const wxFileName &aPath) |
Load and parse a rule set from an sexpr text file. | |
void | compileRules () |
void | loadImplicitRules () |
std::shared_ptr< DRC_RULE > | createImplicitRule (const wxString &name) |
Private Attributes | |
const EDA_IU_SCALE & | m_iuScale |
EDA_UNITS | m_userUnits |
Friends | |
class | DRC_TEST_PROVIDER_CLEARANCE_BASE |
class | DRC_TEST_PROVIDER_CREEPAGE |
Design Rule Checker object that performs all the DRC tests.
Optionally reports violations via a DRC_VIOLATION_HANDLER, user-level progress via a PROGRESS_REPORTER and rule parse errors via a REPORTER, all set through various setter calls.
Note that EvalRules() has yet another optional REPORTER for reporting resolution info to the user.
Definition at line 83 of file drc_engine.h.
DRC_ENGINE::DRC_ENGINE | ( | BOARD * | aBoard = nullptr, |
BOARD_DESIGN_SETTINGS * | aSettings = nullptr ) |
Definition at line 79 of file drc_engine.cpp.
References DRCE_FIRST, DRCE_LAST, ERROR_LIMIT, m_board, m_designSettings, m_drawingSheet, m_errorLimits, m_logReporter, m_progressReporter, m_reportAllTrackErrors, m_rulesValid, m_schematicNetlist, m_testFootprints, MM, pcbIUScale, and UNITS_PROVIDER::UNITS_PROVIDER().
Referenced by DRC_ENGINE(), and operator=().
|
virtual |
Definition at line 98 of file drc_engine.cpp.
References m_constraintMap, and m_rules.
|
delete |
References DRC_ENGINE().
|
inlineprivate |
Definition at line 228 of file drc_engine.h.
References m_rules.
Referenced by createImplicitRule(), and loadImplicitRules().
void DRC_ENGINE::AdvanceProgress | ( | ) |
Definition at line 1833 of file drc_engine.cpp.
References m_progressReporter.
|
inlineinherited |
Definition at line 186 of file units_provider.h.
References DEGREES, DEGREES_T, EDA_UNIT_UTILS::UI::DoubleValueFromString(), and GetIuScale().
|
inline |
Definition at line 125 of file drc_engine.h.
References m_violationHandler.
Referenced by BOOST_DATA_TEST_CASE_F().
|
private |
Definition at line 527 of file drc_engine.cpp.
References DRC_RULE_CONDITION::Compile(), DRC_ENGINE::DRC_ENGINE_CONSTRAINT::condition, DRC_ENGINE::DRC_ENGINE_CONSTRAINT::constraint, REPORTER::HasMessageOfSeverity(), DRC_ENGINE::DRC_ENGINE_CONSTRAINT::layerTest, m_constraintMap, m_logReporter, m_rules, DRC_CONSTRAINT::m_Type, DRC_ENGINE::DRC_ENGINE_CONSTRAINT::parentRule, RPT_SEVERITY_ERROR, THROW_PARSE_ERROR, and TO_UTF8.
Referenced by InitEngine().
|
private |
Definition at line 141 of file drc_engine.cpp.
References addRule(), and name.
Referenced by loadImplicitRules().
DRC_CONSTRAINT DRC_ENGINE::EvalRules | ( | DRC_CONSTRAINT_T | aConstraintType, |
const BOARD_ITEM * | a, | ||
const BOARD_ITEM * | b, | ||
PCB_LAYER_ID | aLayer, | ||
REPORTER * | aReporter = nullptr ) |
Definition at line 711 of file drc_engine.cpp.
References _, ANNULAR_WIDTH_CONSTRAINT, ASSERTION_CONSTRAINT, B_CrtYd, LSET::BackMask(), BLIND_BURIED, clearance, CLEARANCE_CONSTRAINT, CONNECTION_WIDTH_CONSTRAINT, COURTYARD_CLEARANCE_CONSTRAINT, CREEPAGE_CONSTRAINT, DIFF_PAIR_GAP_CONSTRAINT, DISALLOW_CONSTRAINT, DRC_DISALLOW_BB_VIAS, DRC_DISALLOW_FOOTPRINTS, DRC_DISALLOW_GRAPHICS, DRC_DISALLOW_HOLES, DRC_DISALLOW_MICRO_VIAS, DRC_DISALLOW_PADS, DRC_DISALLOW_TEXTS, DRC_DISALLOW_TRACKS, DRC_DISALLOW_VIAS, DRC_DISALLOW_ZONES, EDGE_CLEARANCE_CONSTRAINT, EscapeHTML(), F_CrtYd, LSET::FrontMask(), BOARD_CONNECTED_ITEM::GetClearanceOverrides(), FOOTPRINT::GetCourtyard(), EDA_ITEM::GetFlags(), EDA_ITEM::GetItemDescription(), FOOTPRINT::GetItemDescription(), ZONE::GetItemDescription(), BOARD_ITEM::GetLayerSet(), BOARD_CONNECTED_ITEM::GetLocalClearance(), PCB_SHAPE::GetLocalSolderMaskMargin(), FOOTPRINT::GetLocalZoneConnection(), ZONE::GetMinThickness(), FOOTPRINT::GetNetTieCache(), ZONE::GetPadConnection(), BOARD_ITEM::GetParentFootprint(), DRC_CONSTRAINT::GetParentRule(), ZONE::GetThermalReliefGap(), ZONE::GetThermalReliefSpokeWidth(), BOARD_ITEM::HasDrilledHole(), HOLE_CLEARANCE_CONSTRAINT, HOLE_PROXY, HOLE_SIZE_CONSTRAINT, HOLE_TO_HOLE_CONSTRAINT, INHERITED, BOARD_ITEM::IsConnected(), SHAPE_POLY_SET::IsEmpty(), isKeepoutZone(), BOARD_ITEM::IsOnCopperLayer(), KiROUND(), LENGTH_CONSTRAINT, m_board, m_constraintMap, m_designSettings, DRC_CONSTRAINT::m_DisallowFlags, DRC_RULE::m_Implicit, DRC_CONSTRAINT::m_ImplicitMin, DRC_CONSTRAINT::m_Type, DRC_CONSTRAINT::m_Value, DRC_CONSTRAINT::m_ZoneConnection, MAX_UNCOUPLED_CONSTRAINT, MAXIMUM_CLEARANCE, EDA_UNIT_UTILS::UI::MessageTextFromValue(), UNITS_PROVIDER::MessageTextFromValue(), MICROVIA, MINOPTMAX< T >::Min(), MIN_RESOLVED_SPOKES_CONSTRAINT, NULL_CONSTRAINT, pad, PCB_ARC_T, PCB_FIELD_T, PCB_FOOTPRINT_T, PCB_LOCATE_HOLE_T, PCB_PAD_T, PCB_SHAPE_T, PCB_TABLE_T, PCB_TEXT_T, PCB_TEXTBOX_T, PCB_TRACE_T, PCB_VIA_T, PCB_ZONE_T, PHYSICAL_CLEARANCE_CONSTRAINT, PHYSICAL_HOLE_CLEARANCE_CONSTRAINT, PrintZoneConnection(), REPORT, MINOPTMAX< T >::SetMax(), MINOPTMAX< T >::SetMin(), DRC_CONSTRAINT::SetName(), MINOPTMAX< T >::SetOpt(), DRC_CONSTRAINT::SetOptionsFromOther(), DRC_CONSTRAINT::SetParentRule(), SILK_CLEARANCE_CONSTRAINT, SKEW_CONSTRAINT, SOLDER_MASK_EXPANSION_CONSTRAINT, SOLDER_PASTE_ABS_MARGIN_CONSTRAINT, SOLDER_PASTE_REL_MARGIN_CONSTRAINT, TEXT_HEIGHT_CONSTRAINT, TEXT_THICKNESS_CONSTRAINT, THERMAL_RELIEF_GAP_CONSTRAINT, THERMAL_SPOKE_WIDTH_CONSTRAINT, TRACK_WIDTH_CONSTRAINT, EDA_ITEM::Type(), UNDEFINED_LAYER, unityScale, UNSCALED, VIA_DIAMETER_CONSTRAINT, and ZONE_CONNECTION_CONSTRAINT.
Referenced by ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildThermalSpokes(), PCB_TUNING_PATTERN::CreateNew(), EvalZoneConnection(), PCB_VIA::GetDrillConstraint(), PCB_VIA::GetMinAnnulus(), BOARD_CONNECTED_ITEM::GetOwnClearance(), PAD::GetOwnClearance(), PCB_TRACK::GetWidthConstraint(), PCB_VIA::GetWidthConstraint(), ROUTER_TOOL::handleLayerSwitch(), ZONE_FILLER::knockoutThermalReliefs(), and DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer().
DRC_CONSTRAINT DRC_ENGINE::EvalZoneConnection | ( | const BOARD_ITEM * | a, |
const BOARD_ITEM * | b, | ||
PCB_LAYER_ID | aLayer, | ||
REPORTER * | aReporter = nullptr ) |
Definition at line 677 of file drc_engine.cpp.
References _, EscapeHTML(), EvalRules(), FULL, DRC_CONSTRAINT::m_ZoneConnection, pad, PCB_PAD_T, PrintZoneConnection(), PTH, REPORT, THERMAL, THT_THERMAL, EDA_ITEM::Type(), and ZONE_CONNECTION_CONSTRAINT.
Referenced by ZONE_FILLER::knockoutThermalReliefs(), and DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer().
|
inline |
Definition at line 99 of file drc_engine.h.
References m_board.
|
inline |
Definition at line 115 of file drc_engine.h.
References m_debugOverlay.
|
inline |
Definition at line 102 of file drc_engine.h.
References m_designSettings.
Referenced by IsNetTieExclusion().
|
inline |
Definition at line 108 of file drc_engine.h.
References m_drawingSheet.
std::vector< BOARD_ITEM * > DRC_ENGINE::GetItemsMatchingCondition | ( | const wxString & | aExpression, |
DRC_CONSTRAINT_T | aConstraint = ASSERTION_CONSTRAINT, | ||
REPORTER * | aReporter = nullptr ) |
Evaluate a DRC condition against all board items and return matches.
aExpression | Expression to evaluate |
aConstraint | Constraint context for expression evaluation |
aReporter | Reporter for compile or evaluation errors |
Definition at line 2043 of file drc_engine.cpp.
References DRC_RULE_CONDITION::Compile(), DRC_RULE_CONDITION::EvaluateFor(), m_board, and m_logReporter.
|
inlineinherited |
Definition at line 55 of file units_provider.h.
References m_iuScale.
Referenced by AngleValueFromString(), GRID_MENU::BuildChoiceList(), RC_ITEM::GetJsonViolation(), MessageTextFromMinOptMax(), MessageTextFromValue(), UNIT_BINDER::onUnitsChanged(), OptionalValueFromString(), StringFromOptionalValue(), StringFromValue(), GRID::UserUnitsMessageText(), and ValueFromString().
|
inline |
Definition at line 188 of file drc_engine.h.
References m_logReporter.
|
inlinevirtualinherited |
Reimplemented in EDA_BASE_FRAME, and PCB_BASE_FRAME.
Definition at line 58 of file units_provider.h.
|
inline |
Definition at line 134 of file drc_engine.h.
References m_progressReporter.
|
inline |
Definition at line 173 of file drc_engine.h.
References m_reportAllTrackErrors.
|
inline |
Definition at line 105 of file drc_engine.h.
References m_schematicNetlist.
|
inline |
Definition at line 174 of file drc_engine.h.
References m_testFootprints.
DRC_TEST_PROVIDER * DRC_ENGINE::GetTestProvider | ( | const wxString & | name | ) | const |
Definition at line 2031 of file drc_engine.cpp.
References m_testProviders, and name.
|
inline |
Definition at line 193 of file drc_engine.h.
References m_testProviders.
|
inlinestaticinherited |
Gets the inferred type from the given units.
Note: will always return the most simple type (e.g. a DISTANCE rather than AREA or VOLUME for a measurement unit).
Definition at line 219 of file units_provider.h.
References CM, DEGREES, DISTANCE, FS, INCH, LENGTH_DELAY, MILS, MM, PERCENT, PS, PS_PER_CM, PS_PER_INCH, PS_PER_MM, TIME, UM, UNITLESS, and UNSCALED.
Referenced by DRC_RULES_PARSER::parseConstraint(), and WX_GRID::SetAutoEvalColUnits().
|
inlinevirtualinherited |
Reimplemented in EDA_DRAW_FRAME.
Definition at line 48 of file units_provider.h.
References GetUserUnits(), EDA_UNIT_UTILS::IsImperialUnit(), MILS, and MM.
|
inlineinherited |
Gets the units to use in the conversion based on the underlying user units.
Definition at line 197 of file units_provider.h.
References GetUserUnits(), EDA_UNIT_UTILS::IsMetricUnit(), LENGTH_DELAY, PS, PS_PER_CM, PS_PER_INCH, and TIME.
Referenced by MessageTextFromMinOptMax(), MessageTextFromValue(), OptionalValueFromString(), StringFromOptionalValue(), StringFromValue(), and ValueFromString().
|
inlineinherited |
Definition at line 45 of file units_provider.h.
References m_userUnits.
Referenced by PCB::IFACE::CreateKiWindow(), DIALOG_SHIM::DIALOG_SHIM(), PL_EDITOR_FRAME::DisplayGridMsg(), EDA_DRAW_FRAME::DisplayUnitsMsg(), EVT_GRID_CMD_CELL_CHANGED(), FOOTPRINT_PREVIEW_PANEL::FOOTPRINT_PREVIEW_PANEL(), WX_GRID::getColumnUnits(), RC_ITEM::GetJsonViolation(), GERBER_DRAW_ITEM::GetMsgPanelInfo(), EDA_DRAW_FRAME::GetUnitPair(), GetUnitPair(), GetUnitsFromType(), IfaceOrAddress(), PCB_VIEWER_TOOLS::MeasureTool(), PCB_POINT_EDITOR::OnSelectionChange(), PANEL_PREVIEW_3D_MODEL::onUnitsChanged(), UNIT_BINDER::onUnitsChanged(), POSITION_RELATIVE_TOOL::PositionRelative(), SaveFileAs(), EDA_DRAW_FRAME::SaveSettings(), PCB_BASE_FRAME::SetBoard(), WX_GRID::SetUnitsProvider(), EDA_DRAW_FRAME::ToggleUserUnits(), PCB_BASE_FRAME::unitsChangeRefresh(), EDITOR_CONDITIONS::unitsFunc(), GERBVIEW_FRAME::updateDCodeSelectBox(), PL_EDITOR_FRAME::UpdateStatusBar(), and GRID::UserUnitsMessageText().
bool DRC_ENGINE::HasRulesForConstraintType | ( | DRC_CONSTRAINT_T | constraintID | ) |
Definition at line 1875 of file drc_engine.cpp.
References m_constraintMap.
void DRC_ENGINE::InitEngine | ( | const wxFileName & | aRulePath | ) |
Initialize the DRC engine.
PARSE_ERROR | if the rules file contains errors |
Definition at line 565 of file drc_engine.cpp.
References compileRules(), DRCE_FIRST, DRCE_LAST, ERROR_LIMIT, DRC_TEST_PROVIDER_REGISTRY::GetTestProviders(), DRC_TEST_PROVIDER_REGISTRY::Instance(), loadImplicitRules(), loadRules(), m_board, m_constraintMap, m_errorLimits, m_logReporter, m_rules, m_rulesValid, and m_testProviders.
Referenced by BOOST_FIXTURE_TEST_CASE(), PCB_EDIT_FRAME::CommonSettingsChanged(), DoCourtyardInvalidTest(), DoCourtyardOverlapTest(), LoadBoard(), PCB_EDIT_FRAME::OnBoardLoaded(), PCB_EDIT_FRAME::OnNetlistChanged(), DIALOG_DRC::OnRunDRCClick(), and DRC_BASE_FIXTURE::runDrcOnBoard().
bool DRC_ENGINE::IsCancelled | ( | ) | const |
Definition at line 1869 of file drc_engine.cpp.
References m_progressReporter.
bool DRC_ENGINE::IsErrorLimitExceeded | ( | int | error_code | ) |
Definition at line 1781 of file drc_engine.cpp.
References DRCE_LAST, and m_errorLimits.
|
static |
Definition at line 1973 of file drc_engine.cpp.
References dummy, BOARD::FindNet(), NETINFO_ITEM::GetNetCode(), NETINFO_ITEM::GetNetname(), and MatchDpSuffix().
Referenced by test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run().
bool DRC_ENGINE::IsNetTieExclusion | ( | int | aTrackNetCode, |
PCB_LAYER_ID | aTrackLayer, | ||
const VECTOR2I & | aCollisionPos, | ||
BOARD_ITEM * | aCollidingItem ) |
Check if the given collision between a track and another item occurs during the track's entry into a net-tie pad.
Definition at line 2007 of file drc_engine.cpp.
References epsilon, GetDesignSettings(), BOARD_DESIGN_SETTINGS::GetDRCEpsilon(), BOARD_ITEM::GetParentFootprint(), FOOTPRINT::IsNetTie(), FOOTPRINT::MapPadNumbersToNetTieGroups(), pad, and FOOTPRINT::Pads().
bool DRC_ENGINE::KeepRefreshing | ( | bool | aWait = false | ) |
Definition at line 1824 of file drc_engine.cpp.
References m_progressReporter.
|
private |
Definition at line 154 of file drc_engine.cpp.
References _, addRule(), ANNULAR_WIDTH_CONSTRAINT, B_SilkS, CLEARANCE_CONSTRAINT, CONNECTION_WIDTH_CONSTRAINT, COURTYARD_CLEARANCE_CONSTRAINT, createImplicitRule(), DIFF_PAIR_GAP_CONSTRAINT, DISALLOW_CONSTRAINT, DRC_DISALLOW_FOOTPRINTS, DRC_DISALLOW_PADS, DRC_DISALLOW_TRACKS, DRC_DISALLOW_VIAS, DRC_DISALLOW_ZONES, EDGE_CLEARANCE_CONSTRAINT, F_SilkS, NET_SETTINGS::GetCompositeNetclasses(), NET_SETTINGS::GetDefaultNetclass(), NET_SETTINGS::GetNetclasses(), HOLE_CLEARANCE_CONSTRAINT, HOLE_SIZE_CONSTRAINT, HOLE_TO_HOLE_CONSTRAINT, isKeepoutZone(), m_board, BOARD_DESIGN_SETTINGS::m_CopperEdgeClearance, DRC_CONSTRAINT::m_DisallowFlags, BOARD_DESIGN_SETTINGS::m_HoleClearance, BOARD_DESIGN_SETTINGS::m_HoleToHoleMin, BOARD_DESIGN_SETTINGS::m_MicroViasMinDrill, BOARD_DESIGN_SETTINGS::m_MicroViasMinSize, BOARD_DESIGN_SETTINGS::m_MinClearance, BOARD_DESIGN_SETTINGS::m_MinConn, BOARD_DESIGN_SETTINGS::m_MinResolvedSpokes, BOARD_DESIGN_SETTINGS::m_MinSilkTextHeight, BOARD_DESIGN_SETTINGS::m_MinSilkTextThickness, BOARD_DESIGN_SETTINGS::m_MinThroughDrill, BOARD_DESIGN_SETTINGS::m_NetSettings, BOARD_DESIGN_SETTINGS::m_SilkClearance, BOARD_DESIGN_SETTINGS::m_TrackMinWidth, BOARD_DESIGN_SETTINGS::m_ViasMinAnnularWidth, BOARD_DESIGN_SETTINGS::m_ViasMinSize, MIN_RESOLVED_SPOKES_CONSTRAINT, name, MINOPTMAX< T >::SetMin(), MINOPTMAX< T >::SetOpt(), SILK_CLEARANCE_CONSTRAINT, TEXT_HEIGHT_CONSTRAINT, TEXT_THICKNESS_CONSTRAINT, TRACK_WIDTH_CONSTRAINT, DRC_CONSTRAINT::Value(), and VIA_DIAMETER_CONSTRAINT.
Referenced by InitEngine().
|
private |
Load and parse a rule set from an sexpr text file.
PARSE_ERROR |
Definition at line 491 of file drc_engine.cpp.
References ExpandTextVars(), m_board, m_logReporter, m_rules, DRC_RULES_PARSER::Parse(), FILE_LINE_READER::ReadLine(), and resolver.
Referenced by InitEngine().
|
static |
Check if the given net is a diff pair, returning its polarity and complement if so.
aNetName | is the input net name, like DIFF_P |
aComplementNet | will be filled with the complement, like DIFF_N |
aBaseDpName | will be filled with the base name, like DIFF |
Definition at line 1923 of file drc_engine.cpp.
Referenced by inDiffPairFunc(), BOARD_INSPECTION_TOOL::InspectClearance(), isCoupledDiffPairFunc(), and IsNetADiffPair().
|
inlineinherited |
Definition at line 137 of file units_provider.h.
References DISTANCE, GetIuScale(), GetUnitsFromType(), and EDA_UNIT_UTILS::UI::MessageTextFromMinOptMax().
Referenced by PCB_TRACK::GetMsgPanelInfo(), and PCB_TUNING_PATTERN::GetMsgPanelInfo().
|
inlineinherited |
Definition at line 130 of file units_provider.h.
References EDA_ANGLE::AsDegrees(), DEGREES, DISTANCE, EDA_UNIT_UTILS::UI::MessageTextFromValue(), and unityScale.
|
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 123 of file units_provider.h.
References DISTANCE, GetIuScale(), GetUnitsFromType(), and EDA_UNIT_UTILS::UI::MessageTextFromValue().
Referenced by CheckDuplicatePins(), CheckLibSymbol(), CheckLibSymbolGraphics(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), GERBVIEW_FRAME::DisplayGridMsg(), GERBER_FILE_IMAGE::DisplayImageInfo(), DRC_ENGINE::EvalRules(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), DS_DRAW_ITEM_LINE::GetItemDescription(), DS_DRAW_ITEM_RECT::GetItemDescription(), PCB_TRACK::GetItemDescription(), SCH_LINE::GetItemDescription(), SCH_SHAPE::GetItemDescription(), DS_DRAW_ITEM_BASE::GetMsgPanelInfo(), NETINFO_ITEM::GetMsgPanelInfo(), PAD::GetMsgPanelInfo(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_DIM_LEADER::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), PCB_POINT::GetMsgPanelInfo(), PCB_REFERENCE_IMAGE::GetMsgPanelInfo(), PCB_TABLECELL::GetMsgPanelInfo(), PCB_TARGET::GetMsgPanelInfo(), PCB_TEXT::GetMsgPanelInfo(), PCB_TEXTBOX::GetMsgPanelInfo(), PCB_TRACK::GetMsgPanelInfo(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_VIA::GetMsgPanelInfo(), SCH_BITMAP::GetMsgPanelInfo(), SCH_FIELD::GetMsgPanelInfo(), SCH_JUNCTION::GetMsgPanelInfo(), SCH_LABEL_BASE::GetMsgPanelInfo(), SCH_PIN::GetMsgPanelInfo(), SCH_TABLECELL::GetMsgPanelInfo(), SCH_TEXT::GetMsgPanelInfo(), SCH_TEXTBOX::GetMsgPanelInfo(), STROKE_PARAMS::GetMsgPanelInfo(), ZONE::GetMsgPanelInfo(), GetNetNavigatorItemText(), PCB_BASE_FRAME::MessageTextFromCoord(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), EDA_SHAPE::ShapeGetMsgPanelInfo(), showCoord(), DRC_TEST_PROVIDER_MISC::testOutline(), VIA_SIZE_MENU::update(), PL_EDITOR_FRAME::UpdateMsgPanelInfo(), GERBVIEW_FRAME::UpdateStatusBar(), PCB_BASE_FRAME::UpdateStatusBar(), and SCH_BASE_FRAME::UpdateStatusBar().
|
delete |
References DRC_ENGINE().
|
inlineinherited |
Converts aTextValue in aUnits to internal units used by the frame.
Allows the return of an empty optional if the string represents a null value (currently empty string)
aType | is the type of this value, and controls the way the string is converted to a value |
aTextValue | A reference to a wxString object containing the string to convert. |
Definition at line 173 of file units_provider.h.
References DISTANCE, EDA_UNIT_UTILS::UI::DoubleValueFromString(), GetIuScale(), GetUnitsFromType(), KiROUND(), and NullUiString.
Referenced by WX_GRID::GetOptionalUnitValue(), and WX_GRID::onCellEditorHidden().
void DRC_ENGINE::ProcessAssertions | ( | const BOARD_ITEM * | a, |
std::function< void(const DRC_CONSTRAINT *)> | aFailureHandler, | ||
REPORTER * | aReporter = nullptr ) |
Definition at line 1706 of file drc_engine.cpp.
References _, ASSERTION_CONSTRAINT, EscapeHTML(), BOARD_ITEM::GetLayer(), BOARD_ITEM::GetLayerSet(), m_constraintMap, and REPORT.
std::set< int > DRC_ENGINE::QueryDistinctConstraints | ( | DRC_CONSTRAINT_T | aConstraintId | ) |
Definition at line 1908 of file drc_engine.cpp.
References m_constraintMap.
bool DRC_ENGINE::QueryWorstConstraint | ( | DRC_CONSTRAINT_T | aRuleId, |
DRC_CONSTRAINT & | aConstraint ) |
Definition at line 1886 of file drc_engine.cpp.
References m_constraintMap.
bool DRC_ENGINE::ReportPhase | ( | const wxString & | aMessage | ) |
Definition at line 1857 of file drc_engine.cpp.
References m_progressReporter.
bool DRC_ENGINE::ReportProgress | ( | double | aProgress | ) |
Definition at line 1847 of file drc_engine.cpp.
References m_progressReporter.
void DRC_ENGINE::ReportViolation | ( | const std::shared_ptr< DRC_ITEM > & | aItem, |
const VECTOR2I & | aPos, | ||
int | aMarkerLayer, | ||
const std::vector< PCB_SHAPE > & | aShapes = {} ) |
Definition at line 1788 of file drc_engine.cpp.
References m_errorLimits, m_logReporter, DRC_RULE::m_Name, m_violationHandler, VECTOR2< T >::x, and VECTOR2< T >::y.
|
inline |
Definition at line 176 of file drc_engine.h.
References m_rulesValid.
void DRC_ENGINE::RunTests | ( | EDA_UNITS | aUnits, |
bool | aReportAllTrackErrors, | ||
bool | aTestFootprints, | ||
BOARD_COMMIT * | aCommit = nullptr ) |
Run the DRC tests.
Definition at line 622 of file drc_engine.cpp.
References DRCE_CLEARANCE, DRCE_FIRST, DRCE_LAST, DRCE_UNCONNECTED_ITEMS, ERROR_LIMIT, EXTENDED_ERROR_LIMIT, DRC_TEST_PROVIDER::Init(), m_board, m_designSettings, m_errorLimits, m_logReporter, m_reportAllTrackErrors, m_testFootprints, m_testProviders, PROF_TIMER::msecs(), DRC_CACHE_GENERATOR::Run(), DRC_TEST_PROVIDER::SetDRCEngine(), UNITS_PROVIDER::SetUserUnits(), PROF_TIMER::Stop(), and traceDrcProfile.
Referenced by BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), DoCourtyardInvalidTest(), DoCourtyardOverlapTest(), and DRC_BASE_FIXTURE::runDrcOnBoard().
|
inline |
Definition at line 98 of file drc_engine.h.
References m_board.
|
inline |
Definition at line 110 of file drc_engine.h.
References m_debugOverlay.
|
inline |
Definition at line 101 of file drc_engine.h.
References m_designSettings.
|
inline |
Definition at line 107 of file drc_engine.h.
References m_drawingSheet.
|
inline |
Definition at line 143 of file drc_engine.h.
References m_logReporter.
void DRC_ENGINE::SetMaxProgress | ( | int | aSize | ) |
Definition at line 1840 of file drc_engine.cpp.
References m_progressReporter.
|
inline |
Set an optional reporter for user-level progress info.
Definition at line 133 of file drc_engine.h.
References m_progressReporter.
|
inline |
Definition at line 104 of file drc_engine.h.
References m_schematicNetlist.
|
inlineinherited |
Definition at line 46 of file units_provider.h.
References m_userUnits.
Referenced by EDA_BASE_FRAME::ChangeUserUnits(), PCB::IFACE::CreateKiWindow(), EDA_DRAW_FRAME::EDA_DRAW_FRAME(), PCB_DIM_ALIGNED::GetMsgPanelInfo(), PCB_DIMENSION_BASE::GetMsgPanelInfo(), IfaceOrAddress(), EDA_DRAW_FRAME::LoadSettings(), PL_EDITOR_FRAME::PL_EDITOR_FRAME(), DRC_ENGINE::RunTests(), DRC_TEST_PROVIDER::RunTests(), SaveFileAs(), and EDA_DRAW_FRAME::ToggleUserUnits().
|
inline |
Set an optional DRC violation handler (receives DRC_ITEMs and positions).
Definition at line 120 of file drc_engine.h.
References m_violationHandler.
Referenced by BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_DATA_TEST_CASE_F(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), DoCourtyardInvalidTest(), and DoCourtyardOverlapTest().
|
inlineinherited |
Converts an optional 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.
aValue | = optional value in internal units |
aAddUnitLabel | = true to add symbol unit to the string value |
aType | is the type of this value, and controls the way the value is converted to a string, and the suitable unit |
Definition at line 100 of file units_provider.h.
References DISTANCE, GetIuScale(), GetUnitsFromType(), NullUiString, and EDA_UNIT_UTILS::UI::StringFromValue().
Referenced by WX_GRID::onCellEditorHidden().
|
inlineinherited |
Definition at line 110 of file units_provider.h.
References EDA_ANGLE::AsDegrees(), DEGREES, DISTANCE, EDA_UNIT_UTILS::UI::StringFromValue(), and unityScale.
|
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.
aValue | = value in internal units |
aAddUnitLabel | = true to add symbol unit to the string value |
aType | is the type of this value, and controls the way the value is converted to a string, and the suitable unit |
Definition at line 79 of file units_provider.h.
References DISTANCE, GetIuScale(), GetUnitsFromType(), and EDA_UNIT_UTILS::UI::StringFromValue().
Referenced by MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), PAD::doCheckPad(), VALIDATION_ERROR_TOO_LARGE< T >::Format(), VALIDATION_ERROR_TOO_SMALL< T >::Format(), formatBBox(), DRC_TEST_PROVIDER::formatMsg(), DRC_TEST_PROVIDER::formatMsg(), WX_GRID::onCellEditorHidden(), reportMax(), reportMin(), reportOpt(), and PANEL_SETUP_TEXT_AND_GRAPHICS::TransferDataFromWindow().
|
inlineinherited |
Converts aTextValue in aUnits to internal units used by the frame.
aType | is the type of this value, and controls the way the string is converted to a value |
aTextValue | A reference to a wxString object containing the string to convert. |
Definition at line 152 of file units_provider.h.
References DISTANCE, EDA_UNIT_UTILS::UI::DoubleValueFromString(), GetIuScale(), GetUnitsFromType(), and KiROUND().
Referenced by PIN_TABLE_DATA_MODEL::compare(), MICROWAVE_TOOL::createFootprint(), MICROWAVE_TOOL::createMicrowaveInductor(), WX_GRID::GetUnitValue(), and WX_GRID::onCellEditorHidden().
|
friend |
Definition at line 86 of file drc_engine.h.
References DRC_TEST_PROVIDER_CLEARANCE_BASE.
Referenced by DRC_TEST_PROVIDER_CLEARANCE_BASE.
|
friend |
Definition at line 87 of file drc_engine.h.
References DRC_TEST_PROVIDER_CREEPAGE.
Referenced by DRC_TEST_PROVIDER_CREEPAGE.
|
protected |
Definition at line 255 of file drc_engine.h.
Referenced by DRC_ENGINE(), EvalRules(), GetBoard(), GetItemsMatchingCondition(), InitEngine(), loadImplicitRules(), loadRules(), RunTests(), and SetBoard().
|
protected |
Definition at line 268 of file drc_engine.h.
Referenced by compileRules(), EvalRules(), HasRulesForConstraintType(), InitEngine(), ProcessAssertions(), QueryDistinctConstraints(), QueryWorstConstraint(), and ~DRC_ENGINE().
|
protected |
Definition at line 274 of file drc_engine.h.
Referenced by GetDebugOverlay(), and SetDebugOverlay().
|
protected |
Definition at line 254 of file drc_engine.h.
Referenced by DRC_ENGINE(), EvalRules(), GetDesignSettings(), RunTests(), and SetDesignSettings().
|
protected |
Definition at line 256 of file drc_engine.h.
Referenced by DRC_ENGINE(), GetDrawingSheet(), and SetDrawingSheet().
|
protected |
Definition at line 263 of file drc_engine.h.
Referenced by DRC_ENGINE(), InitEngine(), IsErrorLimitExceeded(), ReportViolation(), and RunTests().
|
privateinherited |
Definition at line 251 of file units_provider.h.
Referenced by GetIuScale(), and UNITS_PROVIDER().
|
protected |
Definition at line 271 of file drc_engine.h.
Referenced by compileRules(), DRC_ENGINE(), GetItemsMatchingCondition(), GetLogReporter(), InitEngine(), loadRules(), ReportViolation(), RunTests(), and SetLogReporter().
|
protected |
Definition at line 272 of file drc_engine.h.
Referenced by AdvanceProgress(), DRC_ENGINE(), GetProgressReporter(), IsCancelled(), KeepRefreshing(), ReportPhase(), ReportProgress(), SetMaxProgress(), and SetProgressReporter().
|
protected |
Definition at line 264 of file drc_engine.h.
Referenced by DRC_ENGINE(), GetReportAllTrackErrors(), and RunTests().
|
protected |
Definition at line 259 of file drc_engine.h.
Referenced by addRule(), compileRules(), InitEngine(), loadRules(), and ~DRC_ENGINE().
|
protected |
Definition at line 260 of file drc_engine.h.
Referenced by DRC_ENGINE(), InitEngine(), and RulesValid().
|
protected |
Definition at line 257 of file drc_engine.h.
Referenced by DRC_ENGINE(), GetSchematicNetlist(), and SetSchematicNetlist().
|
protected |
Definition at line 265 of file drc_engine.h.
Referenced by DRC_ENGINE(), GetTestFootprints(), and RunTests().
|
protected |
Definition at line 261 of file drc_engine.h.
Referenced by GetTestProvider(), GetTestProviders(), InitEngine(), and RunTests().
|
privateinherited |
Definition at line 252 of file units_provider.h.
Referenced by GetUserUnits(), SetUserUnits(), and UNITS_PROVIDER().
|
protected |
Definition at line 270 of file drc_engine.h.
Referenced by ClearViolationHandler(), ReportViolation(), and SetViolationHandler().
|
inlinestaticinherited |
The string that is used in the UI to represent a null value.
Definition at line 248 of file units_provider.h.
Referenced by WX_GRID::GetOptionalUnitValue(), WX_GRID::onCellEditorHidden(), OptionalValueFromString(), and StringFromOptionalValue().