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

#include <drc_re_numeric_constraint_types.h>

Inheritance diagram for DRC_RE_MINIMUM_VIA_DIAMETER_CONSTRAINT_DATA:
DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA DRC_RE_BASE_CONSTRAINT_DATA RULE_EDITOR_DATA_BASE ICopyable

Public Member Functions

BITMAPS GetOverlayBitmap () const override
 Returns the bitmap to use for the overlay panel background.
 
std::vector< DRC_RE_FIELD_POSITIONGetFieldPositions () const override
 Returns the field positions for controls overlaid on the constraint bitmap.
 
 DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA ()=default
 
 DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA (const DRC_RE_BASE_CONSTRAINT_DATA &aBaseData)
 
 DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA (int aId, int aParentId, double aNumericInputValue, wxString aRuleName)
 
std::vector< wxString > GetConstraintClauses (const RULE_GENERATION_CONTEXT &aContext) const override
 Returns just the constraint clauses without the rule wrapper.
 
wxString GenerateRule (const RULE_GENERATION_CONTEXT &aContext) override
 
double GetNumericInputValue ()
 
void SetNumericInputValue (double aNumericInput)
 
VALIDATION_RESULT Validate () const override
 Validates the constraint data.
 
void CopyFrom (const ICopyable &aSource) override
 
std::vector< PCB_LAYER_IDGetLayers ()
 
void SetLayers (std::vector< PCB_LAYER_ID > aLayers)
 
wxString GetLayerSource ()
 
void SetLayerSource (wxString aSource)
 
wxString GetRuleCondition ()
 
void SetRuleCondition (wxString aRuleCondition)
 
wxString GetConstraintCode () const
 
void SetConstraintCode (wxString aCode)
 
wxString GetGeneratedRule () const
 
void SetGeneratedRule (const wxString &aRule)
 
wxString GetOriginalRuleText () const
 
void SetOriginalRuleText (const wxString &aText)
 
bool WasEdited () const
 
void SetWasEdited (bool aEdited)
 
SEVERITY GetSeverity () const
 
void SetSeverity (SEVERITY aSeverity)
 
int GetId ()
 Get the unique ID of the rule.
 
void SetId (int aId)
 Set the unique ID of the rule.
 
int GetParentId ()
 Get the parent ID of the rule.
 
void SetParentId (int aParentId)
 Set the parent ID of the rule.
 
wxString GetRuleName ()
 Get the name of the rule.
 
void SetRuleName (wxString aRuleName)
 Set the name of the rule.
 
wxString GetComment ()
 Get the comment associated with the rule.
 
void SetComment (wxString aComment)
 Set the comment for the rule.
 
bool IsNew ()
 Check if the rule is marked as new.
 
void SetIsNew (bool aIsNew)
 Mark the rule as new or not.
 

Static Public Member Functions

static wxString sanitizeRuleName (const wxString &aRuleName)
 Sanitize a rule name for use in S-expression output.
 

Protected Member Functions

wxString buildRule (const RULE_GENERATION_CONTEXT &aContext, const std::vector< wxString > &aConstraintClauses) const
 

Static Protected Member Functions

static wxString quoteString (const wxString &aCondition)
 
static wxString trimTrailingZeros (const wxString &aValue)
 
static wxString formatDouble (double aValue, int aPrecision=6)
 

Private Attributes

double m_numericInputValue { 0 }
 
std::vector< PCB_LAYER_IDm_layers
 
wxString m_layerSource
 Original layer text: "inner", "outer", or layer name.
 
wxString m_ruleCondition
 
wxString m_constraintCode
 
wxString m_generatedRule
 
wxString m_originalRuleText
 
bool m_wasEdited = false
 
SEVERITY m_severity = RPT_SEVERITY_UNDEFINED
 
int m_id
 
std::optional< int > m_parentId
 
wxString m_ruleName
 
wxString m_comment
 
bool m_isNew
 Flag indicating if the user is creating a new rule (true) or editing an existing rule (false).
 

Detailed Description

Definition at line 246 of file drc_re_numeric_constraint_types.h.

Member Function Documentation

◆ buildRule()

◆ CopyFrom()

void DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::CopyFrom ( const ICopyable & aSource)
inlineoverridevirtualinherited

◆ DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA() [1/3]

DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA ( )
default

◆ DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA() [2/3]

DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA ( const DRC_RE_BASE_CONSTRAINT_DATA & aBaseData)
inlineexplicit

Definition at line 35 of file drc_re_numeric_input_constraint_data.h.

◆ DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA() [3/3]

DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA ( int aId,
int aParentId,
double aNumericInputValue,
wxString aRuleName )
inlineexplicit

Definition at line 40 of file drc_re_numeric_input_constraint_data.h.

◆ formatDouble()

◆ GenerateRule()

