KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DRC_CONSTRAINT Class Reference

#include <drc_rule.h>

Public Types

enum class  OPTIONS : std::size_t { SKEW_WITHIN_DIFF_PAIRS = 0 , SPACE_DOMAIN , TIME_DOMAIN , NUM_OPTIONS }
 

Public Member Functions

 DRC_CONSTRAINT (DRC_CONSTRAINT_T aType=NULL_CONSTRAINT, const wxString &aName=wxEmptyString)
 
bool IsNull () const
 
bool IsUnary () const
 
const MINOPTMAX< int > & GetValue () const
 
MINOPTMAX< int > & Value ()
 
void SetParentRule (DRC_RULE *aParentRule)
 Attribute the constraint, including each min, opt and max value it has, to aParentRule.
 
DRC_RULE * GetParentRule () const
 
void SetValueRules (DRC_RULE *aMinRule, DRC_RULE *aOptRule, DRC_RULE *aMaxRule)
 
DRC_RULE * GetMinRule () const
 
DRC_RULE * GetOptRule () const
 
DRC_RULE * GetMaxRule () const
 
void SetName (const wxString &aName)
 
wxString GetName () const
 
wxString GetRuleName (const DRC_RULE *aRule) const
 
SEVERITY GetSeverity () const
 
void SetOption (OPTIONS option)
 
void ClearOption (OPTIONS option)
 
bool GetOption (OPTIONS option) const
 
void SetOptionsFromOther (const DRC_CONSTRAINT &aOther)
 
void ToProto (kiapi::board::CustomRuleConstraint &aProto) const
 

Public Attributes

DRC_CONSTRAINT_T m_Type
 
MINOPTMAX< int > m_Value
 
int m_DisallowFlags
 
ZONE_CONNECTION m_ZoneConnection
 
DRC_RULE_CONDITION * m_Test
 
bool m_ImplicitMin
 
wxString m_ReferenceLayer
 
wxString m_ReferenceNet
 

Private Attributes

wxString m_name
 
DRC_RULE * m_parentRule
 
DRC_RULE * m_minRule
 
DRC_RULE * m_optRule
 
DRC_RULE * m_maxRule
 
std::bitset< static_cast< int >(OPTIONS::NUM_OPTIONS)> m_options
 

Detailed Description

Definition at line 168 of file drc_rule.h.

Member Enumeration Documentation

◆ OPTIONS

enum class DRC_CONSTRAINT::OPTIONS : std::size_t
strong
Enumerator
SKEW_WITHIN_DIFF_PAIRS 
SPACE_DOMAIN 
TIME_DOMAIN 
NUM_OPTIONS 

Definition at line 187 of file drc_rule.h.

Constructor & Destructor Documentation

◆ DRC_CONSTRAINT()

DRC_CONSTRAINT::DRC_CONSTRAINT ( DRC_CONSTRAINT_T aType = NULL_CONSTRAINT,
const wxString & aName = wxEmptyString )
inline

Member Function Documentation

◆ ClearOption()

void DRC_CONSTRAINT::ClearOption ( OPTIONS option)
inline

Definition at line 266 of file drc_rule.h.

References m_options.

Referenced by DRC_RULES_PARSER::parseConstraint().

◆ GetMaxRule()

DRC_RULE * DRC_CONSTRAINT::GetMaxRule ( ) const
inline

Definition at line 233 of file drc_rule.h.

References m_maxRule.

Referenced by DRC_ENGINE::EvalRules().

◆ GetMinRule()

DRC_RULE * DRC_CONSTRAINT::GetMinRule ( ) const
inline

Definition at line 231 of file drc_rule.h.

References m_minRule.

Referenced by DRC_ENGINE::EvalRules().

◆ GetName()

wxString DRC_CONSTRAINT::GetName ( ) const
inline

Definition at line 237 of file drc_rule.h.

References GetRuleName(), and m_parentRule.

