29#include <unordered_map>
61#define drc_dbg(level, fmt, ...) \
62 drcPrintDebugMessage(level, wxString::Format( fmt, __VA_ARGS__ ), __FUNCTION__, __LINE__ );
70typedef std::function<void(
const std::shared_ptr<DRC_ITEM>& aItem,
167 void InitEngine(
const wxFileName& aRulePath );
172 void RunTests(
EDA_UNITS aUnits,
bool aReportAllTrackErrors,
bool aTestFootprints,
222 static int MatchDpSuffix(
const wxString& aNetName, wxString& aComplementNet,
223 wxString& aBaseDpName );
233 void addRule( std::shared_ptr<DRC_RULE>& rule )
243 void loadRules(
const wxFileName& aPath );
264 std::vector<std::shared_ptr<DRC_RULE>>
m_rules;
Container for design settings for a BOARD object.
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
Information pertinent to a Pcbnew printed circuit board.
Design Rule Checker object that performs all the DRC tests.
DS_PROXY_VIEW_ITEM * GetDrawingSheet() const
std::map< DRC_CONSTRAINT_T, std::vector< DRC_ENGINE_CONSTRAINT * > * > m_constraintMap
void SetGraphicsHandler(DRC_GRAPHICS_HANDLER aHandler)
Set an optional DRC graphics handler (receives a PCB_MARKER).
bool GetTestFootprints() const
void ClearGraphicsHandler()
void RunTests(EDA_UNITS aUnits, bool aReportAllTrackErrors, bool aTestFootprints, BOARD_COMMIT *aCommit=nullptr)
Run the DRC tests.
void addRule(std::shared_ptr< DRC_RULE > &rule)
PROGRESS_REPORTER * m_progressReporter
void loadRules(const wxFileName &aPath)
Load and parse a rule set from an sexpr text file.
std::vector< DRC_TEST_PROVIDER * > m_testProviders
std::shared_ptr< KIGFX::VIEW_OVERLAY > GetDebugOverlay() const
void SetDesignSettings(BOARD_DESIGN_SETTINGS *aSettings)
void SetProgressReporter(PROGRESS_REPORTER *aProgRep)
Set an optional reporter for user-level progress info.
void SetDebugOverlay(std::shared_ptr< KIGFX::VIEW_OVERLAY > aOverlay)
void SetDrawingSheet(DS_PROXY_VIEW_ITEM *aDrawingSheet)
bool GetReportAllTrackErrors() const
std::set< int > QueryDistinctConstraints(DRC_CONSTRAINT_T aConstraintId)
DS_PROXY_VIEW_ITEM * m_drawingSheet
NETLIST * m_schematicNetlist
bool KeepRefreshing(bool aWait=false)
void GraphicsHandler(PCB_MARKER *aMarker)
void SetLogReporter(REPORTER *aReporter)
void SetViolationHandler(DRC_VIOLATION_HANDLER aHandler)
Set an optional DRC violation handler (receives DRC_ITEMs and positions).
bool m_reportAllTrackErrors
bool ReportProgress(double aProgress)
DRC_TEST_PROVIDER * GetTestProvider(const wxString &name) const
bool HasRulesForConstraintType(DRC_CONSTRAINT_T constraintID)
BOARD_DESIGN_SETTINGS * GetDesignSettings() const
void ReportViolation(const std::shared_ptr< DRC_ITEM > &aItem, const VECTOR2I &aPos, int aMarkerLayer)
void SetMaxProgress(int aSize)
void ReportAux(const wxString &aStr)
std::vector< int > m_errorLimits
bool IsErrorLimitExceeded(int error_code)
void ProcessAssertions(const BOARD_ITEM *a, std::function< void(const DRC_CONSTRAINT *)> aFailureHandler, REPORTER *aReporter=nullptr)
DRC_VIOLATION_HANDLER m_violationHandler
DRC_CONSTRAINT EvalRules(DRC_CONSTRAINT_T aConstraintType, const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
std::vector< std::shared_ptr< DRC_RULE > > m_rules
std::shared_ptr< DRC_RULE > createImplicitRule(const wxString &name)
void ClearViolationHandler()
void SetSchematicNetlist(NETLIST *aNetlist)
PROGRESS_REPORTER * GetProgressReporter() const
std::vector< DRC_TEST_PROVIDER * > GetTestProviders() const
static bool IsNetADiffPair(BOARD *aBoard, NETINFO_ITEM *aNet, int &aNetP, int &aNetN)
DRC_GRAPHICS_HANDLER m_graphicsHandler
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 ...
std::shared_ptr< KIGFX::VIEW_OVERLAY > m_debugOverlay
bool QueryWorstConstraint(DRC_CONSTRAINT_T aRuleId, DRC_CONSTRAINT &aConstraint)
NETLIST * GetSchematicNetlist() const
void InitEngine(const wxFileName &aRulePath)
Initialize the DRC engine.
DRC_CONSTRAINT EvalZoneConnection(const BOARD_ITEM *a, const BOARD_ITEM *b, PCB_LAYER_ID aLayer, REPORTER *aReporter=nullptr)
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.
bool ReportPhase(const wxString &aMessage)
void SetBoard(BOARD *aBoard)
BOARD_DESIGN_SETTINGS * m_designSettings
Represent a DRC "provider" which runs some DRC functions over a BOARD and spits out DRC_ITEM and posi...
LSET is a set of PCB_LAYER_IDs.
A collection of nets and the parameters used to route or test these nets.
Handle the data for a net.
Store information read from a netlist along with the flags used to update the NETLIST in the BOARD.
The main frame for Pcbnew.
A progress reporter interface for use in multi-threaded environments.
A pure virtual class used to derive REPORTER objects from.
void drcPrintDebugMessage(int level, const wxString &msg, const char *function, int line)
std::function< void(const std::shared_ptr< DRC_ITEM > &aItem, const VECTOR2I &aPos, int aLayer)> DRC_VIOLATION_HANDLER
std::function< void(PCB_MARKER *aMarker)> DRC_GRAPHICS_HANDLER
PCB_LAYER_ID
A quick note on layer IDs:
The Cairo implementation of the graphics abstraction layer.
std::shared_ptr< DRC_RULE > parentRule
DRC_RULE_CONDITION * condition
DRC_CONSTRAINT constraint