wxString DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::GenerateRule ( const RULE_GENERATION_CONTEXT & aContext)
inlineoverridevirtualinherited

◆ GetComment()

wxString RULE_EDITOR_DATA_BASE::GetComment ( )
inlineinherited

Get the comment associated with the rule.

Returns
The comment of the rule.

Definition at line 104 of file rule_editor_data_base.h.

References m_comment.

Referenced by DRC_RULE_SAVER::generateRuleText().

◆ GetConstraintClauses()

std::vector< wxString > DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::GetConstraintClauses ( const RULE_GENERATION_CONTEXT & aContext) const
inlineoverridevirtualinherited

Returns just the constraint clauses without the rule wrapper.

Used for merging multiple constraint panels into a single rule.

Reimplemented from DRC_RE_BASE_CONSTRAINT_DATA.

Definition at line 53 of file drc_re_numeric_input_constraint_data.h.

References DRC_RE_BASE_CONSTRAINT_DATA::formatDouble(), DRC_RE_BASE_CONSTRAINT_DATA::GetConstraintCode(), and m_numericInputValue.

Referenced by GenerateRule().

◆ GetConstraintCode()

◆ GetFieldPositions()

std::vector< DRC_RE_FIELD_POSITION > DRC_RE_MINIMUM_VIA_DIAMETER_CONSTRAINT_DATA::GetFieldPositions ( ) const
inlineoverridevirtual

Returns the field positions for controls overlaid on the constraint bitmap.

Override in derived classes to specify where input fields should be placed. Each position includes X range, Y coordinate, and tab order for navigation.

Returns
Vector of field position specifications, empty if no overlay fields.

Reimplemented from DRC_RE_BASE_CONSTRAINT_DATA.

Definition at line 251 of file drc_re_numeric_constraint_types.h.

References RIGHT.

◆ GetGeneratedRule()

wxString DRC_RE_BASE_CONSTRAINT_DATA::GetGeneratedRule ( ) const
inlineinherited

Definition at line 102 of file drc_re_base_constraint_data.h.

References m_generatedRule.

Referenced by DRC_RULE_SAVER::generateRuleText().

◆ GetId()

int RULE_EDITOR_DATA_BASE::GetId ( )
inlineinherited

Get the unique ID of the rule.

Returns
The unique ID of the rule.

Definition at line 62 of file rule_editor_data_base.h.

References m_id.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNode(), and DIALOG_DRC_RULE_EDITOR::LoadExistingRules().

◆ GetLayers()

std::vector< PCB_LAYER_ID > DRC_RE_BASE_CONSTRAINT_DATA::GetLayers ( )
inlineinherited

Definition at line 86 of file drc_re_base_constraint_data.h.

References m_layers.

◆ GetLayerSource()

wxString DRC_RE_BASE_CONSTRAINT_DATA::GetLayerSource ( )
inlineinherited

Definition at line 90 of file drc_re_base_constraint_data.h.

References m_layerSource.

◆ GetNumericInputValue()

double DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::GetNumericInputValue ( )
inlineinherited

Definition at line 85 of file drc_re_numeric_input_constraint_data.h.

References m_numericInputValue.

◆ GetOriginalRuleText()

wxString DRC_RE_BASE_CONSTRAINT_DATA::GetOriginalRuleText ( ) const
inlineinherited

Definition at line 106 of file drc_re_base_constraint_data.h.

References m_originalRuleText.

◆ GetOverlayBitmap()

BITMAPS DRC_RE_MINIMUM_VIA_DIAMETER_CONSTRAINT_DATA::GetOverlayBitmap ( ) const
inlineoverridevirtual

Returns the bitmap to use for the overlay panel background.

Override in derived classes to provide constraint-specific artwork.

Returns
BITMAPS enum value for the overlay bitmap, or BITMAPS::INVALID_BITMAP if none.

Reimplemented from DRC_RE_BASE_CONSTRAINT_DATA.

Definition at line 250 of file drc_re_numeric_constraint_types.h.

References constraint_minimum_via_diameter.

◆ GetParentId()

int RULE_EDITOR_DATA_BASE::GetParentId ( )
inlineinherited

Get the parent ID of the rule.

Returns
The parent ID of the rule, or -1 if no parent is set.

Definition at line 76 of file rule_editor_data_base.h.

References m_parentId.

Referenced by RULE_EDITOR_DIALOG_BASE::AppendNewRuleTreeItem().

◆ GetRuleCondition()

wxString DRC_RE_BASE_CONSTRAINT_DATA::GetRuleCondition ( )
inlineinherited

Definition at line 94 of file drc_re_base_constraint_data.h.

References m_ruleCondition.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ GetRuleName()

wxString RULE_EDITOR_DATA_BASE::GetRuleName ( )
inlineinherited

Get the name of the rule.