Referenced by DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts(), DRC_ENGINE::GetCachedOwnClearance(), PCB_VIA::GetDrillConstraint(), PCB_VIA::GetMinAnnulus(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_TRACK::GetWidthConstraint(), PCB_VIA::GetWidthConstraint(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), BOARD_INSPECTION_TOOL::reportClearance(), DRC_TEST_PROVIDER_CREEPAGE::reportCreepageViolation(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_CREEPAGE::testCreepage(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testKnockoutTextAgainstZone(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), PCB_CONTROL::UpdateMessagePanel(), and ROUTER_TOOL::updateSizesAfterRouterEvent().

◆ GetOption()

◆ GetOptRule()

DRC_RULE * DRC_CONSTRAINT::GetOptRule ( ) const
inline

Definition at line 232 of file drc_rule.h.

References m_optRule.

Referenced by DRC_ENGINE::EvalRules().

◆ GetParentRule()

DRC_RULE * DRC_CONSTRAINT::GetParentRule ( ) const
inline
Returns
the last rule applied. When several rules apply, each overrides only the values it sets, so use GetMinRule(), GetOptRule() or GetMaxRule() to find where a value came from.

Definition at line 222 of file drc_rule.h.

References m_parentRule.

Referenced by DRC_TEST_PROVIDER_VIA_STACK::checkAspectRatio(), DRC_TEST_PROVIDER_VIA_STACK::checkColumn(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts(), DRC_ENGINE::EvalRules(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), DRC_TEST_PROVIDER_CREEPAGE::reportCreepageViolation(), DRC_TEST_PROVIDER_CONNECTION_WIDTH::Run(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), DRC_TEST_PROVIDER_MATCHED_LENGTH::runInternal(), DRC_TEST_PROVIDER_MISC::testAssertions(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_CREEPAGE::testCreepage(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testKnockoutTextAgainstZone(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), and DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer().

◆ GetRuleName()

wxString DRC_CONSTRAINT::GetRuleName ( const DRC_RULE * aRule) const
inline
Returns
a user-facing name for aRule, or this constraint's own name when aRule is null (for constraints from board setup or local overrides rather than rules).

Definition at line 243 of file drc_rule.h.

References _, DRC_RULE::IsImplicit(), DRC_RULE::m_Name, and m_name.

Referenced by GetName().

◆ GetSeverity()

SEVERITY DRC_CONSTRAINT::GetSeverity ( ) const
inline

Definition at line 256 of file drc_rule.h.

References m_parentRule, and RPT_SEVERITY_UNDEFINED.

Referenced by BOOST_FIXTURE_TEST_CASE(), PCB_VIA_STACK::BuildMembers(), DRC_TEST_PROVIDER_VIA_STACK::checkAspectRatio(), DRC_TEST_PROVIDER_VIA_STACK::checkColumn(), CheckItemDRCViolation(), PCB_TUNING_PATTERN::CreateNew(), DIFF_PHASE_SKEW_TOOL::getMaxDiffPairGap(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_TUNING_PATTERN::GetPreviewItems(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), DRC_TEST_PROVIDER_CONNECTIVITY::Run(), DRC_TEST_PROVIDER_DISALLOW::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), DRC_TEST_PROVIDER_TEXT_DIMS::Run(), DRC_TEST_PROVIDER_VIA_DIAMETER::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), PCB_TUNING_PATTERN::ShowPropertiesDialog(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_SOLDER_MASK::testItemAgainstItems(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testKnockoutTextAgainstZone(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), DRC_TEST_PROVIDER_ZONE_CONNECTIONS::testZoneLayer(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ GetValue()

const MINOPTMAX< int > & DRC_CONSTRAINT::GetValue ( ) const
inline

Definition at line 204 of file drc_rule.h.

References m_Value.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), ZONE_FILLER::buildCopperItemClearances(), ZONE_FILLER::buildDifferentNetZoneClearances(), ZONE_FILLER::buildHatchZoneThermalRings(), PCB_VIA_STACK::BuildMembers(), PCB_VIA_STITCH::buildPlacementCells(), ZONE_FILLER::buildThermalSpokes(), DRC_TEST_PROVIDER_VIA_STACK::checkAspectRatio(), DRC_TEST_PROVIDER_VIA_STACK::checkColumn(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkLengths(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkSkews(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkStubLengths(), DRC_TEST_PROVIDER_MATCHED_LENGTH::checkViaCounts(), ComputeWorstViaClearance(), DRC_RULE_LOADER::createConstraintData(), PCB_TUNING_PATTERN::CreateNew(), DIFF_PHASE_SKEW_TOOL::getMaxDiffPairGap(), PCB_TUNING_PATTERN::GetMsgPanelInfo(), PCB_TUNING_PATTERN::GetPreviewItems(), isSymmetricMinOptMax(), ItemHasDRCViolation(), ZONE_FILLER::knockoutThermalReliefs(), PNS_PCBNEW_RULE_RESOLVER::QueryConstraint(), DRC_ENGINE::QueryDistinctConstraints(), DRC_ENGINE::QueryWorstConstraint(), ZONE_FILLER::refillZoneFromCache(), DRC_TEST_PROVIDER_CREEPAGE::reportCreepageViolation(), DRC_CACHE_GENERATOR::Run(), DRC_INTERACTIVE_COURTYARD_CLEARANCE::Run(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::Run(), DRC_TEST_PROVIDER_EDGE_CLEARANCE::Run(), DRC_TEST_PROVIDER_HOLE_TO_HOLE::Run(), DRC_TEST_PROVIDER_SILK_CLEARANCE::Run(), test::DRC_TEST_PROVIDER_DIFF_PAIR_COUPLING::Run(), PCB_TUNING_PATTERN::ShowPropertiesDialog(), DRC_TEST_PROVIDER_COURTYARD_CLEARANCE::testCourtyardClearances(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstItem(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testItemAgainstZone(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testItemAgainstZones(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testKnockoutTextAgainstZone(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testPadAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testShapeLineChain(), DRC_TEST_PROVIDER_SOLDER_MASK::testSilkToMaskClearance(), DRC_TEST_PROVIDER_COPPER_CLEARANCE::testSingleLayerItemAgainstItem(), DRC_TEST_PROVIDER_PHYSICAL_CLEARANCE::testZoneLayer(), and DRC_TEST_PROVIDER_COPPER_CLEARANCE::testZonesToZones().

◆ IsNull()

◆ IsUnary()

◆ SetName()

void DRC_CONSTRAINT::SetName ( const wxString & aName)
inline

Definition at line 235 of file drc_rule.h.

References m_name.

Referenced by DRC_ENGINE::EvalRules().

◆ SetOption()

void DRC_CONSTRAINT::SetOption ( OPTIONS option)
inline

Definition at line 264 of file drc_rule.h.

References m_options.

Referenced by DRC_RULES_PARSER::parseConstraint().

◆ SetOptionsFromOther()

void DRC_CONSTRAINT::SetOptionsFromOther ( const DRC_CONSTRAINT & aOther)
inline

Definition at line 273 of file drc_rule.h.

References DRC_CONSTRAINT(), and m_options.

Referenced by DRC_ENGINE::EvalRules().

◆ SetParentRule()

void DRC_CONSTRAINT::SetParentRule ( DRC_RULE * aParentRule)
inline

Attribute the constraint, including each min, opt and max value it has, to aParentRule.

Definition at line 210 of file drc_rule.h.

References m_maxRule, m_minRule, m_optRule, m_parentRule, and m_Value.

Referenced by DRC_RULE::AddConstraint(), and DRC_ENGINE::EvalRules().

◆ SetValueRules()

void DRC_CONSTRAINT::SetValueRules ( DRC_RULE * aMinRule,
DRC_RULE * aOptRule,
DRC_RULE * aMaxRule )
inline

Definition at line 224 of file drc_rule.h.

References m_maxRule, m_minRule, and m_optRule.

Referenced by DRC_ENGINE::EvalRules().

◆ ToProto()

◆ Value()

Member Data Documentation

◆ m_DisallowFlags

◆ m_ImplicitMin

bool DRC_CONSTRAINT::m_ImplicitMin

◆ m_maxRule

DRC_RULE* DRC_CONSTRAINT::m_maxRule
private

Definition at line 300 of file drc_rule.h.

Referenced by DRC_CONSTRAINT(), GetMaxRule(), SetParentRule(), and SetValueRules().

◆ m_minRule

DRC_RULE* DRC_CONSTRAINT::m_minRule
private

Definition at line 298 of file drc_rule.h.

Referenced by DRC_CONSTRAINT(), GetMinRule(), SetParentRule(), and SetValueRules().

◆ m_name

wxString DRC_CONSTRAINT::m_name
private

Definition at line 296 of file drc_rule.h.

Referenced by DRC_CONSTRAINT(), GetRuleName(), SetName(), and ToProto().

◆ m_options

std::bitset<static_cast<int>( OPTIONS::NUM_OPTIONS )> DRC_CONSTRAINT::m_options
private

Definition at line 301 of file drc_rule.h.

Referenced by ClearOption(), GetOption(), SetOption(), and SetOptionsFromOther().

◆ m_optRule

DRC_RULE* DRC_CONSTRAINT::m_optRule
private

Definition at line 299 of file drc_rule.h.

Referenced by DRC_CONSTRAINT(), GetOptRule(), SetParentRule(), and SetValueRules().

◆ m_parentRule

DRC_RULE* DRC_CONSTRAINT::m_parentRule
private

Definition at line 297 of file drc_rule.h.

Referenced by DRC_CONSTRAINT(), GetName(), GetParentRule(), GetSeverity(), and SetParentRule().

◆ m_ReferenceLayer

wxString DRC_CONSTRAINT::m_ReferenceLayer

◆ m_ReferenceNet

wxString DRC_CONSTRAINT::m_ReferenceNet

◆ m_Test

◆ m_Type

◆ m_Value

◆ m_ZoneConnection


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