Returns
The name of the rule.

Definition at line 90 of file rule_editor_data_base.h.

References m_ruleName.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and DIALOG_DRC_RULE_EDITOR::UpdateRuleTypeTreeItemData().

◆ GetSeverity()

SEVERITY DRC_RE_BASE_CONSTRAINT_DATA::GetSeverity ( ) const
inlineinherited

Definition at line 114 of file drc_re_base_constraint_data.h.

References m_severity.

◆ IsNew()

bool RULE_EDITOR_DATA_BASE::IsNew ( )
inlineinherited

Check if the rule is marked as new.

Returns
True if the rule is new (being created), false if it is being edited.

Definition at line 118 of file rule_editor_data_base.h.

References m_isNew.

Referenced by DIALOG_DRC_RULE_EDITOR::RemoveRule().

◆ quoteString()

static wxString DRC_RE_BASE_CONSTRAINT_DATA::quoteString ( const wxString & aCondition)
inlinestaticprotectedinherited

Definition at line 170 of file drc_re_base_constraint_data.h.

References CTX_QUOTED_STR, and EscapeString().

Referenced by buildRule().

◆ sanitizeRuleName()

static wxString DRC_RE_BASE_CONSTRAINT_DATA::sanitizeRuleName ( const wxString & aRuleName)
inlinestaticinherited

Sanitize a rule name for use in S-expression output.

Replaces spaces and invalid characters with underscores.

Definition at line 138 of file drc_re_base_constraint_data.h.

References result.

Referenced by buildRule(), and DRC_RULE_SAVER::generateMergedRuleText().

◆ SetComment()

void RULE_EDITOR_DATA_BASE::SetComment ( wxString aComment)
inlineinherited

Set the comment for the rule.

Parameters
aCommentThe comment to set.

Definition at line 111 of file rule_editor_data_base.h.

References m_comment.

◆ SetConstraintCode()

void DRC_RE_BASE_CONSTRAINT_DATA::SetConstraintCode ( wxString aCode)
inlineinherited

◆ SetGeneratedRule()

void DRC_RE_BASE_CONSTRAINT_DATA::SetGeneratedRule ( const wxString & aRule)
inlineinherited

Definition at line 104 of file drc_re_base_constraint_data.h.

References m_generatedRule.

◆ SetId()

void RULE_EDITOR_DATA_BASE::SetId ( int aId)
inlineinherited

Set the unique ID of the rule.

Parameters
aIdThe unique ID to set.

Definition at line 69 of file rule_editor_data_base.h.

References m_id.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNodeData().

◆ SetIsNew()

void RULE_EDITOR_DATA_BASE::SetIsNew ( bool aIsNew)
inlineinherited

Mark the rule as new or not.

Parameters
aIsNewTrue to mark the rule as new, false to mark it as existing.

Definition at line 125 of file rule_editor_data_base.h.

References m_isNew.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNode(), and DIALOG_DRC_RULE_EDITOR::UpdateRuleTypeTreeItemData().

◆ SetLayers()

void DRC_RE_BASE_CONSTRAINT_DATA::SetLayers ( std::vector< PCB_LAYER_ID > aLayers)
inlineinherited

Definition at line 88 of file drc_re_base_constraint_data.h.

References m_layers.

◆ SetLayerSource()

void DRC_RE_BASE_CONSTRAINT_DATA::SetLayerSource ( wxString aSource)
inlineinherited

Definition at line 92 of file drc_re_base_constraint_data.h.

References m_layerSource.

◆ SetNumericInputValue()

void DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::SetNumericInputValue ( double aNumericInput)
inlineinherited

Definition at line 87 of file drc_re_numeric_input_constraint_data.h.

References m_numericInputValue.

◆ SetOriginalRuleText()

void DRC_RE_BASE_CONSTRAINT_DATA::SetOriginalRuleText ( const wxString & aText)
inlineinherited

Definition at line 108 of file drc_re_base_constraint_data.h.

References m_originalRuleText.

◆ SetParentId()

void RULE_EDITOR_DATA_BASE::SetParentId ( int aParentId)
inlineinherited

Set the parent ID of the rule.

Parameters
aParentIdThe parent ID to set.

Definition at line 83 of file rule_editor_data_base.h.

References m_parentId.

Referenced by DIALOG_DRC_RULE_EDITOR::buildRuleTreeNodeData().

◆ SetRuleCondition()

void DRC_RE_BASE_CONSTRAINT_DATA::SetRuleCondition ( wxString aRuleCondition)
inlineinherited

Definition at line 96 of file drc_re_base_constraint_data.h.

References m_ruleCondition.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ SetRuleName()

void RULE_EDITOR_DATA_BASE::SetRuleName ( wxString aRuleName)
inlineinherited

Set the name of the rule.

Parameters
aRuleNameThe name of the rule to set.

Definition at line 97 of file rule_editor_data_base.h.

References m_ruleName.

◆ SetSeverity()

void DRC_RE_BASE_CONSTRAINT_DATA::SetSeverity ( SEVERITY aSeverity)
inlineinherited

Definition at line 116 of file drc_re_base_constraint_data.h.

References m_severity.

◆ SetWasEdited()

void DRC_RE_BASE_CONSTRAINT_DATA::SetWasEdited ( bool aEdited)
inlineinherited

Definition at line 112 of file drc_re_base_constraint_data.h.

References m_wasEdited.

◆ trimTrailingZeros()

static wxString DRC_RE_BASE_CONSTRAINT_DATA::trimTrailingZeros ( const wxString & aValue)
inlinestaticprotectedinherited

Definition at line 175 of file drc_re_base_constraint_data.h.

References result.

Referenced by formatDouble().

◆ Validate()

VALIDATION_RESULT DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::Validate ( ) const
inlineoverridevirtualinherited

Validates the constraint data.

Override in derived classes to add constraint-specific validation.

Returns
Validation result containing any errors.

Reimplemented from DRC_RE_BASE_CONSTRAINT_DATA.

Definition at line 89 of file drc_re_numeric_input_constraint_data.h.

References _, m_numericInputValue, and result.

Referenced by BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

◆ WasEdited()

bool DRC_RE_BASE_CONSTRAINT_DATA::WasEdited ( ) const
inlineinherited

Definition at line 110 of file drc_re_base_constraint_data.h.

References m_wasEdited.

Member Data Documentation

◆ m_comment

wxString RULE_EDITOR_DATA_BASE::m_comment
privateinherited

Definition at line 143 of file rule_editor_data_base.h.

Referenced by CopyFrom(), GetComment(), and SetComment().

◆ m_constraintCode

wxString DRC_RE_BASE_CONSTRAINT_DATA::m_constraintCode
privateinherited

Definition at line 239 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetConstraintCode(), and SetConstraintCode().

◆ m_generatedRule

wxString DRC_RE_BASE_CONSTRAINT_DATA::m_generatedRule
privateinherited

Definition at line 240 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetGeneratedRule(), and SetGeneratedRule().

◆ m_id

int RULE_EDITOR_DATA_BASE::m_id
privateinherited

Definition at line 140 of file rule_editor_data_base.h.

Referenced by GetId(), RULE_EDITOR_DATA_BASE(), and SetId().

◆ m_isNew

bool RULE_EDITOR_DATA_BASE::m_isNew
privateinherited

Flag indicating if the user is creating a new rule (true) or editing an existing rule (false).

Definition at line 144 of file rule_editor_data_base.h.

Referenced by IsNew(), RULE_EDITOR_DATA_BASE(), and SetIsNew().

◆ m_layers

std::vector<PCB_LAYER_ID> DRC_RE_BASE_CONSTRAINT_DATA::m_layers
privateinherited

Definition at line 236 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetLayers(), and SetLayers().

◆ m_layerSource

wxString DRC_RE_BASE_CONSTRAINT_DATA::m_layerSource
privateinherited

Original layer text: "inner", "outer", or layer name.

Definition at line 237 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetLayerSource(), and SetLayerSource().

◆ m_numericInputValue

double DRC_RE_NUMERIC_INPUT_CONSTRAINT_DATA::m_numericInputValue { 0 }
privateinherited

◆ m_originalRuleText

wxString DRC_RE_BASE_CONSTRAINT_DATA::m_originalRuleText
privateinherited

◆ m_parentId

std::optional<int> RULE_EDITOR_DATA_BASE::m_parentId
privateinherited

Definition at line 141 of file rule_editor_data_base.h.

Referenced by GetParentId(), RULE_EDITOR_DATA_BASE(), and SetParentId().

◆ m_ruleCondition

wxString DRC_RE_BASE_CONSTRAINT_DATA::m_ruleCondition
privateinherited

Definition at line 238 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetRuleCondition(), and SetRuleCondition().

◆ m_ruleName

wxString RULE_EDITOR_DATA_BASE::m_ruleName
privateinherited

Definition at line 142 of file rule_editor_data_base.h.

Referenced by GetRuleName(), RULE_EDITOR_DATA_BASE(), and SetRuleName().

◆ m_severity

SEVERITY DRC_RE_BASE_CONSTRAINT_DATA::m_severity = RPT_SEVERITY_UNDEFINED
privateinherited

Definition at line 243 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), GetSeverity(), and SetSeverity().

◆ m_wasEdited

bool DRC_RE_BASE_CONSTRAINT_DATA::m_wasEdited = false
privateinherited

Definition at line 242 of file drc_re_base_constraint_data.h.

Referenced by CopyFrom(), SetWasEdited(), and WasEdited().


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